* { box-sizing: border-box; }

html, body { min-width: 280px; min-height: 100%; margin: 0; }
html { background: #07131f; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { overflow-x: hidden; background: #07131f; color: #f7f3e9; font-family: Arial, Helvetica, sans-serif; }
button, input { font-family: inherit; }

.login-shell {
  width: 100%; min-height: 100vh; min-height: 100svh;
  display: -webkit-flex; display: flex; overflow: hidden;
}

.login-story {
  position: relative; width: 62%; min-width: 0; min-height: 100vh; min-height: 100svh;
  padding: 28px; padding: clamp(28px, 4.5vw, 72px);
  -webkit-flex: 1 1 62%; flex: 1 1 62%;
  display: -webkit-flex; display: flex; -webkit-flex-direction: column; flex-direction: column;
  -webkit-justify-content: space-between; justify-content: space-between; overflow: hidden;
  background: linear-gradient(90deg, rgba(4,14,22,.82) 0%, rgba(4,14,22,.24) 70%, rgba(4,14,22,.58) 100%),
    linear-gradient(0deg, rgba(2,10,16,.72), transparent 55%),
    url('login-background.jpg') center center / cover no-repeat;
}
.login-story:after {
  content: ''; position: absolute; top: 16px; right: 16px; bottom: 16px; left: 16px;
  border: 1px solid rgba(241,201,104,.34); border-radius: 22px; pointer-events: none;
}
.login-brand, .login-eyebrow { position: relative; z-index: 1; font-weight: 700; letter-spacing: .18em; }
.login-brand { display: -webkit-flex; display: flex; -webkit-align-items: center; align-items: center; gap: 12px; font-size: .78rem; }
.brand-star { color: #f1c968; font-size: 1.4rem; }
.login-story-copy { position: relative; z-index: 1; width: 100%; max-width: 690px; padding-bottom: 8vh; }
.login-eyebrow { color: #d9c58c; font-size: .7rem; line-height: 1.5; }
.login-story h1 {
  max-width: 650px; margin: 18px 0; font-family: Georgia, 'Times New Roman', serif;
  font-size: 3rem; font-size: clamp(3rem, 6.5vw, 7rem); font-weight: 400; line-height: .95; letter-spacing: -.045em;
}
.login-story p { max-width: 580px; margin: 0; color: rgba(255,255,255,.8); font-size: 1rem; font-size: clamp(1rem, 1.3vw, 1.25rem); line-height: 1.6; }
.login-time { position: absolute; z-index: 1; right: 7%; bottom: 7%; display: -webkit-flex; display: flex; -webkit-align-items: flex-end; align-items: flex-end; gap: 12px; color: rgba(255,255,255,.9); }
.login-time strong { font-family: Georgia, 'Times New Roman', serif; font-size: 2.5rem; font-size: clamp(2.5rem, 5vw, 5.5rem); font-weight: 400; line-height: .8; }
.login-time span { padding-bottom: 4px; color: #d9c58c; font-size: .65rem; font-weight: 700; letter-spacing: .22em; }

.login-access {
  width: 38%; min-width: 360px; min-height: 100vh; min-height: 100svh;
  padding: 32px; padding: clamp(28px, 5vw, 80px); -webkit-flex: 0 0 38%; flex: 0 0 38%;
  display: -webkit-flex; display: flex; -webkit-flex-direction: column; flex-direction: column;
  -webkit-align-items: center; align-items: center; -webkit-justify-content: center; justify-content: center;
  overflow-y: auto; background: radial-gradient(circle at 20% 10%, rgba(42,113,103,.18), transparent 30%), #081015;
}
.login-card, .login-footnote { width: 100%; max-width: 430px; }
.pin-card, .pin-page .login-footnote { max-width: 460px; }
.login-card h2 { margin: 14px 0 12px; font-family: Georgia, 'Times New Roman', serif; font-size: 2.5rem; font-size: clamp(2.5rem, 4vw, 4rem); font-weight: 400; line-height: 1.02; letter-spacing: -.025em; }
.login-card > p { margin: 0 0 30px; color: #aeb7b5; font-size: 1rem; line-height: 1.6; }
.pin-card > p { margin-bottom: 22px; }
.login-card strong { color: #f7f3e9; }
.google-access { min-height: 44px; margin: 8px 0 28px; }
.login-security { padding: 20px 0 0; display: -webkit-flex; display: flex; gap: 12px; border-top: 1px solid rgba(255,255,255,.1); color: #8e9a98; font-size: .85rem; line-height: 1.5; }
.security-icon { width: 24px; height: 24px; -webkit-flex: 0 0 24px; flex: 0 0 24px; display: -webkit-flex; display: flex; -webkit-align-items: center; align-items: center; -webkit-justify-content: center; justify-content: center; border: 1px solid #61c7aa; border-radius: 50%; color: #61c7aa; }
.login-alert, .login-notice, .login-setup { margin: 0 0 22px; padding: 14px 16px; border-radius: 14px; font-size: .9rem; line-height: 1.45; }
.login-alert { border: 1px solid rgba(255,124,104,.45); background: rgba(112,31,29,.28); color: #ffd9d2; }
.login-notice { border: 1px solid rgba(97,199,170,.35); background: rgba(28,94,78,.22); color: #c9f4e7; }
.login-setup { display: -webkit-flex; display: flex; -webkit-flex-direction: column; flex-direction: column; gap: 5px; border: 1px solid rgba(241,201,104,.35); background: rgba(99,74,24,.22); color: #eadfbe; }
.login-setup code { color: #fff4cc; }
.login-footnote { margin: 30px 0 0; color: #667270; font-size: .78rem; line-height: 1.45; }
.login-footnote a { color: #8fa9a4; text-underline-offset: 3px; }
.login-footnote a:hover, .login-footnote a:focus { color: #f1c968; }

.pin-form { width: 100%; margin: 0; }
.pin-form label { display: block; margin: 0 0 10px; color: #d9c58c; font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.pin-input {
  width: 100%; height: 72px; margin: 0; padding: 0 14px 0 24px;
  border: 1px solid rgba(241,201,104,.44); border-radius: 16px; outline: none;
  -webkit-appearance: none; appearance: none; background: #0b1d24; color: #f7f3e9; caret-color: #f1c968;
  font-family: Georgia, 'Times New Roman', serif; font-size: 2rem; font-size: clamp(2rem, 5vw, 3rem);
  letter-spacing: .38em; text-align: center; font-variant-numeric: tabular-nums;
}
.pin-input:hover { border-color: rgba(241,201,104,.7); }
.pin-input:focus { border-color: #f1c968; box-shadow: 0 0 0 3px rgba(241,201,104,.12); }
.pin-meta { margin: 12px 0 20px; color: #8e9a98; font-size: .85rem; line-height: 1.45; }
.pin-meta strong { color: #d9c58c; font-variant-numeric: tabular-nums; }
.pin-primary, .pin-secondary, .pin-link {
  min-height: 46px; border-radius: 999px; font: inherit; font-weight: 700; line-height: 1.2;
  cursor: pointer; -webkit-appearance: none; appearance: none;
  transition: background-color .18s ease, border-color .18s ease, color .18s ease, opacity .18s ease;
}
.pin-primary { width: 100%; padding: 0 22px; border: 1px solid #f1c968; background: #f1c968; color: #101718; }
.pin-primary:hover, .pin-primary:focus { border-color: #ffe08f; background: #ffe08f; outline: none; }
.pin-actions { width: 100%; margin: 16px 0 26px; display: -webkit-flex; display: flex; -webkit-align-items: stretch; align-items: stretch; gap: 10px; }
.pin-actions form { min-width: 0; margin: 0; -webkit-flex: 1 1 50%; flex: 1 1 50%; }
.pin-secondary, .pin-link { width: 100%; padding: 0 14px; border: 1px solid rgba(255,255,255,.14); background: transparent; color: #b9c7c3; }
.pin-secondary:hover, .pin-secondary:focus, .pin-link:hover, .pin-link:focus { border-color: rgba(241,201,104,.55); color: #f7f3e9; outline: none; }
.pin-link { color: #d9c58c; }
.pin-secondary:disabled { cursor: not-allowed; opacity: .48; }

@media (max-width: 1120px) {
  .login-story { width: 55%; -webkit-flex-basis: 55%; flex-basis: 55%; }
  .login-access { width: 45%; min-width: 340px; -webkit-flex-basis: 45%; flex-basis: 45%; }
}

@media (min-width: 901px) and (max-height: 720px) {
  .login-story, .login-access { min-height: 720px; }
  .login-story-copy { padding-bottom: 4vh; }
  .login-card h2 { font-size: 2.75rem; }
  .login-card > p { margin-bottom: 18px; }
  .pin-input { height: 62px; }
  .pin-actions { margin-bottom: 18px; }
  .login-footnote { margin-top: 20px; }
}

@media (max-width: 900px) {
  .login-shell { -webkit-flex-direction: column; flex-direction: column; overflow: visible; }
  .login-story, .login-access { width: 100%; min-width: 0; min-height: auto; -webkit-flex: none; flex: none; }
  .login-story { height: 38vh; height: 38svh; min-height: 310px; padding: 28px; }
  .login-story-copy { max-width: 640px; padding: 0; }
  .login-story h1 { max-width: 600px; font-size: 2.7rem; font-size: clamp(2.7rem, 9vw, 4.8rem); }
  .login-story p, .login-time { display: none; }
  .login-access { min-height: 62vh; min-height: 62svh; padding: 48px 28px; overflow: visible; }
  .login-card h2 { font-size: 3rem; }
}

@media (max-width: 520px) {
  .login-story { height: 34vh; height: 34svh; min-height: 250px; padding: 22px; }
  .login-story:after { top: 10px; right: 10px; bottom: 10px; left: 10px; border-radius: 18px; }
  .login-brand { gap: 8px; font-size: .68rem; }
  .brand-star { font-size: 1.1rem; }
  .login-story h1 { margin: 12px 0 0; font-size: 2.45rem; line-height: .98; }
  .login-access {
    min-height: 66vh; min-height: 66svh; padding: 38px 20px;
    padding-right: max(20px, env(safe-area-inset-right));
    padding-bottom: max(38px, env(safe-area-inset-bottom));
    padding-left: max(20px, env(safe-area-inset-left));
    -webkit-justify-content: flex-start; justify-content: flex-start;
  }
  .login-card h2 { margin-top: 10px; font-size: 2.55rem; }
  .login-card > p { margin-bottom: 22px; font-size: .95rem; }
  .pin-input { height: 64px; padding-left: 18px; font-size: 2rem; letter-spacing: .28em; }
  .pin-actions { -webkit-flex-direction: column; flex-direction: column; }
  .pin-actions form { width: 100%; -webkit-flex-basis: auto; flex-basis: auto; }
  .login-security { font-size: .8rem; }
  .login-footnote { margin-top: 24px; }
}

@media (max-width: 900px) and (max-height: 520px) and (orientation: landscape) {
  .login-story { display: none; }
  .login-access { min-height: 100vh; min-height: 100svh; padding-top: 28px; padding-bottom: 28px; -webkit-justify-content: center; justify-content: center; }
  .login-card h2 { font-size: 2.4rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *:before, *:after { scroll-behavior: auto !important; transition: none !important; }
}
