:root {
  color-scheme: light;
  --background: #FAFAF8;
  --ink: #0D0D0D;
  --gold: #B8952A;
  --border: #E5E2DC;
}

* {
  box-sizing: border-box;
}

[hidden] { display: none !important; }

html {
  min-height: 100%;
  background: var(--background);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  font-family: "DM Sans", sans-serif;
  font-weight: 300;
}

.app-header {
  min-height: 100px;
  padding: 32px 48px 0;
  display: flex;
  align-items: center;
  background: var(--background);
  border-bottom: 1px solid var(--border);
}

button, input { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 4px;
}

.auth-layout {
  width: min(1100px, 100%);
  margin: auto;
  padding: 80px 40px;
  display: grid;
  grid-template-columns: 1fr 440px;
  align-items: center;
  gap: 80px;
}

.app-canvas { display: flex; flex-direction: column; }
.eyebrow {
  margin: 0 0 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #80671d;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.intro .eyebrow::before { content: ""; width: 28px; height: 1px; background: var(--gold); }
h1, h2 { font-family: "Cormorant Garamond", Georgia, serif; font-weight: 700; }
h1 { margin: 0; font-size: clamp(54px, 5.6vw, 78px); line-height: 1; letter-spacing: -.035em; }
h1 em { color: var(--gold); }
.intro-description { margin: 30px 0 0; color: #57534c; font-size: 14px; line-height: 1.9; }
.brand-note { margin-top: 52px; display: flex; align-items: center; gap: 12px; color: #676158; font-size: 11px; }
.brand-note > span { color: var(--gold); font-size: 26px; }

.auth-card {
  padding: 10px 36px 28px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 4px;
  box-shadow: 0 16px 56px #3027150a;
}
.auth-modes { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--border); }
.mode-button { position: relative; padding: 18px 0; border: 0; background: transparent; color: #777169; font-size: 12px; font-weight: 500; }
.mode-button.is-current { color: var(--ink); }
.mode-button.is-current::after { content: ""; position: absolute; bottom: -1px; left: 0; right: 0; height: 2px; background: var(--gold); }
.card-heading { padding-top: 34px; }
.card-heading .eyebrow { margin-bottom: 12px; font-size: 9px; }
h2 { margin: 0; font-size: 40px; line-height: 1.1; letter-spacing: -.025em; }
.card-heading > p:last-child { margin: 12px 0 28px; color: #716b63; font-size: 12px; line-height: 1.6; }
.login-fields { display: grid; gap: 20px; }
.field { display: grid; gap: 9px; }
.field label { font-size: 11px; font-weight: 500; }
.label-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.field input { width: 100%; min-width: 0; height: 46px; padding: 0 14px; border: 1px solid var(--border); border-radius: 2px; background: #fcfcfa; color: var(--ink); font-size: 12px; transition: border-color .2s; }
.field input::placeholder { color: #928b81; }
.field input:focus { border-color: var(--gold); }
.password-input { position: relative; }
.password-input input { padding-right: 48px; }
.password-toggle { position: absolute; top: 1px; right: 1px; width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 2px; background: transparent; color: #716b63; }
.password-toggle:hover { color: #80671d; background: #b8952a0d; }
.password-toggle:focus-visible { outline-offset: -4px; }
.password-toggle svg { width: 20px; height: 20px; }
.password-toggle .eye-slash { display: none; }
.password-toggle[aria-pressed="true"] .eye-slash { display: block; }
.text-button { padding: 0; border: 0; background: transparent; color: #80671d; font-size: 10px; font-weight: 500; }
.text-button:hover { text-decoration: underline; text-underline-offset: 3px; }
.remember { display: flex; align-items: center; gap: 8px; width: fit-content; color: #676158; font-size: 11px; cursor: pointer; }
.remember input { margin: 0; width: 14px; height: 14px; accent-color: var(--gold); }
.primary-button { display: flex; justify-content: space-between; align-items: center; min-height: 46px; padding: 0 18px; border: 1px solid var(--ink); border-radius: 2px; background: var(--ink); color: #fff; font-size: 11px; font-weight: 500; letter-spacing: .06em; transition: background .2s, border-color .2s; }
.primary-button > span { font-size: 20px; font-weight: 300; }
.primary-button:hover { background: #80671d; border-color: #80671d; }
.signup-prompt { margin-top: 26px; padding-top: 24px; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; font-size: 11px; color: #716b63; }
.signup-prompt .text-button { font-size: 11px; }
.field select { width: 100%; height: 46px; padding: 0 14px; border: 1px solid var(--border); border-radius: 2px; background: #fcfcfa; color: var(--ink); font: inherit; font-size: 12px; }
.field-hint { margin: 0; color: #716b63; font-size: 10px; line-height: 1.5; }
.field-hint:empty { display: none; }
#confirm-password-error { color: #9a362d; }
#confirm-password[data-match="true"] { border-color: #47824f; background: #f2f8f1; }
#confirm-password[data-match="false"] { border-color: #9a362d; background: #fdf4f2; }
#confirm-password-error[data-match="true"] { color: #397040; }
.field input[aria-invalid="true"] { border-color: #9a362d; }
.primary-button #submit-label { font-size: 11px; font-weight: 500; }
button:disabled { cursor: wait; opacity: .55; }
.auth-status { margin: 20px 0 0; color: #54603d; font-size: 12px; line-height: 1.7; overflow-wrap: anywhere; }
.auth-status:empty { display: none; }
.auth-status.is-error { color: #9a362d; }
.welcome-panel { padding-top: 32px; }
.welcome-panel > p:not(.eyebrow) { color: #716b63; font-size: 12px; line-height: 1.8; }
.welcome-panel h2 { overflow-wrap: anywhere; }
.account-details { margin: 28px 0; padding: 22px 0; border-block: 1px solid var(--border); }
.account-details dt { color: #716b63; font-size: 10px; margin-bottom: 8px; }
.account-details dd { margin: 0 0 20px; font-size: 13px; overflow-wrap: anywhere; }
.account-details dd:last-child { margin-bottom: 0; }
.welcome-panel .primary-button { width: 100%; margin-top: 24px; }
.welcome-layout { width: min(100%, 640px); margin: auto; padding: 64px 24px; }
.welcome-card { padding: 48px 40px; }
.welcome-card h1 { font-size: clamp(40px, 6vw, 58px); overflow-wrap: anywhere; }
.welcome-role { margin: 24px 0 12px; color: #80671d; font-size: 14px; font-weight: 500; }
.welcome-description { color: #716b63; font-size: 13px; line-height: 1.8; }
.welcome-card .primary-button { width: 100%; margin-top: 32px; }
.welcome-card > .auth-status:first-child { margin-top: 0; }
.welcome-card #back-to-login { display: inline-block; margin-top: 16px; }
.verification-dialog { width: min(460px, calc(100% - 40px)); max-height: calc(100svh - 40px); margin: auto; padding: 36px; overflow-y: auto; border: 1px solid var(--border); border-radius: 6px; background: var(--background); color: var(--ink); box-shadow: 0 24px 80px #30271533; }
.verification-dialog::backdrop { background: #17150f66; backdrop-filter: blur(4px); }
.verification-icon { display: grid; place-items: center; width: 56px; height: 56px; margin-bottom: 26px; border: 1px solid #b8952a33; border-radius: 50%; background: #f5edd8; color: #80671d; }
.verification-icon svg { width: 26px; height: 26px; }
.verification-dialog .eyebrow { margin-bottom: 12px; }
.verification-dialog h2 { font-size: clamp(32px, 7vw, 40px); }
#verification-description { color: #57534c; font-size: 13px; line-height: 1.9; margin: 20px 0 16px; }
#verification-email { font-weight: 500; overflow-wrap: anywhere; }
.verification-hint, .verification-existing { color: #716b63; font-size: 11px; line-height: 1.8; }
.verification-existing { padding-top: 16px; border-top: 1px solid var(--border); }
.verification-dialog .primary-button { width: 100%; margin-top: 26px; }
.app-footer { padding: 0 48px 24px; display: flex; justify-content: space-between; gap: 16px; color: #756d60; font-size: 10px; line-height: 1.5; }

@media (max-width: 900px) {
  .auth-layout { gap: 36px; grid-template-columns: 1fr 400px; padding: 60px 32px; }
  h1 { font-size: 56px; }
}
@media (max-width: 740px) {
  .auth-layout { grid-template-columns: 1fr; max-width: 500px; padding: 40px 24px; gap: 32px; }
  h1 { font-size: 48px; }
  .intro-description { margin-top: 18px; font-size: 13px; }
  .brand-note { display: none; }
  .intro .eyebrow { margin-bottom: 18px; }
  .auth-card { padding-right: 26px; padding-left: 26px; }
  .app-footer { padding: 0 24px 20px; }
}
@media (max-width: 380px) {
  .auth-card { padding-right: 20px; padding-left: 20px; }
  .app-footer > span:last-child { max-width: 150px; text-align: right; }
}

.wordmark {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: .02em;
  line-height: 1;
}

.wordmark em {
  color: var(--gold);
  font-style: normal;
}

.app-canvas {
  flex: 1;
  position: relative;
  isolation: isolate;
  background: linear-gradient(135deg, #FAFAF8 0%, #F0EBE0 60%, #E8DFC8 100%);
}

.app-canvas::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .035;
  background-image:
    linear-gradient(var(--ink) 1px, transparent 1px),
    linear-gradient(90deg, var(--ink) 1px, transparent 1px);
  background-size: 48px 48px;
}

@media (max-width: 600px) {
  .app-header {
    min-height: 84px;
    padding: 16px 24px 0;
  }
}
