/* ============================================================
   BMS/MMS Auth Pages — Login / Register / Reset Password
   ============================================================ */

/* ── Force full viewport on auth pages ── */
html, body {
  width: 100vw;
  height: 100dvh;
  overflow: hidden;
  margin: 0;
  padding: 0;
}

/* Hide regular navbar on auth pages */
body:has(.auth-page) > nav.navbar { display: none !important; }

/* Override idBody to be a transparent full-viewport wrapper on auth pages */
body:has(.auth-page) > #idBody {
  display: block !important;
  width: 100vw !important;
  height: 100dvh !important;
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
  overflow: visible !important;
  flex: none !important;
}

body:has(.auth-page) > #idBody > .col-1,
body:has(.auth-page) > #idBody > div[style] {
  display: none !important;
}

body:has(.auth-page) > #idBody > div:has(.auth-page) {
  display: block !important;
  width: 100vw !important;
  height: 100dvh !important;
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
  flex: none !important;
}

/* Full-viewport content-area override */
body:has(.auth-page) .content-area {
  width: 100vw !important;
  height: 100dvh !important;
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  display: block !important;
}

/* ── Auth-specific root variables ── */
:root {
  --auth-bg:              #F0F3F8;
  --auth-card-bg:         #FFFFFF;
  --auth-card-radius:      14px;
  --auth-card-shadow:      0 2px 16px rgba(15, 23, 42, 0.08), 0 8px 32px rgba(15, 23, 42, 0.06);
  --auth-input-height:     52px;
  --auth-input-radius:     10px;
  --auth-input-border:     #DDE3EE;
  --auth-input-focus:      #012C9B;
  --auth-input-bg:         #F9FAFB;
  --auth-input-focus-bg:   #FFFFFF;
  --auth-btn-height:       48px;
  --auth-btn-radius:       8px;
  --auth-divider:          #EEF1F6;
  --auth-text-muted:       #64748B;
}

/* ── Auth page: full-viewport background container ── */
.auth-page {
  position: relative;
  width: 100vw;
  height: 100dvh;
  overflow: hidden;
  box-sizing: border-box;
  /* decorative background will be on ::before pseudo */
}

.auth-page::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    /* diagonal fabric-like stripe texture */
    repeating-linear-gradient(
      135deg,
      transparent,
      transparent 3px,
      rgba(1, 44, 155, 0.028) 3px,
      rgba(1, 44, 155, 0.028) 4px
    ),
    repeating-linear-gradient(
      45deg,
      transparent,
      transparent 3px,
      rgba(231, 2, 22, 0.018) 3px,
      rgba(231, 2, 22, 0.018) 4px
    ),
    /* continuous wave curve — stacked ellipses at bottom */
    radial-gradient(ellipse 70% 65% at 5% 100%,  rgba(1,44,155,0.10) 0%, transparent 45%),
    radial-gradient(ellipse 65% 70% at 18% 100%, rgba(1,44,155,0.08) 0%, transparent 28%),
    radial-gradient(ellipse 75% 72% at 30% 100%, rgba(1,44,155,0.09) 0%, transparent 22%),
    radial-gradient(ellipse 60% 75% at 42% 100%, rgba(1,44,155,0.07) 0%, transparent 35%),
    radial-gradient(ellipse 80% 68% at 55% 100%, rgba(1,44,155,0.10) 0%, transparent 24%),
    radial-gradient(ellipse 68% 72% at 68% 100%, rgba(1,44,155,0.08) 0%, transparent 30%),
    radial-gradient(ellipse 72% 70% at 80% 100%, rgba(1,44,155,0.09) 0%, transparent 26%),
    radial-gradient(ellipse 66% 66% at 92% 100%, rgba(1,44,155,0.07) 0%, transparent 38%),
    /* main gradient */
    linear-gradient(160deg, #F0F4FA 0%, #E8ECF5 30%, #F5F7FB 70%, #F0F3F8 100%);
  pointer-events: none;
  z-index: 0;
}

/* Subtle radial glow overlay for depth */
.auth-page::after {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(1, 44, 155, 0.10) 0%, transparent 60%),
              radial-gradient(ellipse at 80% 80%, rgba(231, 2, 22, 0.07) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* ── Fixed header bar (72px) ── */
.auth-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 72px;
  display: flex;
  align-items: center;
  padding: 0 32px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  box-sizing: border-box;
  z-index: 10;
}

.auth-header-logo {
  height: 34px;
  width: auto;
  margin-right: 12px;
  flex-shrink: 0;
}

.auth-header-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1.2;
}

.auth-header-title {
  font-size: 15px;
  font-weight: 600;
  color: #012C9B;
  line-height: 1.2;
  white-space: nowrap;
}

.auth-header-subtitle {
  font-size: 8px;
  font-weight: 700;
  color: #E70216;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-top: 1px;
  white-space: nowrap;
}

/* ── Main content area (below header) ── */
.auth-main {
  position: relative;
  z-index: 1;
  width: 100vw;
  height: calc(100dvh - 72px);
  margin-top: 72px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 24px 20px;
  box-sizing: border-box;
  overflow-y: auto;
  overflow-x: hidden;
}

/* ── Brand header (above card, inside .auth-main) ── */
.auth-brand {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 24px;
}

.auth-brand-logo {
  height: 48px;
  width: auto;
  margin-bottom: 10px;
}

.auth-brand-title {
  font-size: 20px;
  font-weight: 700;
  color: #012C9B;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.auth-brand-subtitle {
  font-size: 10px;
  font-weight: 700;
  color: #E70216;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 2px;
}

/* ── Auth card ── */
.auth-card {
  position: relative;
  z-index: 1;
  background: var(--auth-card-bg);
  border-radius: 18px;
  box-shadow: 0 4px 24px rgba(15, 23, 42, 0.10), 0 12px 48px rgba(15, 23, 42, 0.07), 0 1px 4px rgba(15, 23, 42, 0.04);
  padding: clamp(36px, 5vh, 56px) 64px;
  width: 550px;
  max-width: calc(100vw - 48px);
  border: 1px solid #EEF1F6;
  box-sizing: border-box;
}

.auth-card-title {
  font-size: 20px;
  font-weight: 700;
  color: #0F172A;
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}

.auth-card-desc {
  font-size: 13px;
  color: #64748B;
  margin-bottom: 28px;
  line-height: 1.5;
}

/* ── Card badge header (blue circle + title + subtitle) ── */
.auth-card-badge {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, #012C9B 0%, #0038C7 100%);
  box-shadow: 0 6px 20px rgba(1, 44, 155, 0.28), inset 0 2px 4px rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  flex-shrink: 0;
}

.auth-card-badge svg {
  width: 32px;
  height: 32px;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,0.15));
}

.auth-card-heading {
  font-size: 36px;
  font-weight: 700;
  color: #0F172A;
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-align: center;
  margin-bottom: 6px;
}

.auth-card-subheading {
  font-size: 15px;
  font-weight: 400;
  color: #64748B;
  text-align: center;
  margin-bottom: 32px;
  line-height: 1.5;
}

/* ── Form group ── */
.auth-form-group {
  margin-bottom: 16px;
}

.auth-form-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: #94A3B8;
  margin-bottom: 6px;
  letter-spacing: 0.01em;
  transition: color 0.2s ease;
}

/* ── Input wrapper (icon + input + eye) ── */
.auth-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.auth-input-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  pointer-events: none;
  z-index: 2;
  color: #94A3B8;
  transition: color 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-input-icon svg {
  width: 18px;
  height: 18px;
}

/* ── Input fields ── */
.auth-input {
  display: block;
  width: 100%;
  height: var(--auth-input-height);
  padding: 0 48px 0 46px;  /* left: icon, right: eye icon */
  font-size: 15px;
  color: #1E293B;
  background-color: var(--auth-input-bg);
  border: 1.5px solid var(--auth-input-border);
  border-radius: var(--auth-input-radius);
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
  -webkit-appearance: none;
}

.auth-input::placeholder {
  color: #94A3B8;
  font-size: 13px;
}

.auth-input:hover {
  border-color: #C4CDDB;
  background-color: #FFFFFF;
}

.auth-input:focus {
  border-color: var(--auth-input-focus);
  background-color: var(--auth-input-focus-bg);
  box-shadow: 0 0 0 3px rgba(1, 44, 155, 0.10);
}

/* Icon color change on focus */
.auth-input:focus ~ .auth-input-icon,
.auth-input-wrap:focus-within .auth-input-icon {
  color: var(--auth-input-focus);
}

/* ── Password eye toggle ── */
.auth-eye-btn {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  color: #94A3B8;
  transition: color 0.15s ease;
  padding: 0;
  border-radius: 8px;
}

.auth-eye-btn:hover {
  color: #64748B;
  background: #F1F5F9;
}

.auth-eye-btn svg {
  width: 18px;
  height: 18px;
}

/* Input without leading icon (no left padding for icon) */
.auth-input-no-icon {
  padding-left: 16px;
}

/* ── Error input state ── */
.auth-input.auth-input-error {
  border-color: #DC2626;
  background-color: #FEF2F2;
}

.auth-input.auth-input-error:focus {
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
  border-color: #DC2626;
}

.auth-input-error-text {
  font-size: 11px;
  color: #DC2626;
  margin-top: 5px;
  line-height: 1.4;
}

/* ── Submit button ── */
.auth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 52px;
  padding: 0 20px;
  font-size: 15px;
  font-weight: 600;
  color: #FFFFFF;
  background: #0B4FD8;
  border: none;
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(11, 79, 216, 0.32);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
  letter-spacing: 0.01em;
}

.auth-btn:hover {
  background: #0941B8;
  box-shadow: 0 6px 20px rgba(11, 79, 216, 0.40);
  transform: translateY(-1px);
}

.auth-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(1, 44, 155, 0.18);
}

.auth-btn:disabled {
  background: #94A3B8;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* ── Secondary / outline button ── */
.auth-btn-outline {
  background: transparent;
  color: #012C9B;
  border: 1.5px solid #012C9B;
}

.auth-btn-outline:hover {
  background: #EAEEF7;
  box-shadow: 0 4px 14px rgba(1, 44, 155, 0.12);
  color: #00237C;
}

/* ── Link row ── */
.auth-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-top: 14px;
}

.auth-link {
  color: #0B4FD8;
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  transition: color 0.15s ease;
}

.auth-link:hover {
  color: #0941B8;
  text-decoration: underline;
}

/* ── Divider ── */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--auth-text-muted);
  font-size: 12px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--auth-divider);
}

/* ── Alert messages ── */
.auth-alert {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 18px;
  border: 1.5px solid transparent;
}

.auth-alert-error {
  background: #FEF2F2;
  color: #991B1B;
  border-color: #FECACA;
}

.auth-alert-success {
  background: #ECFDF5;
  color: #065F46;
  border-color: #A7F3D0;
}

.auth-alert-info {
  background: #EFF6FF;
  color: #1E40AF;
  border-color: #BFDBFE;
}

/* ── App store badges row ── */
.auth-app-badges {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 36px;
}

.auth-app-badges img {
  height: 44px;
  width: auto;
  opacity: 0.90;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.auth-app-badges img:hover {
  opacity: 1;
  transform: translateY(-2px);
}

/* ── Cookie consent modal refinements ── */
.auth-cookie-modal .modal-content {
  border: none;
  border-radius: 14px;
  box-shadow: 0 8px 40px rgba(15, 23, 42, 0.16);
}

.auth-cookie-modal .modal-header {
  border-bottom: 1px solid #EEF1F6;
  padding: 20px 24px 16px;
}

.auth-cookie-modal .modal-title {
  font-size: 18px;
  font-weight: 700;
  color: #0F172A;
}

.auth-cookie-modal .modal-body {
  padding: 20px 24px;
  font-size: 13px;
  color: #475569;
  line-height: 1.6;
}

.auth-cookie-modal .modal-footer {
  border-top: 1px solid #EEF1F6;
  padding: 16px 24px 20px;
}

/* ── Responsive ── */

/* Medium-height viewport (900p): light compression */
@media (max-height: 820px) {
  .auth-card {
    padding: clamp(24px, 4vh, 48px) 56px;
  }
  .auth-card-badge {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
  }
  .auth-card-heading {
    font-size: 32px;
  }
  .auth-card-subheading {
    font-size: 14px;
    margin-bottom: 26px;
  }
  .auth-form-group {
    margin-bottom: 14px;
  }
  .auth-app-badges {
    margin-top: 24px;
  }
}

/* Tablet width (1366×768 landscape, iPad): compress padding */
@media (max-width: 768px) {
  .auth-card {
    width: auto;
    padding: clamp(28px, 4vh, 44px) 40px;
  }
  .auth-card-heading {
    font-size: 30px;
  }
  .auth-card-subheading {
    font-size: 14px;
    margin-bottom: 24px;
  }
  .auth-header {
    padding: 0 20px;
  }
  .auth-app-badges img {
    height: 38px;
  }
}

/* Short viewport: compress card padding, hide app badges, hide brand */
@media (max-height: 720px) {
  .auth-card {
    padding: 20px 28px 20px;
  }
  .auth-brand {
    margin-bottom: 14px;
  }
  .auth-brand-logo {
    height: 36px;
    margin-bottom: 6px;
  }
  .auth-brand-title {
    font-size: 17px;
  }
  .auth-card-badge {
    width: 60px;
    height: 60px;
    margin-bottom: 14px;
  }
  .auth-card-heading {
    font-size: 28px;
  }
  .auth-card-subheading {
    font-size: 14px;
    margin-bottom: 24px;
  }
  .auth-app-badges {
    margin-top: 20px;
  }
  .auth-app-badges img {
    height: 36px;
  }
}

/* Very short viewport: further compress, hide brand */
@media (max-height: 570px) {
  .auth-card {
    padding: 16px 24px 16px;
  }
  .auth-brand {
    display: none;
  }
  .auth-card-badge {
    width: 56px;
    height: 56px;
    margin-bottom: 14px;
  }
  .auth-card-heading {
    font-size: 26px;
    margin-bottom: 4px;
  }
  .auth-card-subheading {
    font-size: 13px;
    margin-bottom: 18px;
  }
  .auth-app-badges {
    margin-top: 12px;
  }
  .auth-app-badges img {
    height: 30px;
  }
}

/* Narrow width */
@media (max-width: 480px) {
  .auth-card {
    padding: 24px 20px 20px;
    max-width: 100%;
  }
  .auth-card-badge {
    width: 60px;
    height: 60px;
  }
  .auth-card-heading {
    font-size: 28px;
  }
  .auth-card-subheading {
    font-size: 14px;
  }
  .auth-app-badges {
    gap: 12px;
  }
  .auth-app-badges img {
    height: 36px;
  }
  .auth-brand-logo {
    height: 40px;
  }
  .auth-header {
    padding: 0 16px;
  }
}
