/* ==========================================================
   JUGMUG CRM - sign-in pages (index.php login, eVerify.php OTP)
   One simple centred card on a soft teal / navy background.
   The colour names match the old login-page.css, so eVerify.css keeps working.
   ========================================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --teal: #0D9488; --teal-lt: #14B8A6; --teal-dk: #0A7267;
  --navy: #0B1628; --navy-lt: #112240;
  --slate: #64748B; --slate-lt: #94A3B8;
  --white: #FFFFFF; --off-white: #F8FAFC;
  --border-lt: #DCE3EC; --orange: #F97316;
}

html, body { min-height: 100%; }
body {
  font-family: 'Instrument Sans', system-ui, sans-serif;
  color: var(--navy);
  background: #EEF3F8;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 100vh; padding: 32px 16px;
  position: relative; overflow-x: hidden;
}

/* ── background : two soft colour glows + a faint dot grid ── */
.auth-bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.auth-bg::before {
  content: ''; position: absolute; inset: 0;
  background-image: radial-gradient(circle, rgba(11,22,40,.07) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: radial-gradient(ellipse 70% 70% at 50% 45%, black 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 70% 70% at 50% 45%, black 30%, transparent 80%);
}
.auth-bg span { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55; animation: drift 16s ease-in-out infinite; }
.auth-bg span:nth-child(1) { width: 520px; height: 520px; left: -140px; top: -160px; background: #99F6E4; }
.auth-bg span:nth-child(2) { width: 460px; height: 460px; right: -160px; bottom: -180px; background: #BFDBFE; animation-delay: -8s; }
@keyframes drift { 0%,100% { transform: translate(0,0); } 50% { transform: translate(30px, 24px); } }

/* ── card ── */
.auth { position: relative; z-index: 1; width: 100%; max-width: 420px; }
.auth-card {
  background: var(--white);
  border: 1px solid rgba(11,22,40,.06);
  border-radius: 22px;
  padding: 36px 34px 26px;
  box-shadow: 0 1px 2px rgba(11,22,40,.04), 0 20px 50px -12px rgba(11,22,40,.18);
  animation: cardIn .6s cubic-bezier(.22,1,.36,1) both;
}
@keyframes cardIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.auth-brand { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-bottom: 26px; }
.auth-brand img { height: 40px; width: auto; display: block; }
.auth-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px;
  font-family: 'Syne', sans-serif; font-size: 10px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--teal-dk); background: rgba(13,148,136,.08); border: 1px solid rgba(13,148,136,.18);
}
.auth-chip i { width: 6px; height: 6px; border-radius: 50%; background: var(--teal-lt); animation: chipPulse 2s infinite; }
@keyframes chipPulse { 0%,100% { box-shadow: 0 0 0 0 rgba(20,184,166,.5); } 50% { box-shadow: 0 0 0 5px rgba(20,184,166,0); } }

.auth-head { text-align: center; margin-bottom: 24px; }
.auth-head h1 { font-family: 'Syne', sans-serif; font-size: 24px; font-weight: 800; letter-spacing: -.5px; color: var(--navy); line-height: 1.2; margin-bottom: 6px; }
.auth-head p { font-size: 13.5px; color: var(--slate); line-height: 1.6; max-width: 300px; margin: 0 auto; }

/* ── messages ── */
.alert {
  display: flex; align-items: flex-start; gap: 9px; padding: 11px 14px; border-radius: 10px;
  font-size: 13px; margin-bottom: 18px; border: 1px solid transparent;
}
.alert.error   { background: #FEF2F2; border-color: #FECACA; color: #B91C1C; }
.alert.success { background: #F0FDF4; border-color: #BBF7D0; color: #166534; }
.alert svg     { width: 14px; height: 14px; stroke: currentColor; stroke-width: 2; fill: none; flex-shrink: 0; margin-top: 2px; }
.server-msg    { font-size: 13px; color: #B91C1C; font-weight: 600; margin-bottom: 14px; text-align: center; }

/* ── fields ── */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; color: #334155; margin-bottom: 7px; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap .field-icon {
  position: absolute; left: 14px; width: 16px; height: 16px;
  stroke: var(--slate-lt); stroke-width: 1.8; fill: none; pointer-events: none; transition: stroke .2s;
}
.input-wrap input {
  width: 100%; height: 48px; padding: 0 44px 0 42px;
  font-family: inherit; font-size: 14.5px; color: var(--navy);
  background: var(--off-white); border: 1.5px solid var(--border-lt); border-radius: 12px; outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.input-wrap input::placeholder { color: #A8B3C2; }
.input-wrap input:hover { border-color: #C6D0DC; }
.input-wrap input:focus { background: var(--white); border-color: var(--teal); box-shadow: 0 0 0 4px rgba(13,148,136,.12); }
.input-wrap:has(input:focus) .field-icon { stroke: var(--teal); }
.input-wrap input:user-invalid { border-color: #EF4444; box-shadow: 0 0 0 4px rgba(239,68,68,.10); }

.eye-btn {
  position: absolute; right: 8px; width: 34px; height: 34px; display: grid; place-items: center;
  background: none; border: none; border-radius: 8px; cursor: pointer; color: var(--slate); transition: color .2s, background .2s;
}
.eye-btn:hover { color: var(--navy); background: rgba(11,22,40,.05); }
.eye-btn svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 1.8; fill: none; }

/* ── stay signed in ── */
.options { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 22px; }
.checkbox-lbl { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--slate); cursor: pointer; user-select: none; }
.checkbox-lbl input[type="checkbox"] { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chk-box {
  width: 18px; height: 18px; border: 1.5px solid var(--border-lt); border-radius: 5px; background: var(--white);
  display: flex; align-items: center; justify-content: center; transition: border-color .2s, background .2s; flex-shrink: 0;
}
.checkbox-lbl input:focus-visible ~ .chk-box { box-shadow: 0 0 0 3px rgba(13,148,136,.2); }
.checkbox-lbl input:checked ~ .chk-box { background: var(--teal); border-color: var(--teal); }
.chk-box svg { width: 10px; height: 10px; stroke: #fff; stroke-width: 3; fill: none; display: none; }
.checkbox-lbl input:checked ~ .chk-box svg { display: block; }
.caps-warn { display: none; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: #B45309; }
.caps-warn.is-on { display: inline-flex; }

/* ── button ── */
.btn-login {
  width: 100%; height: 50px; display: flex; align-items: center; justify-content: center; gap: 10px;
  font-family: 'Syne', sans-serif; font-size: 14px; font-weight: 700; letter-spacing: .5px; color: var(--white);
  background: linear-gradient(135deg, var(--teal-dk), var(--teal-lt)); border: none; border-radius: 12px; cursor: pointer;
  position: relative; overflow: hidden;
  box-shadow: 0 8px 20px -6px rgba(13,148,136,.55);
  transition: transform .12s, box-shadow .2s, filter .2s;
}
.btn-login:hover { transform: translateY(-1px); filter: brightness(1.05); box-shadow: 0 12px 26px -6px rgba(13,148,136,.6); }
.btn-login:active { transform: translateY(0); }
.btn-login:focus-visible { outline: none; box-shadow: 0 0 0 4px rgba(13,148,136,.3); }
.btn-login svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 2.2; fill: none; }
.btn-login .spin { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn-login.is-busy { pointer-events: none; }
.ripple { position: absolute; border-radius: 50%; background: rgba(255,255,255,.25); width: 80px; height: 80px; transform: scale(0); animation: rippleAnim .55s linear; pointer-events: none; }
@keyframes rippleAnim { to { transform: scale(5); opacity: 0; } }

/* ── card footer + note under the card ── */
.card-footer { margin-top: 24px; padding-top: 16px; border-top: 1px solid #EEF2F6; display: flex; align-items: center; justify-content: space-between; }
.card-footer-copy { font-size: 11.5px; color: var(--slate-lt); }
.ver-tag {
  font-family: 'Syne', sans-serif; font-size: 10px; font-weight: 700; letter-spacing: 1px; color: var(--teal-dk);
  background: rgba(13,148,136,.08); border: 1px solid rgba(13,148,136,.15); border-radius: 6px; padding: 3px 8px;
}
.auth-note { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 18px; font-size: 12px; color: var(--slate); }
.auth-note svg { width: 14px; height: 14px; stroke: var(--teal); stroke-width: 2; fill: none; }

@media (max-width: 480px) {
  body { padding: 20px 12px; justify-content: flex-start; padding-top: 8vh; }
  .auth-card { padding: 28px 20px 22px; border-radius: 18px; }
  .auth-head h1 { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) { .auth-bg span, .auth-card, .auth-chip i { animation: none; } }
