/* ============================================================
   TROYER NEPAL — Shared Auth Styles
   login · forgot-password · reset-password · set-password
   ============================================================ */

/* Fonts loaded via HTML <link> to avoid FOUT */

:root {
  --a-brand:        #1e3a8a;
  --a-brand-mid:    #1d4ed8;
  --a-brand-light:  #3b82f6;
  --a-text:         #0f172a;
  --a-text-soft:    #475569;
  --a-border:       rgba(148, 163, 184, 0.28);
  --a-input-bg:     rgba(255, 255, 255, 0.94);
  --a-card-bg:      rgba(255, 255, 255, 0.84);
  --a-shadow:
    0 4px 6px  rgba(0, 0, 0, 0.05),
    0 20px 50px rgba(0, 0, 0, 0.28),
    0 40px 80px rgba(0, 0, 0, 0.18);
  --a-radius-card:  22px;
  --a-radius-input: 13px;
  --a-radius-btn:   13px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Page shell ── */
.auth-page {
  font-family: 'DM Sans', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  background:
    linear-gradient(160deg,
      rgba(8, 16, 40, 0.15) 0%,
      rgba(6, 13, 32, 0.12) 55%,
      rgba(10, 22, 52, 0.20) 100%),
    url('/Teams_Background_TROYER.png') center center / cover no-repeat fixed !important;
  overflow-x: hidden;
  overflow-y: auto;
  position: relative;
}

@media (min-width: 1024px) {
  .auth-page {
    display: flex;
    justify-content: flex-start;
    align-items: center; /* Center vertically on the wall */
    padding-left: clamp(40px, 9vw, 180px);
    padding-top: clamp(40px, 6vh, 70px) !important; /* Perfect spacing below TROYER wall logo */
    height: 100vh !important;
    min-height: 100vh !important;
    background-position: left center !important;
    overflow: hidden !important;
  }
  .auth-logo {
    display: none !important;
  }
  .auth-card {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    padding: 0 !important;
    width: min(100%, 428px) !important;
  }
  .auth-title {
    color: #1e3a8a !important; /* Troyer blue */
  }
  .auth-subtitle {
    color: #475569 !important; /* Slate grey */
  }
  .auth-label {
    color: #0f172a !important; /* Dark slate text */
  }
  .auth-forgot-link {
    color: #1e3a8a !important; /* Troyer blue */
  }
  .auth-input {
    background: rgba(255, 255, 255, 0.45) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    border: 1px solid rgba(26, 63, 168, 0.25) !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04) !important;
    color: #0f172a !important;
    transition: all 0.25s ease !important;
  }
  .auth-input:focus {
    border-color: #1a3fa8 !important;
    box-shadow: 0 6px 20px rgba(29, 78, 216, 0.14) !important;
    background: rgba(255, 255, 255, 0.8) !important;
  }
  .auth-input-icon {
    color: #64748b !important;
  }
  .auth-input-wrap:focus-within .auth-input-icon {
    color: #1a3fa8 !important;
  }
  .auth-eye-btn {
    background: rgba(0, 0, 0, 0.04) !important;
    color: #334155 !important;
  }
  .auth-eye-btn:hover {
    background: rgba(0, 0, 0, 0.08) !important;
    color: #0f172a !important;
  }
  .auth-info-box {
    background: rgba(255, 255, 255, 0.6) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    border: 1px solid rgba(147, 197, 253, 0.5) !important;
    color: #1e40af !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03) !important;
  }
  .auth-btn {
    background: rgba(29, 78, 216, 0.85) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
    box-shadow: 0 10px 24px rgba(29, 78, 216, 0.2) !important;
    transition: all 0.25s ease !important;
  }
  .auth-btn:hover {
    background: rgba(29, 78, 216, 0.95) !important;
    box-shadow: 0 14px 34px rgba(29, 78, 216, 0.35) !important;
    transform: translateY(-2px) !important;
  }
  .auth-back-row a {
    color: #1e3a8a !important;
  }
  .auth-secure-note {
    color: #64748b !important;
  }
  .auth-secure-note svg {
    color: #64748b !important;
  }
}

/* Vignette edges */
.auth-page::before {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 0%,
    transparent 40%,
    rgba(4, 8, 22, 0.22) 100%);
  pointer-events: none;
  z-index: 0;
}

/* ── Card ── */
.auth-card {
  position: relative;
  z-index: 1;
  width: min(100%, 428px);
  padding: 44px 38px 38px;
  border-radius: var(--a-radius-card);
  background: var(--a-card-bg);
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: var(--a-shadow);
  backdrop-filter: blur(32px) saturate(160%);
  -webkit-backdrop-filter: blur(32px) saturate(160%);
  animation: authCardIn 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Glass highlight */
.auth-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(148deg,
    rgba(255,255,255,0.48) 0%,
    rgba(255,255,255,0.08) 55%,
    transparent 100%);
  pointer-events: none;
}

@keyframes authCardIn {
  from { opacity: 0; transform: translateY(20px) scale(0.975); }
  to   { opacity: 1; transform: none; }
}

/* ── Logo ── */
.auth-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 26px;
  animation: authFadeDown 0.5s 0.1s ease both;
}

.auth-logo img {
  width: min(172px, 68%);
  height: auto;
  filter: drop-shadow(0 3px 14px rgba(0, 0, 0, 0.14));
}

@keyframes authFadeDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: none; }
}

/* ── Heading ── */
.auth-heading {
  text-align: center;
  animation: authFadeUp 0.5s 0.16s ease both;
}

.auth-title {
  font-family: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  font-size: clamp(28px, 5vw, 34px);
  font-weight: 600;
  color: var(--a-brand);
  letter-spacing: -0.01em;
  line-height: 1.1;
}

.auth-subtitle {
  margin-top: 8px;
  font-size: 13.5px;
  color: var(--a-text-soft);
  line-height: 1.65;
  font-weight: 400;
}

@keyframes authFadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

/* ── Divider ── */
.auth-divider {
  width: 36px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--a-brand-mid), var(--a-brand-light));
  margin: 18px auto 26px;
  opacity: 0.45;
  animation: authFadeUp 0.45s 0.2s ease both;
}

/* ── Info box (forgot-password page) ── */
.auth-info-box {
  margin-bottom: 20px;
  padding: 12px 15px;
  border-radius: 12px;
  background: rgba(239, 246, 255, 0.85);
  border: 1px solid rgba(147, 197, 253, 0.45);
  font-size: 13px;
  line-height: 1.65;
  color: #1e40af;
  font-weight: 500;
}

/* ── Form ── */
form { animation: authFadeUp 0.5s 0.24s ease both; }

.auth-field { margin-bottom: 17px; }

.auth-label {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: #334155;
  margin-bottom: 7px;
}

/* Password label row with forgot-link inline */
.auth-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 7px;
}
.auth-label-row .auth-label { margin-bottom: 0; }

.auth-forgot-link {
  font-size: 12px;
  font-weight: 600;
  color: var(--a-brand-mid);
  text-decoration: none;
  white-space: nowrap;
  transition: opacity 0.15s;
}
.auth-forgot-link:hover { opacity: 0.7; }

/* ── Input wrapper ── */
.auth-input-wrap { position: relative; }

.auth-input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: #94a3b8;
  pointer-events: none;
  transition: color 0.18s;
}
.auth-input-wrap:focus-within .auth-input-icon { color: var(--a-brand-mid); }

/* ── Input ── */
.auth-input {
  width: 100%;
  height: 51px;
  padding: 0 14px 0 43px;
  border-radius: var(--a-radius-input);
  border: 1.5px solid var(--a-border);
  background: var(--a-input-bg);
  color: var(--a-text);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  outline: none;
  transition:
    border-color 0.18s,
    box-shadow   0.18s,
    background   0.18s;
}

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

.auth-input:hover { border-color: rgba(100, 130, 200, 0.42); }

.auth-input:focus {
  border-color: var(--a-brand-mid);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.11);
}

/* password field extra right padding for eye button */
.auth-input.has-toggle { padding-right: 48px; }

/* ── Eye toggle ── */
.auth-eye-btn {
  position: absolute;
  right: 9px;
  top: 50%;
  transform: translateY(-50%);
  width: 33px;
  height: 33px;
  border: none;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  border-radius: 9px;
  display: grid;
  place-items: center;
  transition: background 0.15s, color 0.15s;
}
.auth-eye-btn:hover {
  background: rgba(29, 78, 216, 0.07);
  color: var(--a-brand-mid);
}
.auth-eye-btn svg          { width: 16px; height: 16px; }
.auth-eye-btn .eye-off     { display: none; }
.auth-eye-btn.shown .eye-on  { display: none; }
.auth-eye-btn.shown .eye-off { display: block; }

/* ── Alert ── */
.auth-alert {
  display: none;
  padding: 11px 14px;
  border-radius: 11px;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.55;
  margin-bottom: 16px;
}
.auth-alert.error {
  background: rgba(255, 241, 241, 0.96);
  border: 1px solid rgba(220, 38, 38, 0.2);
  color: #9b1c1c;
}
.auth-alert.success {
  background: rgba(240, 253, 244, 0.96);
  border: 1px solid rgba(22, 163, 74, 0.22);
  color: #14532d;
}

/* ── Primary button ── */
.auth-btn {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 52px;
  margin-top: 10px;
  border: none;
  border-radius: var(--a-radius-btn);
  cursor: pointer;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: 0.025em;
  color: #ffffff;
  background: linear-gradient(135deg, #2563eb 0%, #1e3a8a 100%);
  box-shadow: 0 8px 22px rgba(29, 78, 216, 0.34);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition:
    transform  0.18s ease,
    box-shadow 0.18s ease,
    filter     0.18s ease;
}

/* Gloss sheen */
.auth-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    rgba(255,255,255,0.14) 0%,
    transparent 55%);
  pointer-events: none;
}

/* Shimmer on hover */
.auth-btn::after {
  content: '';
  position: absolute;
  top: 0; left: -90%;
  width: 50%;
  height: 100%;
  background: linear-gradient(115deg,
    transparent 10%,
    rgba(255,255,255,0.22) 50%,
    transparent 90%);
  transform: skewX(-18deg);
  transition: left 0.65s ease;
}
.auth-btn:hover::after { left: 140%; }

.auth-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(29, 78, 216, 0.42);
  filter: brightness(1.06);
}
.auth-btn:active { transform: translateY(0) scale(0.99); }
.auth-btn:disabled {
  opacity: 0.6;
  cursor: wait;
  transform: none;
}

/* Arrow icon inside button */
.auth-btn-arrow {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  transition: transform 0.18s;
}
.auth-btn:hover .auth-btn-arrow { transform: translateX(3px); }

/* ── Back / secondary link ── */
.auth-back-row {
  text-align: center;
  margin-top: 20px;
}
.auth-back-row a {
  font-size: 13px;
  font-weight: 600;
  color: var(--a-brand-mid);
  text-decoration: none;
  transition: opacity 0.15s;
}
.auth-back-row a:hover { opacity: 0.7; }

/* ── Secure note ── */
.auth-secure-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 22px;
  font-size: 11px;
  color: #64748b;
  font-weight: 500;
  letter-spacing: 0.02em;
  animation: authFadeUp 0.45s 0.38s ease both;
}
.auth-secure-note svg { width: 12px; height: 12px; flex-shrink: 0; }

/* ── Toast ── */
.auth-toast {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translate(-50%, -14px);
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.90);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 10px 28px rgba(0,0,0,0.24);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s, transform 0.22s;
}
.auth-toast.show { opacity: 1; transform: translate(-50%, 0); }
.auth-toast.hide { opacity: 0; transform: translate(-50%, -14px); }

.auth-toast-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #86efac;
  flex-shrink: 0;
}

/* ── Responsive ── */
@media (max-width: 480px) {
  .auth-page { padding: 16px 12px; }
  .auth-card {
    padding: 36px 22px 30px;
    border-radius: 18px;
  }
  .auth-title { font-size: 28px; }
}

@media (max-height: 680px) {
  .auth-card { padding: 28px 32px 26px; }
  .auth-logo { margin-bottom: 18px; }
  .auth-logo img { width: min(145px, 58%); }
  .auth-divider { margin: 12px auto 20px; }
  .auth-field { margin-bottom: 13px; }
  .auth-btn { height: 48px; margin-top: 6px; }
  .auth-secure-note { margin-top: 14px; }
}

@media (max-height: 500px) and (orientation: landscape) {
  .auth-page { padding: 10px 16px; }
  .auth-card { padding: 20px 26px; }
  .auth-logo img { width: 120px; }
  .auth-title { font-size: 24px; }
  .auth-divider { display: none; }
  .auth-subtitle { display: none; }
}

/* Toast Container Mobile Fix */
.toast-wrap,
#toastWrap {
  z-index: 999999 !important;
}

@media (max-width: 768px) {
  .toast-wrap,
  #toastWrap {
    position: fixed !important;
    top: max(12px, env(safe-area-inset-top, 12px)) !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    width: min(360px, calc(100vw - 32px)) !important;
    margin: 0 auto !important;
    z-index: 999999 !important;
  }
}

