:root {
  --ink: #102033;
  --muted: #68778a;
  --line: #dfe5ec;
  --surface: #fff;
  --canvas: #f4f6f9;
  --brand: #ff6b35;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; min-height: 100%; background: var(--canvas); }
body.public-shell { min-height: 100vh; margin: 0; background: var(--canvas); color: var(--ink); }

.public-header {
  display: flex;
  min-height: 72px;
  align-items: center;
  padding: 0 max(24px, calc((100vw - 1160px) / 2));
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.94);
}

.public-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.public-brand > span {
  display: grid; width: 38px; height: 38px; place-items: center; border-radius: 11px;
  background: var(--brand); color: #fff; font-size: 19px; font-weight: 900;
}
.public-brand strong { font-size: 19px; letter-spacing: -.02em; }
.public-main { display: grid; min-height: calc(100vh - 132px); place-items: center; padding: 40px 18px; }
.public-footer { padding: 20px; color: var(--muted); font-size: 12px; text-align: center; }

.auth-page { width: min(100%, 500px); }
.auth-card {
  padding: clamp(26px, 6vw, 44px); border: 1px solid var(--line); border-radius: 22px;
  background: var(--surface); box-shadow: 0 22px 65px rgba(20, 38, 58, .1);
}
.auth-mark {
  display: grid; width: 54px; height: 54px; margin-bottom: 22px; place-items: center;
  border-radius: 15px; background: var(--brand); color: #fff; font-size: 25px; font-weight: 900;
}
.auth-card .eyebrow { margin: 0 0 4px; color: var(--brand); font-size: 12px; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.auth-card h1 { margin: 0 0 9px; font-size: clamp(27px, 5vw, 38px); letter-spacing: -.045em; }
.auth-card > p:not(.eyebrow) { margin: 0 0 26px; color: var(--muted); }
.auth-card form { display: grid; gap: 7px; }
.auth-card label { margin-top: 9px; font-size: 13px; font-weight: 750; }
.auth-card input:not([type="checkbox"]) {
  width: 100%; min-height: 48px; padding: 10px 13px; border: 1px solid #c7d0db;
  border-radius: 10px; background: #fff; color: var(--ink); font: inherit; outline: none;
}
.auth-card textarea {
  width: 100%; min-height: 96px; padding: 11px 13px; resize: vertical; border: 1px solid #c7d0db;
  border-radius: 10px; background: #fff; color: var(--ink); font: inherit; outline: none;
}
.auth-card input:focus, .auth-card textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(255,107,53,.14); }
.auth-card button, .error-page .btn {
  min-height: 48px; margin-top: 17px; border: 0; border-radius: 10px;
  background: var(--brand); color: #fff; font-weight: 800;
}
.check-row { display: flex; align-items: center; gap: 9px; font-weight: 600 !important; }
.check-row input { width: 18px; height: 18px; accent-color: var(--brand); }
.auth-help-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.auth-help-row > a { color: var(--brand); font-size: 13px; font-weight: 800; text-decoration: none; }
.auth-security-note { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 10px; margin-top: 22px; padding: 13px; border-radius: 12px; color: #135e52; background: #e9f8f4; }
.auth-security-note > span { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 9px; color: #fff; background: #16836f; font-weight: 900; }
.auth-security-note p { margin: 0; font-size: 12px; }
.auth-security-note strong { display: block; margin-bottom: 2px; }
.auth-page--wide { width: min(100%, 660px); }
.auth-preview-field { display: grid; gap: 7px; margin-top: 20px; }
.auth-preview-field label { margin: 0; }
.auth-preview-field > div { min-height: 48px; padding: 12px 13px; border: 1px solid #c7d0db; border-radius: 10px; color: #8490a0; background: #f4f6f8; }
.auth-disabled-action { display: flex; min-height: 48px; align-items: center; justify-content: center; margin-top: 12px; border-radius: 10px; color: #fff; background: #a8b0ba; font-size: 13px; font-weight: 800; cursor: not-allowed; }
.auth-security-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 22px; }
.auth-security-grid article { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 9px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #f8fafb; }
.auth-security-grid article > span { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 9px; color: var(--brand); background: #fff0ea; font-size: 11px; font-weight: 900; }
.auth-security-grid strong, .auth-security-grid small { display: block; }
.auth-security-grid strong { font-size: 12px; }
.auth-security-grid small { margin-top: 2px; color: var(--muted); font-size: 10px; line-height: 1.35; }
.auth-generic-response { margin-top: 14px; padding: 14px; border-left: 3px solid var(--brand); border-radius: 0 10px 10px 0; background: #fff5f1; }
.auth-generic-response strong { font-size: 13px; }
.auth-generic-response p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.auth-back-link { display: inline-flex; margin-top: 20px; color: var(--brand); font-size: 13px; font-weight: 800; text-decoration: none; }
.auth-password-rule { margin: 8px 0 0 !important; color: var(--muted) !important; font-size: 11px; }
.field-validation-error, .validation-summary-errors, .form-error { color: #b42318; font-size: 12px; }
.validation-summary-valid, .field-validation-valid { display: none; }

.error-page { width: min(100%, 650px); padding: 42px; border: 1px solid var(--line); border-radius: 22px; background: #fff; text-align: center; }
.error-page__code { margin: 0; color: var(--brand); font-size: 72px; font-weight: 900; line-height: 1; }
.error-page h1 { margin: 12px 0 8px; }
.error-page > p:not(.error-page__code) { color: var(--muted); }
.error-page .btn { display: inline-flex; align-items: center; padding: 0 18px; text-decoration: none; }
.error-page small { display: block; margin-top: 20px; color: var(--muted); }

/* Premium authentication shell */
.public-skip-link {
  position: fixed; top: 10px; left: 10px; z-index: 100; padding: 10px 14px; border-radius: 8px;
  color: #fff; background: #091f31; text-decoration: none; transform: translateY(-160%); transition: transform 160ms;
}
.public-skip-link:focus { transform: translateY(0); }
body.public-shell {
  --auth-navy: #091f31; --auth-navy-soft: #143b55; --auth-orange: #ef762f; --auth-cream: #fff7ee;
  display: grid; min-height: 100vh; grid-template-rows: auto 1fr auto;
  background: radial-gradient(circle at 12% 18%, rgba(239,118,47,.07), transparent 28%), #f7f8fa;
}
.public-header {
  min-height: 80px; justify-content: space-between; gap: 22px; padding: 0 max(24px, calc((100vw - 1220px) / 2));
  border-bottom: 1px solid rgba(9,31,49,.09); background: rgba(255,255,255,.96); box-shadow: 0 10px 32px rgba(9,31,49,.045);
  backdrop-filter: blur(16px);
}
.public-brand { gap: 12px; color: var(--auth-navy); }
.public-brand > span:first-child {
  width: 42px; height: 42px; border-radius: 12px; background: linear-gradient(145deg, #ff994f, var(--auth-orange));
  box-shadow: 0 9px 22px rgba(239,118,47,.22); font-size: 15px;
}
.public-brand > span:last-child { display: grid; gap: 1px; }
.public-brand > span:last-child { width: auto; height: auto; place-items: initial; border-radius: 0; color: inherit; background: transparent; box-shadow: none; font-size: inherit; font-weight: inherit; }
.public-brand strong { font-size: 18px; }
.public-brand small { color: #778493; font-size: 10px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.public-header__return {
  display: inline-flex; min-height: 42px; align-items: center; gap: 8px; padding: 8px 14px; border: 1px solid #dfe5ec;
  border-radius: 10px; color: var(--auth-navy); background: #fff; font-size: 12px; font-weight: 800; text-decoration: none;
}
.public-header__return:hover { border-color: rgba(239,118,47,.35); color: #a84515; box-shadow: 0 8px 20px rgba(9,31,49,.07); }
.public-main { display: block; min-height: 0; padding: 42px max(18px, calc((100vw - 1220px) / 2)) 54px; }
.public-footer {
  display: flex; min-height: 62px; align-items: center; justify-content: space-between; gap: 20px;
  padding: 18px max(24px, calc((100vw - 1220px) / 2)); border-top: 1px solid rgba(9,31,49,.08); color: #7a8794; background: #fff;
}

.auth-page--login {
  display: grid; width: min(100%, 1220px); min-height: min(700px, calc(100vh - 238px)); grid-template-columns: minmax(0, 1.08fr) minmax(420px, .92fr);
  margin: 0 auto; overflow: hidden; border: 1px solid rgba(9,31,49,.08); border-radius: 24px; background: #fff;
  box-shadow: 0 32px 90px rgba(9,31,49,.14);
}
.auth-story {
  position: relative; display: flex; min-width: 0; flex-direction: column; justify-content: space-between; overflow: hidden;
  padding: clamp(34px, 5vw, 64px); color: #fff;
  background: radial-gradient(circle at 82% 12%, rgba(239,118,47,.34), transparent 24%), radial-gradient(circle at 5% 94%, rgba(255,255,255,.08), transparent 34%), linear-gradient(145deg, #071b2b, #0d3048 74%, #123f59);
  isolation: isolate;
}
.auth-story::before, .auth-story::after { position: absolute; z-index: -1; border: 1px solid rgba(255,255,255,.09); border-radius: 50%; content: ""; }
.auth-story::before { top: -170px; right: -120px; width: 430px; height: 430px; box-shadow: 0 0 0 54px rgba(255,255,255,.018), 0 0 0 108px rgba(255,255,255,.012); }
.auth-story::after { right: 14%; bottom: -190px; width: 360px; height: 360px; border-color: rgba(239,118,47,.18); }
.auth-story__glow { position: absolute; right: -55px; bottom: 18%; width: 180px; height: 180px; border-radius: 44px; background: linear-gradient(145deg, rgba(239,118,47,.8), rgba(255,170,92,.35)); filter: blur(.2px); transform: rotate(18deg); opacity: .26; }
.auth-story__top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.auth-story__badge { padding: 8px 11px; border: 1px solid rgba(255,255,255,.17); border-radius: 999px; color: #ffd6bd; background: rgba(255,255,255,.06); font-size: 10px; font-weight: 850; letter-spacing: .09em; text-transform: uppercase; }
.auth-story__status { display: inline-flex; align-items: center; gap: 7px; color: rgba(255,255,255,.68); font-size: 11px; font-weight: 700; }
.auth-story__status i { width: 7px; height: 7px; border-radius: 50%; background: #56d6ae; box-shadow: 0 0 0 4px rgba(86,214,174,.11); }
.auth-story__content { max-width: 600px; margin: auto 0; padding: 52px 0; }
.auth-story__eyebrow { margin: 0 0 14px; color: #ffad78; font-size: 11px; font-weight: 900; letter-spacing: .11em; text-transform: uppercase; }
.auth-story h1 { max-width: 650px; margin: 0; font-size: clamp(42px, 5vw, 68px); letter-spacing: -.06em; line-height: .98; }
.auth-story__content > p:not(.auth-story__eyebrow) { max-width: 570px; margin: 22px 0 0; color: rgba(255,255,255,.7); font-size: 16px; line-height: 1.65; }
.auth-story__benefits { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 0; margin: 38px 0 0; padding: 0; border-top: 1px solid rgba(255,255,255,.12); list-style: none; }
.auth-story__benefits li { display: grid; min-width: 0; gap: 2px; padding: 19px 16px 0 0; }
.auth-story__benefits li + li { padding-left: 16px; border-left: 1px solid rgba(255,255,255,.12); }
.auth-story__benefits span { color: #ff9c60; font-size: 10px; font-weight: 900; }
.auth-story__benefits strong { font-size: 13px; }
.auth-story__benefits small { color: rgba(255,255,255,.5); font-size: 10px; line-height: 1.45; }
.auth-story__footer { margin: 0; color: rgba(255,255,255,.45); font-size: 10px; }

.auth-page--login .auth-card {
  display: flex; min-width: 0; flex-direction: column; justify-content: center; padding: clamp(36px, 6vw, 72px);
  border: 0; border-radius: 0; box-shadow: none;
}
.auth-card__head { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.auth-card__head .auth-mark { width: 52px; height: 52px; margin: 0; border-radius: 13px; background: var(--auth-navy); box-shadow: none; font-size: 15px; }
.auth-card__head .eyebrow { margin: 0 0 3px; color: var(--auth-orange); }
.auth-card__head h2 { margin: 0; color: var(--auth-navy); font-size: clamp(26px, 3.5vw, 36px); letter-spacing: -.045em; }
.auth-card__lead { margin: 0 0 24px !important; color: #718091 !important; font-size: 13px; }
.auth-page--login .auth-card form { gap: 8px; }
.auth-page--login .auth-card label { margin-top: 10px; color: #26394c; font-size: 12px; }
.auth-page--login .auth-card input:not([type="checkbox"]) {
  min-height: 52px; padding: 11px 14px; border-color: #d6dde5; border-radius: 11px; background: #fbfcfd;
}
.auth-page--login .auth-card input:not([type="checkbox"]):hover { border-color: #bdc8d4; background: #fff; }
.auth-page--login .auth-card input:focus { border-color: var(--auth-orange); background: #fff; box-shadow: 0 0 0 4px rgba(239,118,47,.12); }
.auth-page--login .auth-help-row { margin-top: 4px; }
.auth-page--login .auth-help-row > a { color: #b64c17; }
.auth-page--login .auth-card button {
  min-height: 52px; margin-top: 18px; border-radius: 11px; background: linear-gradient(135deg, #fb8845, var(--auth-orange));
  box-shadow: 0 13px 26px rgba(239,118,47,.22); transition: transform 160ms, box-shadow 160ms;
}
.auth-page--login .auth-card button:hover { box-shadow: 0 17px 32px rgba(239,118,47,.28); transform: translateY(-1px); }
.auth-page--login .auth-security-note { margin-top: 24px; border: 1px solid #dceee9; border-radius: 12px; background: #f2faf7; }
.auth-page--login .auth-security-note > span { background: #0d7765; }
.auth-page--login .auth-security-note p { color: #37675d; }
.auth-page--wide { margin: 12px auto; }

@media (max-width: 600px) {
  .public-header { min-height: 68px; padding-inline: 14px; }
  .public-brand > span:first-child { width: 38px; height: 38px; }
  .public-brand small, .public-header__return span { display: none; }
  .public-header__return { min-height: 38px; padding: 7px 10px; }
  .public-main { padding: 18px 12px 28px; }
  .public-footer { align-items: flex-start; flex-direction: column; gap: 3px; padding: 18px 16px; }
  .auth-page--login { min-height: 0; grid-template-columns: 1fr; border-radius: 19px; }
  .auth-story { min-height: 230px; padding: 26px 22px; }
  .auth-story__top { align-items: flex-start; flex-direction: column; gap: 10px; }
  .auth-story__content { padding: 34px 0 14px; }
  .auth-story h1 { font-size: clamp(34px, 11vw, 46px); }
  .auth-story__content > p:not(.auth-story__eyebrow), .auth-story__benefits, .auth-story__footer { display: none; }
  .auth-page--login .auth-card { padding: 30px 22px; }
  .auth-card__head { align-items: flex-start; }
  .auth-card__head .auth-mark { width: 46px; height: 46px; }
  .auth-card, .error-page { padding: 25px 20px; border-radius: 17px; }
  .auth-help-row { align-items: flex-start; flex-direction: column; }
  .auth-security-grid { grid-template-columns: 1fr; }
}

@media (min-width: 601px) and (max-width: 960px) {
  .public-main { padding-inline: 22px; }
  .auth-page--login { min-height: 0; grid-template-columns: .92fr 1.08fr; }
  .auth-story { padding: 38px 30px; }
  .auth-story h1 { font-size: 46px; }
  .auth-story__benefits { grid-template-columns: 1fr; }
  .auth-story__benefits li { padding: 12px 0; }
  .auth-story__benefits li + li { padding-left: 0; border-top: 1px solid rgba(255,255,255,.1); border-left: 0; }
  .auth-page--login .auth-card { padding: 42px 34px; }
}
