:root {
  --cream: #f4efe7;
  --paper: #fbfaf7;
  --espresso: #251d18;
  --brown: #57483d;
  --gold: #a98d64;
  --line: #dcd4c7;
  --error: #9a3c32;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  font-family: "DM Sans", sans-serif;
  color: var(--espresso);
  background: var(--cream);
}

.page-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 43% 57%;
}

.brand-panel {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 44px clamp(32px, 5vw, 72px) 48px;
  color: #fff;
  background:
    linear-gradient(150deg, rgba(31, 23, 18, 0.2), rgba(31, 23, 18, 0.72)),
    url("https://images.unsplash.com/photo-1540555700478-4be289fbecef?auto=format&fit=crop&w=1500&q=85") center/cover;
}

.brand-panel::after {
  content: "";
  position: absolute;
  inset: 16px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  pointer-events: none;
}

.brand-header, .brand-copy, .brand-footer { position: relative; z-index: 1; }

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-monogram {
  font-family: "Playfair Display", serif;
  font-size: 38px;
  letter-spacing: 2px;
  line-height: 1;
}

.brand-name {
  max-width: 74px;
  padding-left: 12px;
  border-left: 1px solid rgba(255, 255, 255, 0.55);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 3px;
  line-height: 1.5;
}

.brand-copy { margin: auto 0; }

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 22px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
}

.eyebrow span { width: 36px; height: 1px; background: var(--gold); }

.brand-copy h1 {
  margin: 0;
  font-family: "Playfair Display", serif;
  font-size: clamp(46px, 5vw, 76px);
  font-weight: 500;
  line-height: 0.98;
  letter-spacing: -2px;
}

.intro {
  max-width: 400px;
  margin: 24px 0 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 16px;
  line-height: 1.7;
}

.intro em { color: #fff; }

.brand-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.brand-footer p { margin: 0; }

.brand-footer a {
  color: inherit;
  text-decoration: none;
  transition: opacity 0.2s;
}

.brand-footer a:hover { opacity: 0.72; }

.form-panel {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 48px clamp(32px, 7vw, 104px);
  background: var(--paper);
}

.form-wrap { width: min(100%, 610px); }

.step-label {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
}

.form-wrap h2 {
  margin: 0;
  font-family: "Playfair Display", serif;
  font-size: clamp(38px, 4vw, 56px);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -1px;
}

.form-intro {
  margin: 14px 0 34px;
  color: #756b62;
  font-size: 14px;
  line-height: 1.6;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.field { margin-bottom: 18px; }

.field label {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 600;
}

.field label span { color: #94898d; font-weight: 400; }

.field input, .field select {
  width: 100%;
  height: 52px;
  border: 1px solid var(--line);
  border-radius: 2px;
  outline: none;
  background: #fff;
  color: var(--espresso);
  padding: 0 15px;
  font: 14px "DM Sans", sans-serif;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field input::placeholder { color: #aaa197; }

.field input:focus, .field select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(169, 141, 100, 0.12);
}

.field input.invalid { border-color: var(--error); }

.field select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--brown) 50%), linear-gradient(135deg, var(--brown) 50%, transparent 50%);
  background-position: calc(100% - 18px) 23px, calc(100% - 13px) 23px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.error {
  display: block;
  min-height: 16px;
  margin-top: 4px;
  color: var(--error);
  font-size: 11px;
}

.consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 2px 0 0;
  color: #756b62;
  font-size: 12px;
  line-height: 1.5;
  cursor: pointer;
}

.consent input {
  width: 16px;
  height: 16px;
  margin: 1px 0 0;
  accent-color: var(--espresso);
}

.consent-error { margin-left: 26px; }

.submit-button {
  width: 100%;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  border: 0;
  border-radius: 2px;
  padding: 0 20px 0 24px;
  background: var(--espresso);
  color: #fff;
  font: 600 13px "DM Sans", sans-serif;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.submit-button:hover { background: #3a3028; }
.submit-button:active { transform: scale(0.995); }

.arrow {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  font-size: 18px;
}

.success-message {
  align-items: center;
  gap: 14px;
  margin-top: 8px;
  border: 1px solid #cdd8c7;
  border-radius: 2px;
  padding: 16px;
  background: #f2f6ef;
}

.success-message:not([hidden]) { display: flex; }

.success-icon {
  display: grid;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  background: #597350;
  color: #fff;
}

.success-message strong { font-family: "Playfair Display", serif; font-size: 18px; }
.success-message p { margin: 3px 0 0; color: #66715f; font-size: 12px; }

.privacy {
  margin: 18px 0 0;
  color: #9a9187;
  font-size: 10px;
  text-align: center;
}

.privacy a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

.signup-trigger {
  width: 100%;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 0;
  border-radius: 2px;
  padding: 0 20px 0 24px;
  background: var(--espresso);
  color: #fff;
  font: 600 13px "DM Sans", sans-serif;
  cursor: pointer;
}

.modal-open { overflow: hidden; }

.modal-backdrop {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(24, 18, 14, 0.68);
  backdrop-filter: blur(8px);
}

.modal-backdrop[hidden] { display: none; }

.signup-modal {
  position: relative;
  width: min(100%, 440px);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  border-radius: 6px;
  padding: 38px 42px 34px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(20, 14, 10, 0.28);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  color: #81796f;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.modal-kicker {
  margin: 0 0 8px;
  color: var(--gold);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 2.5px;
  text-transform: uppercase;
}

.signup-modal h2 {
  margin: 0;
  font-family: "Playfair Display", serif;
  font-size: 34px;
  font-weight: 500;
}

.modal-intro {
  margin: 8px 0 24px;
  color: #7b7168;
  font-size: 13px;
}

.provider-list { display: grid; gap: 10px; }

.provider-button {
  width: 100%;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 1px solid #d9d3c9;
  border-radius: 4px;
  background: #fff;
  color: #332b25;
  font: 600 13px "DM Sans", sans-serif;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s;
}

.provider-button:hover { background: #faf8f4; border-color: #bdb3a4; }

.provider-icon {
  width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 20px;
}

.google-icon { border-radius: 50%; background: conic-gradient(#4285f4 0 25%, #34a853 25% 50%, #fbbc05 50% 75%, #ea4335 75%); color: transparent; }
.apple-icon { color: #181818; font-size: 18px; }

.microsoft-icon {
  grid-template-columns: repeat(2, 8px);
  grid-template-rows: repeat(2, 8px);
  gap: 2px;
}
.microsoft-icon i { display: block; }
.microsoft-icon i:nth-child(1) { background: #f35325; }
.microsoft-icon i:nth-child(2) { background: #81bc06; }
.microsoft-icon i:nth-child(3) { background: #05a6f0; }
.microsoft-icon i:nth-child(4) { background: #ffba08; }
.yahoo-icon { color: #6001d2; font-weight: 800; }

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: #aaa195;
  font-size: 11px;
}

.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: #e7e1d8; }

.mail-icon { color: var(--brown); font-size: 17px; }

.modal-login {
  margin: 18px 0 0;
  color: #81776d;
  font-size: 12px;
  text-align: center;
}

.modal-login button {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--espresso);
  font: 600 12px "DM Sans", sans-serif;
  text-decoration: underline;
  cursor: pointer;
}

.back-button {
  width: 34px;
  height: 34px;
  margin: -12px 0 16px -8px;
  border: 0;
  background: transparent;
  color: #777067;
  font-size: 20px;
  cursor: pointer;
}

.credentials-view .field { margin-bottom: 14px; }
.credentials-view .consent { margin-top: 4px; }
.credentials-view .submit-button { margin-top: 12px; }

.password-wrap { position: relative; }
.password-wrap input { padding-right: 62px; }

.password-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: #776d63;
  font: 600 11px "DM Sans", sans-serif;
  cursor: pointer;
}

.credentials-view [hidden], .provider-view[hidden] { display: none; }

@media (max-width: 900px) {
  .page-shell { grid-template-columns: 38% 62%; }
  .brand-panel { padding-inline: 32px; }
  .form-panel { padding-inline: 36px; }
}

@media (max-width: 700px) {
  .page-shell { display: block; }
  .brand-panel { min-height: 360px; padding: 28px 28px 32px; }
  .brand-panel::after { inset: 10px; }
  .brand-copy { margin: 40px 0 28px; }
  .brand-copy h1 { font-size: 48px; }
  .intro { display: none; }
  .brand-footer { display: none; }
  .form-panel { min-height: auto; padding: 42px 22px 32px; }
  .form-wrap h2 { font-size: 42px; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
}

@media (max-width: 390px) {
  .brand-copy h1 { font-size: 41px; }
  .form-wrap h2 { font-size: 37px; }
}

@media (max-width: 700px) {
  .modal-backdrop { align-items: end; padding: 0; }
  .signup-modal {
    width: 100%;
    max-height: 92vh;
    border-radius: 12px 12px 0 0;
    padding: 32px 24px 28px;
  }
  .signup-modal h2 { font-size: 30px; }
}
