@font-face {
  font-family: "Montserrat";
  src: url("./fonts/Montserrat-wght.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Roboto";
  src: url("./fonts/Roboto-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Roboto";
  src: url("./fonts/Roboto-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Roboto";
  src: url("./fonts/Roboto-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --canvas: #fbfaf7;
  --surface: #ffffff;
  --pine-deep: #172723;
  --pine-mid: #213731;
  --pine-accent: #1d4a3d;
  --pine-hover: #14352c;
  --sage-soft: #96b4a4;
  --brass: #d5b274;
  --ink: #17211e;
  --ink-soft: #4c5c56;
  --ink-muted: #5c6c66;
  --border: #c9d2ce;
  --border-strong: #8ea099;
  --focus: #1d4a3d;
  --error: #a62626;
  --error-bg: #fdf2f2;
  --error-border: #d98282;
  --ok: #1b6546;
  --ok-bg: #edf7f2;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
}

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

html {
  background: var(--canvas);
  color: var(--ink);
  font-family: "Roboto", system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--canvas);
  color: var(--ink);
}

svg {
  display: block;
  max-width: 100%;
}

button,
input {
  font: inherit;
  color: inherit;
}

a {
  color: var(--pine-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--pine-deep);
}

:focus-visible {
  outline: 2.5px solid var(--focus);
  outline-offset: 2px;
}

.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: absolute;
  top: -60px;
  left: 16px;
  z-index: 100;
  background: var(--pine-deep);
  color: #ffffff;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

/* Split Layout */
.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
}

/* Left Brand Panel */
.brand-panel {
  position: relative;
  background: radial-gradient(circle at 22% 18%, #253d36 0%, var(--pine-deep) 70%);
  color: #f4f1ea;
  padding: 56px 56px 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 36px;
  overflow: hidden;
}

.brand-top {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 440px;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: #f4f1ea;
}

.brand-badge {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: rgba(244, 241, 234, 0.12);
  border: 1px solid rgba(244, 241, 234, 0.24);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-name {
  font-family: "Montserrat", system-ui, sans-serif;
  font-weight: 700;
  font-size: 1.18rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  line-height: 1;
}

.brand-purpose {
  margin: 0;
  font-family: "Montserrat", system-ui, sans-serif;
  font-weight: 500;
  font-size: 1.55rem;
  line-height: 1.35;
  color: #f4f1ea;
  letter-spacing: -0.01em;
}

.brand-art {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
}

.brand-notes {
  margin: 0;
  padding: 20px 0 0;
  border-top: 1px solid rgba(244, 241, 234, 0.16);
  list-style: none;
  display: grid;
  gap: 10px;
  max-width: 460px;
}

.brand-notes li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
  color: #d6dfd9;
}

.brand-notes svg {
  flex-shrink: 0;
  color: var(--brass);
}

/* Right Form Panel */
.form-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 48px 40px;
  background: var(--canvas);
}

.form-wrap {
  width: 100%;
  max-width: 448px;
}

.mobile-brand-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 16px;
  margin-bottom: 20px;
  border-bottom: 1px solid #e3e7e4;
}

.mobile-brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--pine-deep);
  text-decoration: none;
}

.mobile-brand-badge {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: var(--pine-deep);
  color: #f4f1ea;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-brand-name {
  font-family: "Montserrat", system-ui, sans-serif;
  font-weight: 700;
  font-size: 0.98rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.mobile-brand-tag {
  font-size: 0.78rem;
  color: var(--ink-soft);
}

.form-header {
  margin-bottom: 24px;
}

.form-title {
  margin: 0 0 8px;
  font-family: "Montserrat", system-ui, sans-serif;
  font-weight: 600;
  font-size: 1.85rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.form-subtitle {
  margin: 0;
  font-size: 0.95rem;
  color: var(--ink-soft);
}

/* Error Summary */
.error-summary {
  margin-bottom: 20px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--error);
  background: var(--error-bg);
  color: #6b1616;
}

.error-summary[hidden] {
  display: none;
}

.error-summary-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 8px;
  font-family: "Montserrat", system-ui, sans-serif;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--error);
}

.error-summary-head svg {
  flex-shrink: 0;
}

.error-summary-list {
  margin: 0;
  padding-left: 26px;
  display: grid;
  gap: 4px;
  font-size: 0.875rem;
}

.error-summary-list a {
  color: #7c1919;
  font-weight: 500;
}

.error-summary-list a:hover {
  color: #4f0e0e;
}

/* Form Fields */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.auth-form[hidden] {
  display: none;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.field-label {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--ink);
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.text-input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  font-size: 0.96rem;
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.text-input::placeholder {
  color: #73827c;
}

.text-input:hover {
  border-color: var(--border-strong);
}

.text-input:focus {
  outline: none;
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(29, 74, 61, 0.16);
}

.text-input--password {
  padding-right: 88px;
}

.text-input[aria-invalid="true"] {
  border-color: var(--error);
  background: #fffafa;
}

.text-input[aria-invalid="true"]:focus {
  box-shadow: 0 0 0 3px rgba(166, 38, 38, 0.16);
}

.toggle-pw {
  position: absolute;
  right: 6px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.toggle-pw:hover {
  background: #f0f3f1;
  color: var(--ink);
}

.toggle-pw[aria-pressed="true"] {
  background: #eaf1ee;
  color: var(--pine-deep);
}

.field-error {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 2px 0 0;
  font-size: 0.83rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--error);
}

.field-error[hidden] {
  display: none;
}

.field-error svg {
  flex-shrink: 0;
  margin-top: 2px;
}

/* Password Rules List */
.pw-rules {
  margin: 4px 0 0;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid #dfe5e2;
  background: #f5f7f5;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 14px;
}

.pw-rule {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  line-height: 1.3;
  color: var(--ink-soft);
}

.pw-rule-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #7c8c85;
}

.pw-rule .icon-check {
  display: none;
}

.pw-rule[data-met="true"] {
  color: var(--ok);
  font-weight: 500;
}

.pw-rule[data-met="true"] .pw-rule-icon {
  color: var(--ok);
}

.pw-rule[data-met="true"] .icon-circle {
  display: none;
}

.pw-rule[data-met="true"] .icon-check {
  display: block;
}

/* Options & Checkbox Rows */
.options-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.check-label {
  display: inline-flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--ink);
  cursor: pointer;
}

.check-input {
  width: 19px;
  height: 19px;
  margin: 1px 0 0;
  accent-color: var(--pine-accent);
  flex-shrink: 0;
  cursor: pointer;
}

.check-input[aria-invalid="true"] {
  outline: 2px solid var(--error);
  outline-offset: 1px;
}

.forgot-link {
  font-size: 0.88rem;
  font-weight: 500;
}

.inline-note {
  margin: -6px 0 0;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid #c9dcd3;
  background: var(--ok-bg);
  color: var(--ok);
  font-size: 0.84rem;
}

.inline-note[hidden] {
  display: none;
}

/* Buttons */
.submit-btn {
  width: 100%;
  height: 50px;
  padding: 0 20px;
  border: 1px solid var(--pine-accent);
  border-radius: var(--radius-md);
  background: var(--pine-accent);
  color: #ffffff;
  font-family: "Montserrat", system-ui, sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background-color 0.16s ease, transform 0.1s ease;
}

.submit-btn:hover {
  background: var(--pine-hover);
}

.submit-btn:active {
  transform: translateY(1px);
}

.secondary-btn {
  width: 100%;
  height: 46px;
  padding: 0 18px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--ink);
  font-family: "Montserrat", system-ui, sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.secondary-btn:hover {
  border-color: var(--pine-deep);
  background: #f4f6f5;
}

.switch-prompt {
  margin: 22px 0 0;
  padding-top: 18px;
  border-top: 1px solid #e3e7e4;
  text-align: center;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.switch-prompt a {
  font-weight: 500;
}

/* Success Panel */
.success-panel {
  padding: 32px 28px;
  border-radius: var(--radius-lg);
  border: 1px solid #cde0d6;
  background: var(--surface);
  box-shadow: 0 10px 28px rgba(23, 39, 35, 0.05);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
}

.success-panel[hidden] {
  display: none;
}

.success-art {
  width: 112px;
  height: 92px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--ok-bg);
  border: 1px solid #b9dac9;
  color: var(--ok);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.success-title {
  margin: 0;
  font-family: "Montserrat", system-ui, sans-serif;
  font-weight: 600;
  font-size: 1.55rem;
  line-height: 1.25;
  color: var(--ink);
}

.success-body {
  margin: 0;
  font-size: 0.94rem;
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 340px;
}

.success-actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 6px;
}

.resend-note {
  min-height: 20px;
  margin: 0;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--ok);
}

.success-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 46px;
  border-radius: var(--radius-md);
  background: var(--pine-accent);
  color: #ffffff;
  text-decoration: none;
  font-family: "Montserrat", system-ui, sans-serif;
  font-weight: 600;
  font-size: 0.92rem;
}

.success-link:hover {
  background: var(--pine-hover);
  color: #ffffff;
}

/* Responsive: Single Column, Form First */
@media (max-width: 900px) {
  .auth-shell {
    grid-template-columns: 1fr;
  }

  .form-panel {
    order: 1;
    justify-content: flex-start;
    padding: 20px 20px 28px;
  }

  .brand-panel {
    order: 2;
    padding: 32px 20px 36px;
    gap: 24px;
  }

  .mobile-brand-bar {
    display: flex;
  }
}

@media (max-width: 480px) {
  .form-panel {
    padding: 16px 18px 24px;
  }

  .mobile-brand-bar {
    padding-bottom: 12px;
    margin-bottom: 14px;
  }

  .form-header {
    margin-bottom: 14px;
  }

  .form-title {
    font-size: 1.48rem;
    margin-bottom: 4px;
  }

  .form-subtitle {
    font-size: 0.88rem;
  }

  .error-summary {
    margin-bottom: 14px;
    padding: 11px 13px;
  }

  .error-summary-head {
    font-size: 0.84rem;
    margin-bottom: 5px;
  }

  .error-summary-list {
    font-size: 0.8rem;
    gap: 2px;
  }

  .auth-form {
    gap: 13px;
  }

  .field {
    gap: 4px;
  }

  .field-label {
    font-size: 0.84rem;
  }

  .text-input {
    height: 44px;
    font-size: 0.93rem;
  }

  .pw-rules {
    padding: 9px 11px;
    gap: 6px 10px;
  }

  .pw-rule {
    font-size: 0.76rem;
    gap: 6px;
  }

  .field-error {
    font-size: 0.78rem;
  }

  .check-label {
    font-size: 0.83rem;
  }

  .submit-btn {
    height: 46px;
    font-size: 0.92rem;
  }

  .switch-prompt {
    margin-top: 16px;
    padding-top: 14px;
    font-size: 0.86rem;
  }

  .success-panel {
    padding: 26px 20px;
    gap: 14px;
  }

  .success-title {
    font-size: 1.38rem;
  }

  .success-body {
    font-size: 0.89rem;
  }

  .brand-purpose {
    font-size: 1.24rem;
  }
}
