[x-cloak] {
  display: none !important;
}

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: #1c1917;
  background: #fafaf9;
  min-height: 100vh;
  direction: rtl;
  padding: 0;
}

/* Page Container */
.page-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
  margin: 0 auto;
  background: #ffffff;
  border: 1px solid #e7e5e4;
  border-radius: 0;
  overflow: hidden;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
  padding: 0;
}

/* Hero Section */
.hero-section {
  background: #1c1917;
  color: white;
  padding: 4rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  text-align: center;
  border-right: 1px solid #e7e5e4;
}

.hero-content {
  z-index: 2;
  position: relative;
}

.hero-header {
  margin-bottom: 4rem;
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  font-size: 1.75rem;
  font-weight: 700;
}

.logo-icon {
  width: 3rem;
  height: 3rem;
  background: #292524;
  border: 1px solid #44403c;
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.logo-icon svg {
  width: 1.5rem;
  height: 1.5rem;
  stroke: white;
}

.hero-main {
  margin-bottom: 2rem;
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 1.5rem;
  color: white;
}

.hero-description {
  font-size: 1.25rem;
  opacity: 0.8;
  max-width: 400px;
  margin: 0 auto;
  font-weight: 400;
  color: #a8a29e;
}

.hero-footer {
  margin-top: 2rem;
  display: flex;
  justify-content: center;
}

.back-to-home {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: white;
  font-size: 0.875rem;
  text-decoration: none;
  background: transparent;
  border: 1px solid #44403c;
  padding: 0.75rem 1.25rem;
  border-radius: 0.5rem;
  transition: all 0.2s ease;
}

.back-to-home:hover {
  background: #292524;
  color: white;
  transform: translateY(-1px);
}

.back-icon {
  width: 1.25rem;
  height: 1.25rem;
  stroke: currentColor;
  transition: transform 0.2s ease;
}

.back-to-home:hover .back-icon {
  transform: translateX(-2px);
}

.back-text {
  font-weight: 500;
}

/* Auth Section */
.auth-section {
  background: #fafaf9;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
}

.app-container {
  width: 100%;
  max-width: 420px;
}

.auth-card {
  background: white;
  border: 1px solid #e7e5e4;
  border-radius: 0.75rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
  padding: 3rem;
}

.auth-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.auth-title {
  font-size: 1.875rem;
  font-weight: 700;
  color: #1c1917;
  margin-bottom: 0.75rem;
}

.auth-description {
  color: #57534e;
  font-size: 1rem;
  font-weight: 400;
}

.auth-content {
  width: 100%;
}

.auth-form {
  width: 100%;
}

.form-section {
  margin-bottom: 2rem;
}

.input-group {
  margin-bottom: 1.5rem;
}

.input-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  color: #44403c;
  margin-bottom: 0.75rem;
}

.input-wrapper {
  position: relative;
}

.form-input {
  width: 100%;
  padding: 1rem 1rem;
  padding-right: 3rem;
  border: 1px solid #d6d3d1;
  background: white;
  border-radius: 0.5rem;
  font-size: 1rem;
  transition: all 0.2s ease;
  font-weight: 400;
  color: #1c1917;
}

.form-input:focus {
  outline: none;
  border-color: #57534e;
  box-shadow: 0 0 0 3px rgba(87, 83, 78, 0.1);
}

.input-icon {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.25rem;
  height: 1.25rem;
  stroke: #a8a29e;
  pointer-events: none;
  opacity: 0.7;
}

.password-input {
  padding-left: 3rem;
}

.password-toggle {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  background: #f5f5f4;
  border: 1px solid #d6d3d1;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 0.375rem;
  transition: all 0.2s ease;
}

.password-toggle:hover {
  background: #e7e5e4;
  transform: translateY(-50%) scale(1.02);
}

.eye-icon {
  width: 1.25rem;
  height: 1.25rem;
  stroke: #57534e;
}

.otp-input {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: 0.5rem;
  padding-right: 1rem !important;
  font-family: 'Courier New', monospace;
}

.button-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 2rem;
}

.submit-button {
  width: 100%;
  background: #1c1917;
  color: white;
  border: none;
  padding: 1rem 1.5rem;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  position: relative;
  overflow: hidden;
  min-height: 3.5rem;
}

.submit-button:hover:not(:disabled) {
  background: #292524;
  transform: translateY(-1px);
}

.submit-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.submit-button.loading {
  pointer-events: none;
}

.button-content {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: white;
  font-weight: 600;
}

.arrow-icon {
  width: 1rem;
  height: 1rem;
  stroke: currentColor;
  flex-shrink: 0;
}

.loading-spinner {
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top: 2px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.loading-text {
  color: white;
  font-weight: 600;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.secondary-button {
  width: auto;
  background: white;
  color: #44403c;
  border: 1px solid #d6d3d1;
  padding: 0.75rem 1.25rem;
  border-radius: 0.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.secondary-button:hover:not(:disabled) {
  background: #f5f5f4;
  border-color: #a8a29e;
  color: #1c1917;
  transform: translateY(-1px);
}

.secondary-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Toast System */
.toast-container {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 24rem;
  pointer-events: none;
}

.toast {
  border-radius: 0.5rem;
  padding: 1.25rem;
  border: 1px solid #e7e5e4;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
  pointer-events: auto;
  background: white;
}

/* Toast Variants */
.toast-success {
  background: #16a34a;
  color: white;
  border-color: #15803d;
}

.toast-error {
  background: #dc2626;
  color: white;
  border-color: #b91c1c;
}

.toast-info {
  background: #2563eb;
  color: white;
  border-color: #1d4ed8;
}

.toast-content {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding-left: 2rem;
}

.toast-icon {
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
}

.toast-icon svg {
  width: 100%;
  height: 100%;
  stroke: white;
}

.toast-text {
  flex: 1;
  min-width: 0;
}

.toast-title {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
  color: white;
}

.toast-description {
  font-size: 0.875rem;
  opacity: 0.9;
  color: white;
}

.toast-action {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 0.25rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  margin-right: auto;
  color: white;
}

.toast-action:hover {
  background: rgba(255, 255, 255, 0.3);
}

.toast-close {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 50%;
  width: 1.75rem;
  height: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: all 0.2s ease;
}

.toast:hover .toast-close {
  opacity: 1;
}

.toast-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

.toast-close svg {
  width: 0.875rem;
  height: 0.875rem;
  stroke: white;
}

.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 0.25rem;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 0 0 0.5rem 0.5rem;
  transition: width 0.1s linear;
}

/* Toast Animations */
.toast-enter {
  transition: all 0.3s ease;
}

.toast-enter-start {
  opacity: 0;
  transform: translateX(100%);
}

.toast-enter-end {
  opacity: 1;
  transform: translateX(0);
}

.toast-leave {
  transition: all 0.3s ease;
}

.toast-leave-start {
  opacity: 1;
  transform: translateX(0);
}

.toast-leave-end {
  opacity: 0;
  transform: translateX(100%);
}

/* Congratulation Message Styles */
.congratulations-container {
  display: flex;
  width: 100%;
  height: 100vh;
  background: #fafaf9;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  justify-content: center;
  align-items: center;
  padding: 2rem;
}

.congratulations-card {
  background: white;
  border: 1px solid #e7e5e4;
  border-radius: 0.75rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  padding: 3rem;
  text-align: center;
}

.congratulations-message {
  text-align: center;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.5s ease-out;
}

.congratulations-message.active {
  opacity: 1;
  transform: translateY(0);
}

.congratulations-icon {
  width: 6rem;
  height: 6rem;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.congratulations-icon svg {
  width: 3rem;
  height: 3rem;
  color: #16a34a;
}

.congratulations-title {
  font-size: 2.25rem;
  font-weight: 700;
  color: #1c1917;
}

.congratulations-description {
  color: #57534e;
  font-size: 1.25rem;
  line-height: 1.6;
}

.congratulations-count-down {
  color: #a8a29e;
  font-size: 1rem;
  margin-top: 1rem;
}

.congratulations-button {
  background: #1c1917;
  color: white;
  border: none;
  padding: 1rem 1.5rem;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.congratulations-button:hover {
  background: #292524;
  transform: translateY(-1px);
}

/* Form step transitions */
.form-step-enter-active,
.form-step-leave-active {
  transition: all 0.3s ease-out;
}

.form-step-enter-from,
.form-step-leave-to {
  opacity: 0;
  transform: translateY(20px);
}

.input-group.phone-input-group {
  margin-bottom: 1.5rem;
}

.phone-input-group .input-label {
  color: #44403c;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.75rem;
}

.phone-input-group .form-input {
  padding-left: 3rem;
}

.phone-input-group .input-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.25rem;
  height: 1.25rem;
  stroke: #a8a29e;
}

.otp-phone-group {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.error-message {
  color: #dc2626;
  font-size: 0.875rem;
  margin-top: 0.5rem;
  font-weight: 500;
}

/* Responsive Design */
@media (max-width: 640px) {
  .toast-container {
    right: 1rem;
    left: 1rem;
    max-width: none;
  }

  .page-container {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .hero-section {
    padding: 2rem;
    border-right: none;
    border-bottom: 1px solid #e7e5e4;
  }

  .hero-title {
    font-size: 2.5rem;
  }

  .auth-section {
    padding: 2rem;
  }

  .auth-card {
    padding: 2rem;
  }
}
