:root {
  --cream: #f7f0e2;
  --paper: #fffdf8;
  --ink: #172c2b;
  --forest: #173f36;
  --forest-deep: #0f302b;
  --navy: #122a3b;
  --olive: #74805a;
  --olive-soft: #a4ac81;
  --sand: #d9c5a0;
  --terracotta: #b75c47;
  --muted: #5f6b67;
  --line: rgba(23, 63, 54, .18);
  --shadow: 0 28px 75px rgba(24, 47, 40, .15);
  --sans: "DM Sans", system-ui, sans-serif;
  --serif: "Playfair Display", Georgia, serif;
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body { margin: 0; color: var(--ink); background: var(--cream); font-family: var(--sans); line-height: 1.55; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 4px; }
button, input { font: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; z-index: 100; top: 8px; left: 8px; transform: translateY(-150%); padding: 10px 14px; color: white; background: var(--forest); border-radius: 6px; }
.skip-link:focus { transform: translateY(0); }
.preview-ribbon { background: var(--navy); color: white; text-align: center; padding: 7px 20px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }

.auth-header { position: relative; z-index: 5; border-bottom: 1px solid rgba(23,63,54,.12); background: rgba(247,240,226,.92); backdrop-filter: blur(14px); }
.auth-nav { width: min(1220px, calc(100% - 44px)); min-height: 82px; margin-inline: auto; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.auth-brand { display: inline-flex; align-items: center; gap: 13px; color: var(--forest); font-family: var(--serif); font-size: 20px; font-weight: 600; text-decoration: none; }
.auth-brand img { width: 60px; height: 60px; border: 1px solid rgba(23,63,54,.2); border-radius: 50%; object-fit: cover; box-shadow: 0 6px 18px rgba(23,63,54,.12); }
.auth-switch { margin: 0; color: var(--muted); font-size: 14px; }
.auth-switch a { margin-left: 7px; color: var(--forest); font-weight: 700; }

.auth-main { position: relative; min-height: calc(100vh - 117px); overflow: hidden; }
.auth-main::before, .auth-main::after { content: ""; position: absolute; border: 1px solid rgba(116,128,90,.18); border-radius: 50%; pointer-events: none; }
.auth-main::before { width: 430px; height: 430px; top: -230px; left: -170px; }
.auth-main::after { width: 520px; height: 520px; right: -310px; bottom: -280px; }
.auth-shell { position: relative; z-index: 1; width: min(1160px, calc(100% - 44px)); margin-inline: auto; }

.register-layout { display: grid; grid-template-columns: minmax(340px, .78fr) minmax(500px, 1.05fr); gap: clamp(58px, 8vw, 112px); align-items: center; padding: 72px 0 92px; }
.register-story { align-self: stretch; display: flex; flex-direction: column; justify-content: center; }
.eyebrow { margin: 0 0 16px; color: var(--olive); font-size: 12px; font-weight: 700; letter-spacing: .17em; text-transform: uppercase; }
.auth-title { margin: 0; font-family: var(--serif); font-size: clamp(43px, 5vw, 66px); font-weight: 600; letter-spacing: -.035em; line-height: 1.06; }
.auth-title em { color: var(--forest); font-weight: 600; }
.auth-intro { max-width: 570px; margin: 23px 0 0; color: var(--muted); font-size: 17px; line-height: 1.75; }
.keepsake-scene { position: relative; width: min(420px, 100%); margin-top: 38px; }
.keepsake-frame { overflow: hidden; height: 265px; border: 8px solid rgba(255,255,255,.72); border-radius: 150px 150px 12px 12px; background: #e9ddc6; box-shadow: var(--shadow); }
.keepsake-frame img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.08); }
.keepsake-caption { position: absolute; right: -22px; bottom: -17px; padding: 13px 18px; border: 1px solid #d9c7a5; background: #fffaf0; color: var(--forest); box-shadow: 0 15px 34px rgba(24,47,40,.14); font-family: var(--serif); font-size: 15px; transform: rotate(2deg); }
.olive-sprig { position: absolute; z-index: 2; width: 150px; fill: #7c885e; stroke: #52623f; stroke-width: 3; stroke-linecap: round; pointer-events: none; }
.register-olive { left: -65px; bottom: -35px; transform: rotate(185deg); }

.form-panel { position: relative; padding: clamp(31px, 5vw, 55px); border: 1px solid rgba(23,63,54,.16); border-radius: 4px 68px 4px 4px; background: rgba(255,253,248,.92); box-shadow: var(--shadow); }
.form-panel::after { content: ""; position: absolute; inset: 12px; border: 1px solid rgba(116,128,90,.12); border-radius: 2px 57px 2px 2px; pointer-events: none; }
.form-content { position: relative; z-index: 1; }
.form-heading { margin: 0; font-family: var(--serif); font-size: clamp(30px, 4vw, 41px); font-weight: 600; line-height: 1.16; }
.form-note { margin: 10px 0 28px; color: var(--muted); font-size: 14px; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.field-full { grid-column: 1 / -1; }
.field { min-width: 0; }
.field label { display: block; margin-bottom: 8px; color: var(--ink); font-size: 13px; font-weight: 700; }
.field input { width: 100%; min-height: 52px; padding: 13px 15px; color: var(--ink); border: 1px solid rgba(23,63,54,.25); border-radius: 3px; outline: none; background: #fffefb; transition: border-color .2s, box-shadow .2s; }
.field input::placeholder { color: #8d9692; }
.field input:focus { border-color: var(--forest); box-shadow: 0 0 0 4px rgba(23,63,54,.11); }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 90px; }
.password-toggle { position: absolute; top: 50%; right: 9px; min-width: 66px; padding: 8px 9px; transform: translateY(-50%); color: var(--forest); border: 0; border-radius: 3px; background: transparent; font-size: 12px; font-weight: 700; cursor: pointer; }
.password-toggle:hover { background: rgba(116,128,90,.11); }
.password-toggle:focus-visible, .primary-action:focus-visible, a:focus-visible { outline: 3px solid rgba(183,92,71,.42); outline-offset: 3px; }
.helper { display: block; margin-top: 7px; color: var(--muted); font-size: 12px; }
.consent { display: grid; grid-template-columns: 18px 1fr; gap: 10px; align-items: start; margin: 22px 0; color: var(--muted); font-size: 13px; }
.consent input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--forest); }
.consent a { color: var(--forest); }
.primary-action { width: 100%; min-height: 54px; padding: 14px 20px; color: white; border: 1px solid var(--forest); border-radius: 3px; background: var(--forest); box-shadow: 0 12px 30px rgba(23,63,54,.18); font-weight: 700; cursor: pointer; transition: transform .2s, background .2s, box-shadow .2s; }
.primary-action:hover { transform: translateY(-2px); background: var(--forest-deep); box-shadow: 0 16px 34px rgba(23,63,54,.23); }
.prototype-note { display: flex; gap: 9px; align-items: flex-start; margin: 17px 0 0; padding: 12px 14px; color: #57645e; background: rgba(116,128,90,.1); border-left: 3px solid var(--olive); font-size: 12px; }
.prototype-note svg { width: 16px; flex: 0 0 auto; margin-top: 1px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.form-message { display: none; margin: 17px 0 0; padding: 13px 15px; color: var(--forest); background: #eef1e7; border: 1px solid rgba(116,128,90,.35); font-size: 13px; }
.form-message.visible { display: block; }

.login-layout { display: grid; grid-template-columns: minmax(460px, .92fr) minmax(380px, .72fr); gap: clamp(56px, 9vw, 126px); align-items: center; min-height: calc(100vh - 117px); padding: 62px 0 82px; }
.login-visual { position: relative; min-height: 610px; }
.login-arch { position: absolute; inset: 4px 0 40px 16px; overflow: hidden; border: 9px solid rgba(255,255,255,.68); border-radius: 245px 245px 12px 12px; background: #e6d8bd; box-shadow: var(--shadow); }
.login-arch img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.12); }
.login-arch::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 35%, rgba(15,48,43,.52)); }
.login-quote { position: absolute; z-index: 2; left: 56px; right: 40px; bottom: 79px; margin: 0; color: white; font-family: var(--serif); font-size: clamp(25px, 3vw, 38px); line-height: 1.22; text-shadow: 0 2px 18px rgba(15,48,43,.38); }
.login-seal { position: absolute; z-index: 3; right: -21px; bottom: 15px; display: grid; width: 72px; height: 72px; place-items: center; color: #f5dfd2; background: var(--terracotta); border: 5px double rgba(255,255,255,.55); border-radius: 50%; box-shadow: 0 10px 24px rgba(68,33,25,.25); font-family: var(--serif); font-size: 22px; }
.login-olive { left: -65px; top: 80px; transform: rotate(185deg); }
.login-form-wrap { max-width: 440px; justify-self: center; }
.login-form-wrap .auth-title { font-size: clamp(43px, 5vw, 61px); }
.login-form { margin-top: 32px; }
.login-form .field + .field { margin-top: 20px; }
.form-extras { display: flex; justify-content: space-between; gap: 20px; align-items: center; margin: 17px 0 24px; font-size: 13px; }
.remember { display: inline-flex; align-items: center; gap: 9px; color: var(--muted); }
.remember input { width: 17px; height: 17px; margin: 0; accent-color: var(--forest); }
.forgot { color: var(--forest); font-weight: 700; }
.login-bottom { margin: 27px 0 0; padding-top: 22px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.login-bottom a { color: var(--forest); font-weight: 700; }
.auth-footer { padding: 22px; color: var(--muted); border-top: 1px solid var(--line); background: rgba(255,253,248,.68); text-align: center; font-size: 12px; }

@media (max-width: 940px) {
  .register-layout, .login-layout { grid-template-columns: 1fr; }
  .register-layout { gap: 65px; padding-top: 55px; }
  .register-story { text-align: center; align-items: center; }
  .keepsake-scene { margin-inline: auto; }
  .login-layout { gap: 56px; padding-top: 50px; }
  .login-visual { width: min(520px, 100%); min-height: 540px; margin-inline: auto; order: 2; }
  .login-form-wrap { width: min(540px, 100%); justify-self: center; }
}

@media (max-width: 640px) {
  .preview-ribbon { font-size: 9px; }
  .auth-nav { width: min(100% - 28px, 1220px); min-height: 70px; }
  .auth-brand span { display: none; }
  .auth-brand img { width: 52px; height: 52px; }
  .auth-switch { text-align: right; font-size: 12px; }
  .auth-switch a { display: block; margin: 2px 0 0; }
  .auth-shell { width: min(100% - 28px, 1160px); }
  .register-layout { padding: 43px 0 65px; gap: 50px; }
  .auth-title { font-size: clamp(39px, 12vw, 52px); }
  .auth-intro { font-size: 16px; }
  .keepsake-frame { height: 220px; }
  .keepsake-caption { right: -2px; }
  .register-olive { left: -35px; }
  .form-panel { padding: 33px 24px; border-radius: 4px 45px 4px 4px; }
  .form-panel::after { display: none; }
  .field-grid { grid-template-columns: 1fr; gap: 18px; }
  .field-full { grid-column: auto; }
  .login-layout { min-height: auto; padding: 42px 0 64px; }
  .login-form-wrap { max-width: 100%; }
  .login-visual { min-height: 410px; }
  .login-arch { inset: 0 0 30px; border-radius: 200px 200px 10px 10px; }
  .login-quote { left: 30px; right: 25px; bottom: 62px; font-size: 25px; }
  .login-seal { right: -4px; width: 62px; height: 62px; }
  .login-olive { left: -35px; top: 55px; width: 120px; }
  .form-extras { align-items: flex-start; }
}

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