@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;1,300;1,400&family=Jost:wght@300;400;500;600&display=swap');

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

:root {
  --white:   #FFFFFF;
  --off:     #F5F4F1;
  --navy:    #0C1B2E;
  --navy2:   #1A3050;
  --text:    #1C1C1C;
  --text2:   #5C5C5C;
  --text3:   #A0A0A0;
  --border:  #E0DDD7;
  --brass:   #8B7355;
  --ff-s:    'Cormorant Garamond', Georgia, serif;
  --ff-b:    'Jost', system-ui, sans-serif;
  --radius:  2px;
}

html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body { font-family: var(--ff-b); background: var(--white); color: var(--text); line-height: 1.6; overflow-x: hidden; }
a { text-decoration: none; color: inherit; }
p { color: var(--text2); line-height: 1.85; }
img { display: block; max-width: 100%; }

/* ═══ SHARED NAV ═══ */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  padding: 20px 0;
  background: linear-gradient(to bottom, rgba(8,16,28,.5), transparent);
  transition: background .4s, padding .3s;
}
.nav.solid {
  background: rgba(255,255,255,.97);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 var(--border);
  padding: 14px 0;
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 1100px; margin: 0 auto; padding: 0 40px;
}
.logo {
  display: flex; align-items: center; gap: 11px; cursor: pointer;
}
.logo-mark { flex-shrink: 0; transition: color .4s; }
.nav:not(.solid) .logo-mark { color: #fff; }
.nav.solid .logo-mark { color: var(--navy); }
.logo-text {
  font-family: var(--ff-s); font-size: 17px; font-weight: 600;
  letter-spacing: .5px; transition: color .4s; white-space: nowrap;
}
.logo-text em { font-style: normal; font-weight: 300; opacity: .5; }
.nav:not(.solid) .logo-text { color: rgba(255,255,255,.95); }
.nav.solid .logo-text { color: var(--navy); }

.nav-right { display: flex; align-items: center; gap: 20px; }
.nav-user {
  font-size: 11px; font-weight: 500; letter-spacing: 1.5px; text-transform: uppercase;
  transition: color .4s;
}
.nav:not(.solid) .nav-user { color: rgba(255,255,255,.65); }
.nav.solid .nav-user { color: var(--text2); }

.btn-nav {
  font-family: var(--ff-b); font-size: 10px; font-weight: 600;
  letter-spacing: 2px; text-transform: uppercase; padding: 9px 20px;
  border: 1px solid; cursor: pointer; background: transparent;
  transition: all .2s;
}
.btn-nav-ghost {
  border-color: rgba(255,255,255,.4); color: rgba(255,255,255,.9);
}
.btn-nav-ghost:hover { border-color: rgba(255,255,255,.9); color: #fff; }
.nav.solid .btn-nav-ghost { border-color: var(--navy2); color: var(--navy); }
.nav.solid .btn-nav-ghost:hover { background: var(--navy); color: #fff; }

/* ═══ HERO (login page) ═══ */
.hero-login {
  min-height: 100dvh;
  background: var(--navy);
  display: flex; flex-direction: column;
  position: relative; overflow: hidden;
}
.hero-login::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 70% 40%, rgba(139,115,85,.12) 0%, transparent 70%);
  pointer-events: none;
}
.hero-login-inner {
  flex: 1; display: flex; align-items: center;
  max-width: 1100px; margin: 0 auto; padding: 120px 40px 80px;
  gap: 80px; width: 100%;
}
.hero-left { flex: 1; }
.eyebrow {
  font-size: 10px; font-weight: 600; letter-spacing: 3.5px;
  text-transform: uppercase; color: var(--brass); display: block; margin-bottom: 20px;
}
.rule { width: 28px; height: 1px; background: var(--brass); margin: 20px 0 28px; }
.hero-title {
  font-family: var(--ff-s); font-size: clamp(42px, 6vw, 64px);
  font-weight: 300; color: #fff; line-height: 1.1; margin-bottom: 20px;
}
.hero-title em { font-style: italic; }
.hero-sub { color: rgba(255,255,255,.55); font-size: 15px; line-height: 1.8; max-width: 360px; }

/* ═══ AUTH CARD ═══ */
.auth-card {
  width: 100%; max-width: 400px; flex-shrink: 0;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.1);
  padding: 40px; backdrop-filter: blur(8px);
}
.auth-card h3 {
  font-family: var(--ff-s); font-size: 22px; font-weight: 400;
  color: #fff; margin-bottom: 28px;
}

/* Google button */
.btn-google {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 13px; background: #fff;
  border: none; cursor: pointer; font-family: var(--ff-b);
  font-size: 13px; font-weight: 500; color: var(--text);
  transition: opacity .2s; margin-bottom: 24px;
}
.btn-google:hover { opacity: .9; }
.btn-google svg { flex-shrink: 0; }

/* Divider */
.divider {
  display: flex; align-items: center; gap: 12px; margin-bottom: 24px;
}
.divider::before, .divider::after {
  content: ''; flex: 1; height: 1px; background: rgba(255,255,255,.12);
}
.divider span { font-size: 11px; color: rgba(255,255,255,.3); letter-spacing: 1px; }

/* Form inputs */
.field { margin-bottom: 16px; }
.field label {
  display: block; font-size: 10px; font-weight: 600;
  letter-spacing: 2px; text-transform: uppercase;
  color: rgba(255,255,255,.45); margin-bottom: 8px;
}
.field input {
  width: 100%; background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  padding: 12px 14px; color: #fff; font-family: var(--ff-b);
  font-size: 14px; outline: none; transition: border-color .2s;
}
.field input::placeholder { color: rgba(255,255,255,.25); }
.field input:focus { border-color: var(--brass); }

/* Primary button */
.btn-primary {
  width: 100%; padding: 14px; background: var(--brass); border: none;
  color: #fff; font-family: var(--ff-b); font-size: 11px; font-weight: 600;
  letter-spacing: 2.5px; text-transform: uppercase; cursor: pointer;
  transition: opacity .2s; margin-top: 4px;
}
.btn-primary:hover { opacity: .88; }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }

.form-error {
  font-size: 12px; color: #e07070; margin-top: 12px; text-align: center; display: none;
}
.form-msg {
  font-size: 12px; color: rgba(255,255,255,.6); margin-top: 12px; text-align: center; display: none;
}

.auth-tabs {
  display: flex; margin-bottom: 24px; border-bottom: 1px solid rgba(255,255,255,.1);
}
.auth-tab {
  flex: 1; padding: 10px; background: none; border: none; cursor: pointer;
  font-family: var(--ff-b); font-size: 11px; font-weight: 600; letter-spacing: 1.5px;
  text-transform: uppercase; color: rgba(255,255,255,.35);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color .2s, border-color .2s;
}
.auth-tab.active { color: var(--brass); border-bottom-color: var(--brass); }

.auth-link {
  text-align: center; margin-top: 20px; font-size: 12px; color: rgba(255,255,255,.4);
}
.auth-link a { color: var(--brass); text-decoration: underline; cursor: pointer; }

/* Pending / error notice */
.notice {
  background: rgba(139,115,85,.12); border: 1px solid rgba(139,115,85,.3);
  padding: 20px; text-align: center; margin-bottom: 20px;
}
.notice p { color: rgba(255,255,255,.7); font-size: 13px; line-height: 1.7; }
.notice strong { color: var(--brass); }

/* ═══ APP PAGE ═══ */
.app-page { min-height: 100dvh; background: var(--off); }
.app-main {
  max-width: 600px; margin: 0 auto;
  padding: 100px 24px 60px;
}

/* Scanner steps */
.step { display: none; flex-direction: column; gap: 16px; }
.step.active { display: flex; animation: fadeUp .3s ease; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.scan-hero { text-align: center; padding: 32px 0 16px; }
.scan-icon { font-size: 56px; margin-bottom: 16px; line-height: 1; }
.scan-hero h2 { font-family: var(--ff-s); font-size: 32px; font-weight: 400; color: var(--navy); margin-bottom: 8px; }
.scan-hero p { color: var(--text2); font-size: 14px; }

/* Scanner buttons */
.scan-btn {
  display: flex; align-items: center; justify-content: center;
  width: 100%; padding: 16px; border: none; cursor: pointer;
  font-family: var(--ff-b); font-size: 11px; font-weight: 600;
  letter-spacing: 2.5px; text-transform: uppercase;
  transition: all .2s; position: relative; overflow: hidden;
}
.scan-btn input[type="file"] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0;
}
.scan-btn:active { transform: scale(.98); }
.scan-btn-primary { background: var(--navy); color: #fff; }
.scan-btn-primary:hover { background: var(--navy2); }
.scan-btn-secondary { background: var(--white); color: var(--navy); border: 1px solid var(--border); }
.scan-btn-secondary:hover { border-color: var(--navy); }
.scan-btn-ghost { background: transparent; color: var(--text3); font-size: 12px; padding: 12px; }

/* Preview */
.preview-wrap {
  background: #000; border-radius: var(--radius); overflow: hidden;
  aspect-ratio: 16/9; display: flex; align-items: center; justify-content: center;
}
.preview-wrap img { width: 100%; height: 100%; object-fit: contain; }

/* Spinner */
.spinner-wrap { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 24px; color: var(--text3); }
.spinner { width: 36px; height: 36px; border: 2px solid var(--border); border-top-color: var(--brass); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Contact form */
.contact-card {
  background: var(--white); border: 1px solid var(--border); padding: 0 20px;
}
.cf-section-title {
  font-size: 10px; font-weight: 600; letter-spacing: 2.5px; text-transform: uppercase;
  color: var(--text3); padding: 16px 0 0;
}
.cf-field {
  display: flex; flex-direction: column; padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.cf-field:last-child { border-bottom: none; }
.cf-field label {
  font-size: 10px; font-weight: 600; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--text3); margin-bottom: 4px;
}
.cf-field input {
  border: none; outline: none; font-size: 15px;
  color: var(--text); background: transparent; font-family: var(--ff-b);
}
.cf-field input::placeholder { color: var(--border); }
.cf-row { display: flex; gap: 0; }
.cf-row .cf-field { flex: 1; }
.cf-row .cf-field + .cf-field { border-left: 1px solid var(--border); padding-left: 12px; margin-left: -1px; }

/* QR step */
.qr-wrap {
  background: var(--white); border: 1px solid var(--border);
  padding: 32px; display: flex; align-items: center; justify-content: center;
}
.qr-wrap canvas { display: block; }

.contact-summary-bar {
  background: var(--white); border: 1px solid var(--border);
  padding: 16px 20px; font-size: 14px; line-height: 1.6;
}
.contact-summary-bar strong { display: block; font-size: 16px; color: var(--navy); margin-bottom: 2px; }

.instruction-list {
  background: var(--white); border: 1px solid var(--border);
  padding: 20px; display: flex; flex-direction: column; gap: 14px;
}
.instruction-row { display: flex; align-items: center; gap: 14px; font-size: 14px; }
.step-num {
  width: 28px; height: 28px; min-width: 28px; border-radius: 50%;
  background: var(--navy); color: #fff; font-size: 13px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}

/* ═══ REQUEST ACCESS PAGE ═══ */
.page-centered {
  min-height: 100dvh; background: var(--navy);
  display: flex; flex-direction: column;
}
.page-centered-inner {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 100px 24px 60px;
}
.request-card {
  width: 100%; max-width: 460px;
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.1);
  padding: 48px;
}
.request-card .eyebrow { margin-bottom: 8px; }
.request-card h2 { font-family: var(--ff-s); font-size: 28px; font-weight: 400; color: #fff; margin-bottom: 8px; }
.request-card > p { color: rgba(255,255,255,.45); font-size: 13px; margin-bottom: 32px; }

/* ═══ RESPONSIVE ═══ */
@media (max-width: 768px) {
  .hero-login-inner { flex-direction: column; gap: 40px; padding: 100px 24px 60px; }
  .hero-left { text-align: center; }
  .rule { margin: 20px auto 28px; }
  .hero-sub { margin: 0 auto; }
  .auth-card { max-width: 100%; padding: 32px 24px; }
  .nav-inner { padding: 0 24px; }
  .nav-user { display: none; }
}
