:root {
  color-scheme: dark;
}

.auth-body {
  font-family: "Tajawal", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
}

.auth-main {
  padding: 2rem 1.25rem 3rem;
}

.auth-shell {
  width: min(100%, var(--container-width));
  margin: 0 auto;
}

.auth-card {
  background: var(--card-bg);
  border-radius: var(--radius-card);
  padding: 0;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.15);
  /* More premium shadow */
  border: 1px solid rgba(255, 255, 255, 0.4);
  /* Glassmorphism border hint */
  color: var(--royal-black);
  --portal-text: var(--royal-black);
  --portal-muted: var(--muted-text);
  overflow: hidden;
  position: relative;
}

.auth-card__header {
  background: linear-gradient(135deg, var(--bg-primary) 0%, #2a3f5f 100%);
  padding: 2.5rem 1.75rem 2rem;
  text-align: center;
  border-bottom: 2px solid var(--gold);
}

.auth-card__body {
  padding: 2.5rem 2.25rem;
}

.auth-card__body .form-label {
  color: var(--royal-black);
  font-weight: 700;
  margin-bottom: 0.5rem;
}

/* Professional Input Grid */
.auth-field {
  display: flex;
  flex-direction: row;
  /* In RTL: Label(Right), Input(Left) */
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.auth-field__label {
  flex: 0 0 110px;
  /* Consistent width for all labels */
  text-align: right;
  font-weight: 700;
  color: var(--royal-black);
  font-size: 0.95rem;
  margin: 0;
  white-space: nowrap;
}

.auth-field__input {
  flex: 1;
}

.auth-title {
  color: #FFFFFF;
  /* White title on dark header */
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.auth-subtitle {
  color: rgba(255, 255, 255, 0.7);
  margin: 0;
}

.auth-icon {
  color: var(--gold);
  margin-bottom: 1rem;
  filter: drop-shadow(0 4px 12px rgba(212, 175, 55, 0.3));
}

.auth-input {
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  padding: 0.75rem 1.1rem;
  font-size: 1rem;
  background-color: #ffffff;
  color: #1e293b;
  font-weight: 500;
  transition: all 0.2s ease;
  width: 100%;
}

.auth-input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--gold) 20%, transparent);
}

.auth-input::placeholder {
  color: #94a3b8;
  font-weight: 400;
}

.auth-muted {
  color: var(--muted-text);
}

.auth-header .navbar-brand {
  color: var(--text-primary);
  letter-spacing: 0.04em;
}

.auth-header .ghost-button {
  border-color: color-mix(in srgb, var(--text-primary) 30%, transparent);
  color: var(--text-primary);
  background: transparent;
  box-shadow: none;
}

.auth-header .ghost-button:hover {
  background: color-mix(in srgb, var(--text-primary) 12%, transparent);
}

.alert {
  width: 100%;
  margin-bottom: 1.5rem;
  padding: 1rem 1.25rem;
  border-radius: 12px;
  background: #f8fafc;
  color: #1e293b;
  border: 1px solid #e2e8f0;
  font-weight: 500;
}

.alert-success {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #15803d;
}

.alert-danger {
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
}

.btn-gradient {
  color: var(--royal-black) !important;
  background: linear-gradient(135deg, var(--gold) 0%, #f4d26a 100%);
  border: none;
  box-shadow: 0 10px 25px -5px rgba(212, 175, 55, 0.4);
  border-radius: var(--radius-pill);
  font-weight: 700;
  padding: 0.8rem 1.5rem;
  transition: all 0.2s ease;
}

.btn-gradient:hover {
  transform: translateY(-1px);
  box-shadow: 0 15px 30px -5px rgba(212, 175, 55, 0.5);
  filter: brightness(1.05);
}

.btn-gradient:active {
  transform: translateY(0);
}


.auth-ghost {
  width: 100%;
  justify-content: center;
  gap: 0.5rem;
}

.auth-footer {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: center;
  text-align: center;
}

.auth-choice-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.auth-option-card {
  background: var(--card-bg);
  border-radius: var(--radius-card);
  padding: 1.75rem;
  text-decoration: none;
  color: var(--royal-black);
  border: 1px solid color-mix(in srgb, var(--royal-black) 8%, transparent);
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.auth-option-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card);
}

.auth-option-card__title {
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--royal-black);
}

.auth-option-card__desc {
  color: var(--muted-text);
  margin-bottom: 1.5rem;
}

.toast-banner {
  position: fixed;
  inset-inline: 18px;
  bottom: 28px;
  border-radius: 20px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: color-mix(in srgb, var(--gold) 90%, transparent);
  color: var(--royal-black);
  font-size: 0.95rem;
  box-shadow: var(--shadow-soft);
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 1050;
}

.toast-banner[data-visible="true"] {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

@media (min-width: 768px) {
  .auth-main {
    padding: 3rem 0 4rem;
  }
}

@media (max-width: 768px) {
  .auth-main {
    padding: 2rem 1rem 3rem;
  }

  .auth-card__header,
  .auth-card__body {
    padding: 1.75rem 1.25rem;
  }

  .auth-input {
    font-size: 1.02rem;
  }
}

@media (max-width: 576px) {
  .auth-field {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .auth-field__label {
    flex: 0 0 auto;
    text-align: right;
    width: 100%;
    margin-bottom: 0.25rem;
  }
}

@media (max-width: 380px) {

  .auth-card__header,
  .auth-card__body {
    padding: 1.5rem 1rem;
  }

  .auth-title {
    font-size: 1.2rem;
  }
}


html,
body {
  height: 100%;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
}

.auth-main {
  padding-bottom: env(safe-area-inset-bottom, 1.5rem);
}