/* Betroy account surfaces. All rules stay inside .auth-section.
   Uses the existing DM Serif Display / DM Sans families and site palette.
   Status hooks: .is-error / .error / [data-state="error"], and success equivalents.
   The hidden attribute always takes priority over layout or status styles. */

.auth-section {
  --auth-navy: #173449;
  --auth-teal: #008e9b;
  --auth-deep-teal: #006e79;
  --auth-line: #d7e5e8;
  --auth-muted: #536c79;
  padding-block: clamp(34px, 6vw, 80px);
  background: linear-gradient(145deg, #f9fcfc 0%, #eff7f8 58%, #ffffff 100%);
}

.auth-section [hidden] { display: none !important; }

.auth-section .auth-layout {
  display: grid;
  grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr);
  align-items: stretch;
  gap: 0;
  max-width: 1100px;
  border: 1px solid var(--auth-line);
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 24px 70px #1734490d, 0 3px 12px #17344905;
}

.auth-section .auth-layout > * { min-width: 0; }

.auth-section .auth-story {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: clamp(32px, 4vw, 48px);
  border-radius: 23px 0 0 23px;
  background: var(--auth-navy);
  color: #e0edf0;
}

.auth-section .auth-story::before {
  content: "";
  position: absolute;
  z-index: -1;
  width: 340px;
  height: 340px;
  top: -240px;
  right: -140px;
  border: 1px solid #79d6dc24;
  border-radius: 50%;
  box-shadow: 0 0 0 45px #79d6dc07, 0 0 0 90px #79d6dc05;
  pointer-events: none;
}

.auth-section .auth-kicker {
  align-self: flex-start;
  display: inline-block;
  margin: 0 0 24px;
  color: #9ce4e7;
  font: 700 .875rem/1.5 var(--sans, "DM Sans", sans-serif);
  letter-spacing: .1em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.auth-section .auth-story h1 {
  max-width: 440px;
  margin: 0 0 24px;
  color: #fff;
  font-family: var(--serif, "DM Serif Display", Georgia, serif);
  font-size: 3rem;
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -.035em;
  overflow-wrap: break-word;
}

.auth-section .auth-story > p:not(.auth-kicker) {
  max-width: 430px;
  margin: 0 0 28px;
  color: #d5e6eb;
  font-size: 1rem;
  line-height: 1.75;
}

.auth-section .auth-benefits {
  display: grid;
  gap: 15px;
  margin: 0 0 28px;
  padding: 0;
  list-style: none;
}

.auth-section .auth-benefits li {
  position: relative;
  margin: 0;
  padding: 0 0 0 27px;
  color: #ecf5f6;
  font-size: 1rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}

.auth-section .auth-benefits li::before {
  content: "";
  position: absolute;
  top: 6px;
  left: 3px;
  width: 7px;
  height: 12px;
  border: solid #8bdce1;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.auth-section .auth-story > img {
  display: block;
  width: min(160px, 100%);
  height: 130px;
  object-fit: contain;
  align-self: flex-start;
  margin-top: auto;
  padding: 16px;
  border: 1px solid #ffffff1f;
  border-radius: 18px;
  background: #eff7f8;
}

.auth-section .auth-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: clamp(32px, 4.5vw, 52px);
  border-radius: 0 23px 23px 0;
  background: #fff;
}

.auth-section .auth-card-heading { margin-bottom: 28px; }
.auth-section .auth-card-heading h2 {
  margin: 0 0 12px;
  color: var(--auth-navy);
  font-size: 2.125rem;
  line-height: 1.2;
  letter-spacing: -.035em;
  overflow-wrap: break-word;
}
.auth-section .auth-card-heading p {
  margin: 0;
  color: var(--auth-muted);
  font-size: 1rem;
  line-height: 1.7;
}

.auth-section .auth-form { display: grid; gap: 21px; margin: 0; }
.auth-section .auth-form .form-field { min-width: 0; margin: 0; }
.auth-section .auth-form .form-field label {
  display: block;
  margin: 0 0 8px;
  color: var(--auth-navy);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.5;
}
.auth-section .auth-form .form-field label span {
  font-size: .875rem;
  font-weight: 400;
  color: var(--auth-muted);
}
.auth-section .auth-form .form-field input {
  display: block;
  min-width: 0;
  width: 100%;
  min-height: 54px;
  padding: 13px 15px;
  border: 1px solid #b7cbd2;
  border-radius: 9px;
  background: #fbfdfd;
  color: var(--auth-navy);
  font-size: 1rem;
  line-height: 1.5;
  transition: border-color .15s, box-shadow .15s;
}
.auth-section .auth-form input::placeholder { color: #6a7f8b; opacity: 1; }
.auth-section .auth-form .form-field input:focus {
  border-color: var(--auth-teal);
  outline: 2px solid #008e9b30;
  outline-offset: 2px;
  box-shadow: 0 0 0 3px #008e9b08;
}
.auth-section .auth-form input[aria-invalid="true"] {
  border-color: #b6404a;
  background: #fffafb;
}
.auth-section .auth-form input:disabled { opacity: .65; cursor: not-allowed; }

.auth-section .password-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  min-width: 0;
  border: 1px solid #b7cbd2;
  border-radius: 9px;
  background: #fbfdfd;
}
.auth-section .auth-form .password-field input {
  border: 0;
  border-radius: 8px 0 0 8px;
  background: transparent;
}
.auth-section .password-field:focus-within {
  border-color: var(--auth-teal);
  outline: 2px solid #008e9b30;
  outline-offset: 2px;
}
.auth-section .auth-form .password-field input:focus { outline: 0; box-shadow: none; }
.auth-section .password-field:has(input[aria-invalid="true"]) { border-color: #b6404a; }
.auth-section .password-toggle {
  align-self: stretch;
  min-width: 68px;
  min-height: 48px;
  margin: 4px 0;
  padding: 0 13px;
  border: 0;
  border-left: 1px solid #deeaed;
  border-radius: 0 8px 8px 0;
  background: transparent;
  color: var(--auth-deep-teal);
  font-size: .875rem;
  font-weight: 600;
  line-height: 1.4;
  cursor: pointer;
}
.auth-section .password-toggle:hover { background: #eaf5f5; color: var(--auth-navy); }
.auth-section .password-toggle:focus-visible { outline: 2px solid var(--auth-deep-teal); outline-offset: -4px; }

.auth-section .field-note,
.auth-section .field-error {
  margin: 7px 0 0;
  font-size: .875rem;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.auth-section .field-note { color: var(--auth-muted); }
.auth-section .field-error { color: #a22e3b; }
.auth-section .field-error:empty,
.auth-section .auth-status:empty { display: none; }

.auth-section .auth-status {
  margin: 0;
  padding: 13px 15px;
  border: 1px solid #c9e4e7;
  border-radius: 9px;
  background: #f0f8f9;
  color: #285460;
  font-size: .9375rem;
  line-height: 1.65;
  overflow-wrap: anywhere;
}
.auth-section .auth-status:is(.is-error, .error, [data-state="error"]) {
  border-color: #e7bdc3;
  background: #fff4f5;
  color: #922b38;
}
.auth-section .auth-status:is(.is-success, .success, [data-state="success"]) {
  border-color: #b8d9c9;
  background: #f0f8f3;
  color: #285a43;
}
.auth-section .button.auth-submit {
  width: 100%;
  min-height: 54px;
  margin-top: 3px;
  border-radius: 9px;
  font-size: 1rem;
  font-weight: 600;
}
.auth-section .auth-submit:hover { transform: none; }
.auth-section .auth-submit:disabled { opacity: .62; cursor: wait; box-shadow: none; transform: none; }
.auth-section .auth-switch {
  margin: 24px 0 0;
  padding-top: 22px;
  border-top: 1px solid #e4ecef;
  color: var(--auth-muted);
  font-size: 1rem;
  line-height: 1.7;
  text-align: center;
}
.auth-section .auth-switch a { color: var(--auth-deep-teal); font-weight: 600; }
.auth-section .auth-switch a:hover { color: var(--auth-navy); }
.auth-section .auth-story .auth-back { display:block; margin-top:14px; color:#a6e6e9; font-size:.875rem; text-underline-offset:4px; }
.auth-section .auth-story .auth-back:hover { color:#fff; }

/* Loading and account states share the same card, without simulating user data. */
.auth-section .auth-account { min-width: 0; }
.auth-section .auth-loading,
.auth-section .auth-pending {
  margin: 0;
  padding: 18px;
  border: 1px solid var(--auth-line);
  border-radius: 12px;
  background: #f4f9fa;
  color: var(--auth-muted);
  font-size: 1rem;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
.auth-section .auth-pending p:last-child { margin-bottom: 0; }
.auth-section .auth-profile { display: grid; gap: 24px; }
.auth-section .auth-profile > p { margin: 0; font-size: 1rem; }
.auth-section .auth-details {
  display: grid;
  grid-template-columns: minmax(100px, .42fr) minmax(0, 1fr);
  margin: 0;
  border: 1px solid var(--auth-line);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}
.auth-section .auth-details dt,
.auth-section .auth-details dd {
  min-width: 0;
  margin: 0;
  padding: 15px 16px;
  border-bottom: 1px solid #e3ecef;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.auth-section .auth-details dt { background: #f5f9fa; color: var(--auth-muted); font-size: .875rem; font-weight: 600; }
.auth-section .auth-details dd { color: var(--auth-navy); font-size: 1rem; }
.auth-section .auth-details dt:last-of-type,
.auth-section .auth-details dd:last-of-type { border-bottom: 0; }
.auth-section .auth-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.auth-section .auth-actions form { margin: 0; }
.auth-section .auth-actions .button,
.auth-section .auth-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 19px;
  border: 1px solid var(--auth-navy);
  border-radius: 8px;
  background: var(--auth-navy);
  color: #fff;
  font: 600 1rem/1.4 var(--sans, "DM Sans", sans-serif);
  text-decoration: none;
}
.auth-section .auth-actions :is(.button, button):hover { background: #244b62; color: #fff; transform: none; }
.auth-section .auth-actions .button-secondary { background: #fff; color: var(--auth-navy); border-color: #bacdd4; }
.auth-section .auth-actions .button-secondary:hover { background: #eff7f8; color: var(--auth-navy); }
.auth-section .auth-actions button:disabled { opacity: .6; cursor: wait; }

@media (max-width: 900px) {
  .auth-section .auth-layout { width: min(720px, calc(100% - 48px)); grid-template-columns: minmax(0, 1fr); }
  .auth-section .auth-story { border-radius: 23px 23px 0 0; padding: 36px 40px; }
  .auth-section .auth-story h1 { max-width: 560px; font-size: 2.75rem; }
  .auth-section .auth-story > p:not(.auth-kicker) { max-width: 590px; margin-bottom: 22px; }
  .auth-section .auth-benefits { gap: 11px; margin-bottom: 0; }
  .auth-section .auth-story > img { width: 120px; height: 100px; margin-top: 24px; padding: 12px; }
  .auth-section .auth-card { border-radius: 0 0 23px 23px; padding: 38px 40px 40px; }
}

@media (max-width: 520px) {
  .auth-section { padding-block: 24px 40px; }
  .auth-section .auth-layout { width: calc(100% - 32px); border-radius: 18px; box-shadow: 0 12px 35px #17344908; }
  .auth-section .auth-story { padding: 24px; border-radius: 17px 17px 0 0; }
  .auth-section .auth-kicker { margin-bottom: 12px; letter-spacing: .08em; }
  .auth-section .auth-story h1 { margin-bottom: 14px; font-size: 2rem; line-height: 1.14; }
  .auth-section .auth-story > p:not(.auth-kicker) { line-height: 1.6; margin-bottom:0; }
  .auth-section .auth-story .auth-benefits,
  .auth-section .auth-story > img { display:none; }
  .auth-section .auth-benefits li { padding-left: 25px; }
  .auth-section .auth-story > img { width: 104px; height: 86px; margin-top: 22px; }
  .auth-section .auth-card { padding: 28px 22px 30px; border-radius: 0 0 17px 17px; }
  .auth-section .auth-card-heading { margin-bottom: 25px; }
  .auth-section .auth-card-heading h2 { font-size: 1.875rem; }
  .auth-section .auth-form { gap: 20px; }
  .auth-section .auth-switch { padding-top: 20px; text-align: left; }
  .auth-section .auth-details { grid-template-columns: minmax(0, 1fr); }
  .auth-section .auth-details dt { padding: 13px 15px 3px; border: 0; background: #fff; }
  .auth-section .auth-details dd { padding: 0 15px 14px; }
  .auth-section .auth-actions { align-items: stretch; flex-direction: column; }
  .auth-section .auth-actions form,
  .auth-section .auth-actions .button,
  .auth-section .auth-actions button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-section .auth-form input,
  .auth-section .button { transition: none; }
}
