/*
 * BOQ PORTAL — AUTH PAGES
 * auth.css · Login, Register, Forgot/Reset Password, OTP
 */

/* ═══ TOKENS (local fallbacks) ══════════════════════════════ */
:root {
  --auth-bg: #f1f5f9;
  --auth-surface: #ffffff;
  --auth-border: #e2e8f0;
  --auth-radius: 20px;
  --auth-shadow: 0 20px 60px rgba(15, 23, 42, .1), 0 4px 16px rgba(15, 23, 42, .06);
}

/* ═══ PAGE LAYOUT ════════════════════════════════════════════ */
.auth-login-page,
.auth-register-page,
.auth-password-page,
.auth-reset-page,
.auth-otp-page {
  min-height: 100vh;
}

.auth-page {
  min-height: 100vh;
  padding: 80px 16px 64px;
  display: flex;
  align-items: center;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(14, 165, 233, .08), transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(14, 165, 233, .06), transparent 50%),
    var(--auth-bg, #f1f5f9);
}

.auth-shell {
  width: 100%;
  max-width: 1060px;
  margin: 0 auto;
}

.auth-shell-wide {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
}

/* ═══ CARD WRAP ═══════════════════════════════════════════════ */
.auth-wrap {
  position: relative;
  overflow: hidden;
  background: var(--auth-surface, #fff);
  border: 1px solid var(--auth-border, #e2e8f0);
  border-radius: var(--auth-radius, 20px);
  box-shadow: var(--auth-shadow);
}

/* top accent line */
.auth-wrap::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand, #0ea5e9) 0%, rgba(14, 165, 233, .2) 100%);
  z-index: 1;
}

/* ═══ LEFT PANEL ═════════════════════════════════════════════ */
.auth-side-col {
  min-height: 100%;
}

.auth-side {
  position: relative;
  min-height: 100%;
  height: 100%;
  padding: 48px 38px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  color: rgba(255, 255, 255, .92);
  background:
    radial-gradient(circle at top right, rgba(86, 182, 233, 0.12), transparent 30%),
    radial-gradient(circle at bottom left, rgba(86, 182, 233, 0.08), transparent 32%),
    linear-gradient(90deg, #0c1630 0%, #0c1630 45%, #0c1630 100%);
}

.auth-side>* {
  position: relative;
  z-index: 1;
}

/* grid pattern overlay */
.auth-side::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(circle at top right,
      rgba(14, 165, 233, .12),
      transparent 35%),
    radial-gradient(circle at bottom left,
      rgba(14, 165, 233, .08),
      transparent 40%);
}

.auth-side-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  padding: 5px 13px;
  margin-bottom: 20px;
  border-radius: var(--r-pill, 9999px);
  background: rgba(14, 165, 233, .16);
  border: 1px solid rgba(14, 165, 233, .3);
  color: #bae6fd;
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.auth-side h1 {
  margin: 0 0 14px;
  color: #fff;
  font-size: clamp(1.85rem, 2.8vw, 2.4rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.02em;
}

.auth-side-text {
  max-width: 500px;
  margin: 0 0 22px;
  color: rgba(255, 255, 255, .76);
  font-size: .9rem;
  line-height: 1.8;
}

.auth-side-list {
  display: grid;
  gap: 12px;
  margin-bottom: 22px;
}

.auth-side-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.auth-side-item i {
  margin-top: 2px;
  color: #7dd3fc;
  font-size: .95rem;
  flex-shrink: 0;
}

.auth-side-item span {
  color: rgba(255, 255, 255, .84);
  font-size: .9rem;
  line-height: 1.6;
}

.auth-side-note,
.auth-register-highlight {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 15px;
  border-radius: var(--r-md, 10px);
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .1);
  color: rgba(255, 255, 255, .78);
  font-size: .875rem;
  line-height: 1.6;
}

.auth-side-note i {
  margin-top: 2px;
  color: #7dd3fc;
}

.auth-side-actions {
  margin-top: 20px;
}

.auth-side-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 46px;
  padding: 0 20px;
  border-radius: var(--r-md, 10px);
  border: 1px solid rgba(255, 255, 255, .85);
  background: rgba(255, 255, 255, .08);
  color: rgba(255, 255, 255, .92);
  font-size: .9rem;
  font-weight: 700;
  text-decoration: none;
  transition: all .2s ease;
  backdrop-filter: blur(4px);
}

.auth-side-btn:hover {
  background: rgba(255, 255, 255, .14);
  color: #fff;
  transform: translateY(-1px);
}

/* ═══ AUTH CARD ══════════════════════════════════════════════ */
.auth-card {
  position: relative;
  z-index: 1;
  padding: 40px 36px;
  background: transparent;
}

.auth-card-head {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 26px;
}

.auth-card-head-main {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  min-width: 0;
}

.auth-card-icon {
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  border-radius: var(--r-lg, 14px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--brand-100, #e0f2fe), var(--brand-50, #f0f9ff));
  color: var(--brand, #0ea5e9);
  font-size: 1.15rem;
  border: 1px solid var(--brand-200, #bae6fd);
}

.auth-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  margin-bottom: 8px;
  border-radius: var(--r-pill);
  background: var(--brand-50, #f0f9ff);
  border: 1px solid var(--brand-200, #bae6fd);
  color: var(--brand-deeper, #0369a1);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.auth-card-head h2 {
  margin: 0 0 7px;
  color: var(--text-head, #0f172a);
  font-size: 1.55rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.auth-card-head p {
  margin: 0;
  color: var(--text-muted, #64748b);
  font-size: .9rem;
  line-height: 1.7;
}

.auth-back-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 13px;
  border-radius: var(--r-md, 10px);
  border: 1px solid var(--border, #e2e8f0);
  background: var(--surface, #fff);
  color: var(--text-head, #0f172a);
  font-size: .82rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all .2s ease;
  box-shadow: var(--shadow-xs);
}

.auth-back-btn:hover {
  background: var(--n-50, #f8fafc);
  border-color: var(--brand-ring, rgba(14, 165, 233, .2));
  color: var(--brand-dark, #0284c7);
}

/* ═══ FORM ELEMENTS ══════════════════════════════════════════ */
.auth-label {
  display: inline-block;
  margin-bottom: 6px;
  color: var(--text-head, #0f172a);
  font-size: .82rem;
  font-weight: 700;
}

.auth-label span {
  color: var(--red, #ef4444);
}

.auth-input-wrap {
  display: flex;
  align-items: center;
  min-height: 46px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: var(--r-md, 10px);
  background: var(--surface, #fff);
  overflow: hidden;
  transition: border-color .2s ease, box-shadow .2s ease;
  box-shadow: var(--shadow-xs);
}

.auth-input-wrap:hover {
  border-color: var(--border-md, #cbd5e1);
}

.auth-input-wrap:focus-within {
  border-color: var(--brand, #0ea5e9);
  box-shadow: 0 0 0 3px var(--brand-soft, rgba(14, 165, 233, .07));
}

.auth-input-wrap.auth-input-error {
  border-color: var(--red, #ef4444);
}

.auth-input-wrap.auth-input-error:focus-within {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, .07);
}

.auth-input-wrap>i {
  width: 44px;
  flex: 0 0 44px;
  text-align: center;
  color: var(--text-faint, #94a3b8);
  font-size: .9rem;
}

.auth-input {
  width: 100%;
  min-height: 46px;
  padding: 0 14px 0 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text-head, #0f172a);
  font-family: var(--font-sans);
  font-size: .9rem;
}

.auth-input::placeholder {
  color: var(--text-faint, #94a3b8);
}

.auth-select {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  padding-right: 44px;
}

.auth-select-wrap {
  position: relative;
}

.auth-select-arrow {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  font-size: .85rem;
}

.invalid-feedback,
.auth-error-text {
  margin-top: 5px;
  color: var(--red-dark, #dc2626);
  font-size: .78rem;
  font-weight: 600;
  line-height: 1.45;
}

.auth-help-text {
  margin-top: 7px;
  color: var(--text-muted);
  font-size: .8rem;
  line-height: 1.5;
}

.auth-help-text a {
  color: var(--brand-dark);
  font-weight: 700;
}

/* ═══ PASSWORD TOGGLE ════════════════════════════════════════ */
.auth-password-wrap .auth-input {
  padding-right: 0;
}

.auth-password-toggle {
  width: 44px;
  min-height: 46px;
  border: 0;
  background: transparent;
  color: var(--text-faint);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color var(--t-fast, .12s ease);
}

.auth-password-toggle:hover {
  color: var(--brand-dark);
}

.auth-password-toggle:focus {
  outline: none;
}

/* ═══ ACTIONS & BUTTONS ══════════════════════════════════════ */
.auth-actions {
  margin-top: 22px;
}

.auth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 20px;
  border-radius: var(--r-md, 10px);
  border: 1px solid transparent;
  font-family: var(--font-sans);
  font-size: .9rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: all .2s ease;
}

.auth-btn-primary {
  width: 100%;
  background: var(--brand, #0ea5e9);
  border-color: var(--brand);
  color: #fff;
  box-shadow: 0 2px 8px rgba(14, 165, 233, .2), 0 6px 20px rgba(14, 165, 233, .12);
}

.auth-btn-primary:hover {
  background: var(--brand-dark, #0284c7);
  border-color: var(--brand-dark);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(14, 165, 233, .28), 0 8px 24px rgba(14, 165, 233, .16);
}

.auth-footer-text {
  margin-top: 18px;
  text-align: center;
  color: var(--text-muted);
  font-size: .875rem;
  line-height: 1.65;
}

.auth-footer-text a,
.auth-inline-link,
.auth-switch-links a,
.auth-help-text a {
  color: var(--brand-dark);
  font-weight: 700;
  text-decoration: none;
}

.auth-footer-text a:hover,
.auth-inline-link:hover,
.auth-switch-links a:hover {
  color: var(--brand);
}

/* ═══ LOGIN HELPERS ══════════════════════════════════════════ */
.auth-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.auth-check {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  color: var(--text);
  font-size: .875rem;
  font-weight: 600;
}

.auth-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--brand);
  cursor: pointer;
}

.auth-link-btn {
  padding: 0;
  border: 0;
  background: transparent;
}

.auth-register-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}

.auth-register-strip-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 11px;
  height: 32px;
  border-radius: var(--r-pill);
  background: var(--brand-50);
  border: 1px solid var(--brand-200);
  color: var(--brand-deeper);
  font-size: .78rem;
  font-weight: 700;
}

.auth-register-strip-item i {
  color: var(--brand-dark);
}

.auth-register-note {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 12px 14px;
  border-radius: var(--r-lg);
  background: var(--n-50);
  border: 1px solid var(--brand-200);
  color: var(--text);
  font-size: .85rem;
  line-height: 1.6;
}

.auth-register-note i {
  color: var(--brand-dark);
  margin-top: 2px;
}

/* ═══ REGISTER ════════════════════════════════════════════════ */
.auth-register-wrap {
  border-radius: var(--r-2xl, 24px);
}

.auth-register-side {
  background:
    radial-gradient(ellipse at top right, rgba(14, 165, 233, .2), transparent 50%),
    linear-gradient(160deg, #0f172a 0%, #1e3a5f 55%, #234e7f 100%);
}

.auth-register-highlights {
  display: grid;
  gap: 12px;
  margin-top: 6px;
}

.auth-register-highlight {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px;
  border-radius: var(--r-lg);
}

.auth-register-highlight i {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-md);
  background: rgba(14, 165, 233, .14);
  color: #7dd3fc;
}

.auth-register-highlight strong {
  display: block;
  color: #fff;
  font-size: .9rem;
  margin-bottom: 2px;
}

.auth-register-highlight span {
  display: block;
  color: rgba(255, 255, 255, .74);
  font-size: .83rem;
  line-height: 1.55;
}

/* ═══ MODAL ══════════════════════════════════════════════════ */
.auth-choice-modal .modal-dialog {
  max-width: 580px;
  padding: 16px;
}

.auth-modal-content {
  border: 1px solid var(--border);
  border-radius: var(--r-2xl);
  background: var(--surface);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
}

.auth-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 24px 16px;
  border-bottom: 1px solid var(--border);
}

.auth-modal-eyebrow {
  display: inline-block;
  margin-bottom: 5px;
  color: var(--brand-dark);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.auth-modal-header h3 {
  margin: 0 0 6px;
  font-size: 1.25rem;
  font-weight: 800;
}

.auth-modal-header p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.65;
  font-size: .875rem;
}

.auth-modal-close {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--text-head);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.auth-modal-body {
  padding: 20px 24px 24px;
}

.auth-reset-options {
  display: grid;
  gap: 12px;
}

.auth-reset-option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-radius: var(--r-xl);
  border: 1px solid var(--border);
  background: var(--surface);
  text-decoration: none;
  transition: all .2s ease;
}

.auth-reset-option:hover {
  border-color: var(--brand-ring);
  box-shadow: var(--shadow-md), 0 0 0 3px var(--brand-soft);
  transform: translateY(-2px);
}

.auth-reset-option-featured {
  border-color: var(--brand-200);
  background: linear-gradient(135deg, var(--brand-50) 0%, var(--surface) 100%);
}

.auth-reset-option-icon {
  width: 50px;
  height: 50px;
  flex: 0 0 50px;
  border-radius: var(--r-lg);
  background: var(--brand-50);
  color: var(--brand-dark);
  border: 1px solid var(--brand-200);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.auth-reset-option-content {
  flex: 1 1 auto;
  min-width: 0;
}

.auth-reset-option-content h4 {
  margin: 0;
  font-size: .938rem;
  font-weight: 800;
  color: var(--text-head);
}

.auth-reset-option-content p {
  margin: 0;
  color: var(--text-muted);
  font-size: .85rem;
  line-height: 1.6;
}

.auth-reset-option-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.auth-reset-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  background: var(--brand-100);
  color: var(--brand-deeper);
  font-size: .68rem;
  font-weight: 800;
  text-transform: uppercase;
}

.auth-reset-option-arrow {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: var(--r-md);
  background: var(--n-100);
  color: var(--text-head);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ═══ OTP ════════════════════════════════════════════════════ */
.auth-otp-wrap {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 9px;
}

.auth-otp-box {
  width: 100%;
  height: 56px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  text-align: center;
  font-family: var(--font-sans);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-head);
  outline: none;
  box-shadow: var(--shadow-xs);
  transition: border-color .2s ease, box-shadow .2s ease;
}

.auth-otp-box:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

/* ═══ RESPONSIVE ══════════════════════════════════════════════ */
@media (max-width: 1199.98px) {
  .auth-page {
    padding-top: 72px;
    padding-bottom: 56px;
  }

  .auth-wrap {
    max-width: 740px;
    margin: 0 auto;
  }

  .auth-card {
    padding: 34px 28px;
  }
}

@media (max-width: 767.98px) {
  .auth-page {
    padding: 72px 14px 56px;
  }

  .auth-wrap {
    border-radius: var(--r-xl);
  }

  .auth-card {
    padding: 24px 20px;
  }

  .auth-card-head {
    gap: 12px;
    margin-bottom: 20px;
  }

  .auth-card-head h2 {
    font-size: 1.3rem;
  }

  .auth-otp-box {
    height: 50px;
    font-size: 1rem;
  }
}

@media (max-width: 575.98px) {
  .auth-page {
    padding: 66px 12px 50px;
  }

  .auth-wrap {
    border-radius: var(--r-xl);
  }

  .auth-card {
    padding: 20px 16px;
  }

  .auth-card-head {
    flex-direction: column;
    gap: 10px;
    padding-top: 44px;
  }

  .auth-card-head-main {
    width: 100%;
  }

  .auth-back-btn {
    position: absolute;
    top: 0;
    right: 0;
    min-height: 36px;
    padding: 0 11px;
    font-size: .78rem;
  }

  .auth-card-head h2 {
    font-size: 1.15rem;
  }

  .auth-meta-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .auth-otp-wrap {
    gap: 6px;
  }

  .auth-otp-box {
    height: 46px;
    font-size: .95rem;
  }

  .auth-modal-header,
  .auth-modal-body {
    padding-left: 16px;
    padding-right: 16px;
  }

  .auth-reset-option {
    padding: 14px;
    align-items: flex-start;
  }

  .auth-reset-option-arrow {
    display: none;
  }
}

@media (max-width: 399.98px) {
  .auth-back-btn {
    width: 34px;
    padding: 0;
  }

  .auth-back-btn span {
    display: none;
  }

  .auth-card-head-main {
    flex-direction: column;
  }

  .auth-otp-box {
    height: 42px;
    font-size: .9rem;
  }
}