/* ==========================================================================
   INABA (إنابة) — Minimal Centered Authentication Experience
   Login, Register, Forgot Password, Reset Password
   Direction: Dynamic (RTL / LTR) | Themes: Light & Dark
   ========================================================================== */

/* Page Body Base */
.auth-page-body {
  min-height: 100vh;
  margin: 0;
  padding: 0;
  background-color: var(--bg-main, #FAF8F5);
  color: var(--text-main, #14201B);
  font-family: var(--font-body, system-ui, -apple-system, sans-serif);
  display: flex;
  flex-direction: column;
}

[data-theme="dark"] .auth-page-body {
  background-color: var(--bg-main, #061A12);
  color: var(--text-main, #EDF2EE);
}

/* Top Utilities Bar (Language + Theme) */
.auth-top-nav {
  position: absolute;
  top: 1.25rem;
  inset-inline-end: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  z-index: 100;
}

/* Full Viewport Centered Wrapper */
.auth-minimal-page,
.auth-main-wrapper {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.25rem;
  box-sizing: border-box;
  width: 100%;
}

/* ==========================================================================
   1. AUTHENTICATION CARD
   ========================================================================== */
.auth-card {
  width: 100%;
  max-width: 520px;
  margin: auto;
  background-color: var(--bg-surface, #FFFFFF);
  border: 1px solid var(--border-color, #E4ECE7);
  border-radius: var(--radius-xl, 16px);
  padding: 2.75rem 2.25rem;
  box-shadow: 0 10px 30px rgba(14, 77, 52, 0.06), 0 2px 6px rgba(14, 77, 52, 0.04);
  transition: box-shadow var(--transition-base, 0.25s ease), border-color var(--transition-base, 0.25s ease);
  box-sizing: border-box;
  position: relative;
}

[data-theme="dark"] .auth-card {
  background-color: var(--bg-surface, #0E251B);
  border-color: var(--border-color, rgba(197, 168, 105, 0.2));
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}

/* Card Width Variants */
.auth-card-login {
  max-width: 520px;
}

.auth-card-register {
  max-width: 780px;
  padding: 2.85rem 2.5rem;
}

.auth-card-forgot,
.auth-card-reset {
  max-width: 500px;
}

/* Top Card Branding: Emblem + Wordmark */
.auth-card-brand {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 1.5rem;
}

.auth-brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
  transition: transform var(--transition-fast, 0.15s ease);
}

.auth-brand-logo:hover {
  transform: translateY(-1px);
}

.auth-brand-logo .brand-emblem {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.auth-brand-logo .brand-official-logo {
  display: block;
  height: 46px;
  width: auto;
  max-width: 54px;
  object-fit: contain;
  background: transparent;
  transition: transform var(--transition-fast, 0.15s ease);
}

.auth-brand-logo .brand-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-brand-logo .brand-name {
  font-family: var(--font-heading, inherit);
  font-weight: 800;
  font-size: 1.45rem;
  color: var(--primary, #0E4D34);
  line-height: 1.15;
}

[data-theme="dark"] .auth-brand-logo .brand-name {
  color: #FFFFFF;
}

.auth-brand-logo .brand-tagline-small {
  display: none !important;
}

/* Card Header */
.auth-header {
  text-align: center;
  margin-bottom: 1.75rem;
}

.auth-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-primary, #14201B);
  margin: 0 0 0.4rem 0;
  line-height: 1.3;
  letter-spacing: -0.3px;
}

[data-theme="dark"] .auth-title {
  color: #FFFFFF;
}

.auth-subtitle {
  font-size: 0.925rem;
  color: var(--text-secondary, #536B60);
  line-height: 1.55;
  margin: 0;
}

[data-theme="dark"] .auth-subtitle {
  color: #B2C4BB;
}

/* Notice Box */
.auth-notice-box {
  background-color: rgba(14, 77, 52, 0.05);
  border: 1px solid rgba(14, 77, 52, 0.15);
  border-radius: var(--radius-md, 8px);
  padding: 0.85rem 1.15rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.84rem;
  line-height: 1.6;
  color: var(--text-secondary, #536B60);
}

[data-theme="dark"] .auth-notice-box {
  background-color: rgba(18, 117, 80, 0.15);
  border-color: rgba(216, 183, 114, 0.25);
  color: #B2C4BB;
}

.auth-notice-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--primary, #0E4D34);
  margin-top: 2px;
}

[data-theme="dark"] .auth-notice-icon {
  color: var(--accent-gold, #C5A869);
}

/* Alerts */
.auth-card .alert {
  margin-bottom: 1.5rem;
  padding: 0.9rem 1.15rem;
  border-radius: var(--radius-md, 8px);
  font-size: 0.875rem;
  line-height: 1.55;
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
}

.alert-danger {
  background-color: #FEF2F2;
  border: 1px solid #FCA5A5;
  color: #991B1B;
}

[data-theme="dark"] .alert-danger {
  background-color: rgba(185, 28, 28, 0.18);
  border-color: rgba(239, 68, 68, 0.35);
  color: #FCA5A5;
}

.alert-success {
  background-color: #F0FDF4;
  border: 1px solid #86EFAC;
  color: #166534;
}

[data-theme="dark"] .alert-success {
  background-color: rgba(22, 101, 52, 0.2);
  border-color: rgba(34, 197, 94, 0.35);
  color: #86EFAC;
}

.alert-info {
  background-color: #F0F9FF;
  border: 1px solid #BAE6FD;
  color: #075985;
}

[data-theme="dark"] .alert-info {
  background-color: rgba(14, 116, 144, 0.18);
  border-color: rgba(56, 189, 248, 0.35);
  color: #BAE6FD;
}

.auth-alert-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ==========================================================================
   2. FORM CONTROLS & GROUPING
   ========================================================================== */
.auth-form {
  width: 100%;
}

.auth-group-header {
  margin: 1.75rem 0 1rem 0;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-light, #E8EEEB);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

[data-theme="dark"] .auth-group-header {
  border-bottom-color: rgba(197, 168, 105, 0.15);
}

.auth-group-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--primary, #0E4D34);
  margin: 0;
}

[data-theme="dark"] .auth-group-title {
  color: var(--accent-gold, #C5A869);
}

.auth-row-2col {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.15rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-main, #14201B);
  margin-bottom: 0.45rem;
}

[data-theme="dark"] .form-label {
  color: #EDF2EE;
}

.required-star {
  color: var(--status-danger, #B91C1C);
}

/* Input with Leading Icon */
.auth-input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-input-icon {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: var(--text-muted, #7C9488);
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition-fast, 0.15s ease);
}

html[dir="rtl"] .auth-input-icon {
  right: 1.1rem;
}

html[dir="ltr"] .auth-input-icon {
  left: 1.1rem;
}

.auth-input-control {
  width: 100%;
  height: 52px;
  background-color: var(--bg-muted, #F4F7F5);
  border: 1px solid var(--border-color, #E4ECE7);
  border-radius: var(--radius-md, 8px);
  font-size: var(--font-size-sm, 0.875rem);
  color: var(--text-main, #14201B);
  transition: border-color var(--transition-fast, 0.15s ease), background-color var(--transition-fast, 0.15s ease), box-shadow var(--transition-fast, 0.15s ease);
  outline: none;
  font-family: inherit;
  box-sizing: border-box;
}

html[dir="rtl"] .auth-input-control {
  padding: 0 3.1rem 0 1.25rem;
}

html[dir="ltr"] .auth-input-control {
  padding: 0 1.25rem 0 3.1rem;
}

.auth-input-control:focus {
  background-color: var(--bg-surface, #FFFFFF);
  border-color: var(--border-focus, #0E4D34);
  box-shadow: 0 0 0 3px rgba(14, 77, 52, 0.12);
}

[data-theme="dark"] .auth-input-control {
  background-color: var(--bg-subtle, #122C20);
  border-color: var(--border-color, rgba(197, 168, 105, 0.2));
  color: var(--text-main, #EDF2EE);
}

[data-theme="dark"] .auth-input-control:focus {
  background-color: var(--bg-surface, #0E251B);
  border-color: var(--accent-gold, #C5A869);
  box-shadow: 0 0 0 3px rgba(216, 183, 114, 0.15);
}

.auth-input-group:focus-within .auth-input-icon {
  color: var(--primary, #0E4D34);
}

[data-theme="dark"] .auth-input-group:focus-within .auth-input-icon {
  color: var(--accent-gold, #C5A869);
}

.auth-input-control.is-invalid {
  border-color: var(--status-danger, #B91C1C);
  background-color: rgba(185, 28, 28, 0.03);
}

.form-error-msg {
  display: block;
  font-size: var(--font-size-xs, 0.75rem);
  color: var(--status-danger, #B91C1C);
  margin-top: 0.35rem;
}

.form-hint {
  display: block;
  font-size: var(--font-size-xs, 0.75rem);
  color: var(--text-muted, #7C9488);
  margin-top: 0.35rem;
}

/* Custom Select Dropdown with Adornment */
.auth-select-control {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
}

.auth-select-chevron {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-muted, #7C9488);
  pointer-events: none;
}

html[dir="rtl"] .auth-select-chevron {
  left: 1.1rem;
}

html[dir="ltr"] .auth-select-chevron {
  right: 1.1rem;
}

/* Password Toggle Button */
.password-toggle-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted, #7C9488);
  cursor: pointer;
  padding: 0.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition-fast, 0.15s ease);
  border-radius: var(--radius-sm, 4px);
}

html[dir="rtl"] .password-toggle-btn {
  left: 0.85rem;
}

html[dir="ltr"] .password-toggle-btn {
  right: 0.85rem;
}

.password-toggle-btn:hover {
  color: var(--primary, #0E4D34);
}

[data-theme="dark"] .password-toggle-btn:hover {
  color: var(--accent-gold, #C5A869);
}

/* Password Field with Both Leading Icon and Trailing Toggle */
html[dir="rtl"] .auth-input-password {
  padding: 0 3.1rem 0 3rem;
}

html[dir="ltr"] .auth-input-password {
  padding: 0 3rem 0 3.1rem;
}

/* Remember Me & Forgot Password Row */
.auth-remember-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 1.25rem 0 1.5rem 0;
  font-size: 0.875rem;
}

.form-check {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  margin: 0;
  user-select: none;
}

.form-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary, #0E4D34);
  cursor: pointer;
  border-radius: var(--radius-xs, 3px);
}

.form-check-label {
  font-size: 0.875rem;
  color: var(--text-secondary, #536B60);
}

[data-theme="dark"] .form-check-label {
  color: #B2C4BB;
}

.auth-forgot-link {
  color: var(--primary, #0E4D34);
  font-weight: 700;
  text-decoration: none;
  transition: color var(--transition-fast, 0.15s ease);
}

.auth-forgot-link:hover {
  text-decoration: underline;
  color: var(--primary-hover, #126343);
}

[data-theme="dark"] .auth-forgot-link {
  color: var(--accent-gold, #C5A869);
}

/* Performer Opt-in Card */
.performer-optin-card {
  background-color: rgba(14, 77, 52, 0.04);
  border: 1px solid rgba(14, 77, 52, 0.15);
  border-radius: var(--radius-md, 8px);
  padding: 1.25rem;
  margin: 1.5rem 0;
  transition: border-color var(--transition-fast, 0.15s ease);
}

[data-theme="dark"] .performer-optin-card {
  background-color: rgba(18, 117, 80, 0.15);
  border-color: rgba(216, 183, 114, 0.25);
}

.performer-optin-card .form-check-label strong {
  color: var(--primary, #0E4D34);
  display: block;
  font-size: 0.925rem;
  font-weight: 800;
  margin-bottom: 0.35rem;
}

[data-theme="dark"] .performer-optin-card .form-check-label strong {
  color: var(--accent-gold, #C5A869);
}

.performer-optin-card .form-check-label p {
  font-size: 0.815rem;
  color: var(--text-secondary, #536B60);
  line-height: 1.6;
  margin: 0;
}

[data-theme="dark"] .performer-optin-card .form-check-label p {
  color: #B2C4BB;
}

/* Submit CTA */
.auth-submit-btn {
  width: 100%;
  height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background-color: var(--primary, #0E4D34);
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-md, 8px);
  font-size: var(--font-size-base, 1rem);
  font-weight: 700;
  cursor: pointer;
  transition: background-color var(--transition-fast, 0.15s ease), transform var(--transition-fast, 0.15s ease), box-shadow var(--transition-fast, 0.15s ease);
  margin-top: 0.75rem;
  box-shadow: 0 4px 14px rgba(14, 77, 52, 0.22);
  font-family: inherit;
}

.auth-submit-btn:hover {
  background-color: var(--primary-hover, #126343);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(14, 77, 52, 0.3);
}

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

.auth-submit-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* Footer Cross-Link Prompt */
.auth-footer-prompt {
  text-align: center;
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-light, #E8EEEB);
  font-size: 0.9rem;
  color: var(--text-secondary, #536B60);
}

[data-theme="dark"] .auth-footer-prompt {
  border-top-color: rgba(197, 168, 105, 0.15);
  color: #B2C4BB;
}

.auth-footer-prompt a {
  color: var(--primary, #0E4D34);
  font-weight: 800;
  text-decoration: underline;
  margin-inline-start: 0.35rem;
  transition: color var(--transition-fast, 0.15s ease);
}

.auth-footer-prompt a:hover {
  color: var(--primary-hover, #126343);
}

[data-theme="dark"] .auth-footer-prompt a {
  color: var(--accent-gold, #C5A869);
}

/* Back Link (for Forgot Password & Reset Password) */
.auth-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--primary, #0E4D34);
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  transition: color var(--transition-fast, 0.15s ease);
}

.auth-back-link:hover {
  text-decoration: underline;
  color: var(--primary-hover, #126343);
}

html[dir="rtl"] .auth-back-link svg {
  transform: scaleX(-1);
}

[data-theme="dark"] .auth-back-link {
  color: var(--accent-gold, #C5A869);
}

/* ==========================================================================
   3. RESPONSIVE MEDIA QUERIES
   ========================================================================== */
@media (max-width: 768px) {
  .auth-minimal-page,
  .auth-main-wrapper {
    padding: 2rem 1rem;
  }

  .auth-card {
    padding: 2.25rem 1.5rem;
    border-radius: var(--radius-lg, 12px);
  }

  .auth-card-register {
    padding: 2.25rem 1.5rem;
  }

  .auth-row-2col {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

@media (max-width: 480px) {
  .auth-minimal-page,
  .auth-main-wrapper {
    padding: 1.5rem 0.85rem;
  }

  .auth-card {
    padding: 1.85rem 1.15rem;
  }

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

  .auth-remember-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
}
