/* Login screen — the Zeah dashboard's login design, re-skinned for Land Lookup.
   Same structure, typography and glass card; the palette moves from the
   dashboard's navy/gold to Land Lookup's "Atlantic survey" limestone + azulejo
   blue, so the two apps read as siblings rather than copies.

   Hardcoded colours on purpose: this screen must look identical regardless of
   the app theme behind it, and it renders before any app CSS loads. */

@font-face {
  font-family: 'Cormorant Garamond'; font-style: normal; font-weight: 500;
  src: url('/auth-assets/fonts/cormorant-garamond-500-latin.woff2') format('woff2');
  font-display: swap;
}
@font-face {
  font-family: 'Cormorant Garamond'; font-style: normal; font-weight: 600;
  src: url('/auth-assets/fonts/cormorant-garamond-600-latin.woff2') format('woff2');
  font-display: swap;
}
@font-face {
  font-family: 'Cormorant Garamond'; font-style: normal; font-weight: 700;
  src: url('/auth-assets/fonts/cormorant-garamond-700-latin.woff2') format('woff2');
  font-display: swap;
}
@font-face {
  font-family: 'Plus Jakarta Sans'; font-style: normal; font-weight: 400;
  src: url('/auth-assets/fonts/plus-jakarta-sans-400-latin.woff2') format('woff2');
  font-display: swap;
}
@font-face {
  font-family: 'Plus Jakarta Sans'; font-style: normal; font-weight: 500;
  src: url('/auth-assets/fonts/plus-jakarta-sans-500-latin.woff2') format('woff2');
  font-display: swap;
}
@font-face {
  font-family: 'Plus Jakarta Sans'; font-style: normal; font-weight: 700;
  src: url('/auth-assets/fonts/plus-jakarta-sans-700-latin.woff2') format('woff2');
  font-display: swap;
}
@font-face {
  font-family: 'Plus Jakarta Sans'; font-style: normal; font-weight: 800;
  src: url('/auth-assets/fonts/plus-jakarta-sans-800-latin.woff2') format('woff2');
  font-display: swap;
}

:root {
  --ink: #1e2a32;
  --muted: #5f7078;
  --azulejo: #1e5c86;
  --azulejo-deep: #174a6d;
  --pinho: #44684b;
  --error: #c2571b;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100dvh;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  /* Limestone paper, the app's own base tone — this is the "background change"
     from the dashboard's #F0F2F8. */
  background: #f4f6f5;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 0 20px 40px;
  overflow-y: auto;
  position: relative;
}

/* Ambient wash: azulejo blue from the top-left, coastal pine from the bottom
   right, replacing the dashboard's blue/gold pairing. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 50% at 20% 0%, rgba(30, 92, 134, 0.13) 0%, transparent 55%),
    radial-gradient(ellipse 55% 45% at 80% 100%, rgba(68, 104, 75, 0.10) 0%, transparent 55%);
  pointer-events: none;
  z-index: 0;
}

/* Faint cadastral grid — Land Lookup's signature neatline motif, the one piece
   of identity this screen adds over the dashboard's. */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(30, 92, 134, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(30, 92, 134, 0.05) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 35%, #000 0%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 35%, #000 0%, transparent 75%);
  pointer-events: none;
  z-index: 0;
}

.header {
  text-align: center;
  position: relative;
  z-index: 1;
  padding: 60px 0 44px;
}
.header h1 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 3.2rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  margin: 0 0 8px;
  line-height: 1.1;
  color: var(--ink);
}
.header h1 .brand-accent { color: var(--azulejo); }
.header .subtitle {
  font-size: 10px;
  letter-spacing: 5px;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}
@media (max-width: 768px) {
  .header { padding: 40px 0 28px; }
  .header h1 { font-size: 2.4rem; }
}

.login-section {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(40px) saturate(1.5);
  -webkit-backdrop-filter: blur(40px) saturate(1.5);
  border: 1px solid rgba(30, 92, 134, 0.14);
  border-radius: 32px;
  padding: 52px 48px;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 24px 60px rgba(30, 42, 50, 0.16), 0 8px 20px rgba(30, 42, 50, 0.07);
  position: relative;
  z-index: 1;
}
@media (max-width: 768px) {
  .login-section { padding: 36px 28px; border-radius: 24px; }
}

h2 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.9rem;
  font-weight: 700;
  text-align: center;
  margin: 0 0 36px;
  letter-spacing: 0.02em;
  position: relative;
  padding-bottom: 8px;
}
h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--azulejo), transparent);
}

.form-group { margin-bottom: 18px; }
.form-group label {
  display: block;
  font-size: 13px;
  margin-bottom: 6px;
  color: var(--muted);
  font-weight: 500;
}
.form-group input {
  width: 100%;
  padding: 12px 14px;
  /* 16px keeps iOS Safari from zooming the viewport on focus. */
  font-size: 16px;
  font-family: inherit;
  background: rgba(30, 92, 134, 0.04);
  border: 1.5px solid rgba(30, 92, 134, 0.12);
  border-radius: 14px;
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.form-group input::placeholder { color: #9aa9ae; }
.form-group input:focus {
  outline: none;
  border-color: var(--azulejo);
  background: rgba(30, 92, 134, 0.02);
  box-shadow: 0 0 0 3px rgba(30, 92, 134, 0.13);
}

/* One-time codes read better spaced out and monospaced. */
#code {
  letter-spacing: 0.4em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.pwd-wrap { position: relative; }
.pwd-wrap input { padding-right: 46px; }
.pwd-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 15px;
  padding: 6px 8px;
  line-height: 1;
  border-radius: 8px;
  display: flex;
  align-items: center;
  transition: color 0.15s, background 0.15s;
}
.pwd-toggle:hover { color: var(--azulejo); background: rgba(30, 92, 134, 0.06); }
.pwd-toggle:focus-visible { outline: 2px solid rgba(30, 92, 134, 0.35); outline-offset: 1px; }
/* Edge draws its own reveal control that vanishes after blur — suppress it so
   there are never two eye icons. */
input[type=password]::-ms-reveal,
input[type=password]::-ms-clear { display: none !important; width: 0; height: 0; }

.btn-primary {
  width: 100%;
  margin-top: 8px;
  padding: 13px;
  font-size: 15px;
  font-weight: 800;
  font-family: inherit;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--azulejo), #2a7ba8);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(30, 92, 134, 0.24);
  transition: background 0.15s, box-shadow 0.15s;
}
.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #2a7ba8, #3a90bd);
}
.btn-primary:disabled { opacity: 0.6; cursor: default; }

.msg {
  margin-top: 14px;
  font-size: 13px;
  text-align: center;
  min-height: 1.2em;
  color: var(--muted);
}
.msg.error {
  background: rgba(194, 87, 27, 0.10);
  border: 1px solid var(--error);
  color: var(--error);
  border-radius: 10px;
  padding: 9px 12px;
  text-align: left;
}

.hint {
  margin: 18px 0 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
  text-align: center;
}

.hidden { display: none !important; }
