:root {
  --ink: #101820;
  --copy: #526474;
  --line: #d6e3ed;
  --line-strong: #bfd3e2;
  --blue: #188fdf;
  --blue-deep: #096da9;
  --green: #16865b;
  --display: Georgia, "Times New Roman", serif;
  --ui: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { min-width: 320px; background: #f4f9fd; }

body {
  min-height: 100dvh;
  margin: 0;
  background:
    radial-gradient(circle at 78% 5%, rgba(133, 204, 246, 0.23), transparent 30%),
    linear-gradient(135deg, #f8fcff 0%, #eef7fd 100%);
  color: var(--ink);
  font-family: var(--ui);
}

a, button { color: inherit; }
button { font: inherit; cursor: pointer; }

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  transform: translateY(-160%);
  padding: 10px 14px;
  border-radius: 6px;
  background: var(--ink);
  color: white;
}

.skip-link:focus { transform: translateY(0); }

.auth-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 78px;
  padding: 0 clamp(20px, 4vw, 64px);
  border-bottom: 1px solid rgba(191, 211, 226, 0.75);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(18px) saturate(1.2);
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-size: 18px;
  font-weight: 760;
  text-decoration: none;
}

.auth-brand img {
  width: 38px;
  height: 38px;
  border-radius: 7px;
  box-shadow: 0 8px 20px rgba(17, 24, 32, 0.16);
}

.back-link {
  color: #516677;
  font-size: 12px;
  font-weight: 650;
  text-decoration: none;
}

.back-link:hover { color: var(--ink); }

.auth-layout {
  display: grid;
  grid-template-columns: minmax(440px, 1.08fr) minmax(440px, 0.92fr);
  align-items: center;
  width: min(1280px, calc(100% - 64px));
  min-height: calc(100dvh - 78px);
  margin: 0 auto;
  padding: 56px 0;
  gap: clamp(54px, 8vw, 130px);
}

.auth-story { display: grid; gap: 58px; }

.story-index,
.auth-eyebrow {
  display: block;
  color: #708394;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-story h1 {
  max-width: 720px;
  margin: 20px 0 0;
  font-family: var(--display);
  font-size: clamp(46px, 5vw, 76px);
  font-weight: 400;
  line-height: 1.04;
  letter-spacing: -0.025em;
}

.auth-story > div > p {
  max-width: 620px;
  margin: 25px 0 0;
  color: var(--copy);
  font-family: var(--display);
  font-size: 18px;
  line-height: 1.7;
}

.account-benefits {
  display: grid;
  max-width: 650px;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line-strong);
  list-style: none;
}

.account-benefits li {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  padding: 17px 0;
  gap: 14px;
  border-bottom: 1px solid var(--line);
}

.account-benefits li > span {
  color: #8b9aa7;
  font-family: var(--display);
  font-size: 12px;
}

.account-benefits strong,
.account-benefits p { display: block; }
.account-benefits strong { font-size: 12px; }
.account-benefits p { margin: 5px 0 0; color: #6e8090; font-size: 11px; line-height: 1.45; }

.auth-card {
  position: relative;
  overflow: hidden;
  padding: clamp(28px, 4vw, 48px);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 28px 75px rgba(61, 112, 151, 0.15);
}

.auth-card-mark {
  display: grid;
  width: 46px;
  height: 46px;
  margin-bottom: 27px;
  place-items: center;
  border-radius: 9px;
  background: var(--ink);
}

.auth-card-mark img { width: 32px; height: 32px; }

.auth-mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 35px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f3f8fb;
}

.auth-mode-switch a {
  min-height: 39px;
  padding: 11px 8px;
  border-radius: 5px;
  color: #748493;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

.auth-mode-switch a.active {
  background: white;
  color: var(--ink);
  box-shadow: 0 3px 12px rgba(54, 91, 121, 0.1);
}

.auth-card h2 {
  margin: 8px 0 0;
  font-family: var(--display);
  font-size: clamp(31px, 3vw, 43px);
  font-weight: 400;
  line-height: 1.12;
}

.auth-card #authEntry > p:not(.provider-status):not(.auth-terms),
.signed-in-panel > p {
  margin: 13px 0 0;
  color: var(--copy);
  font-size: 12px;
  line-height: 1.55;
}

.auth-notice {
  margin-top: 20px;
  padding: 13px 14px;
  border: 1px solid #d5e2eb;
  border-radius: 7px;
  background: #f6fafc;
}

.auth-notice[hidden] { display: none; }
.auth-notice strong { display: block; font-size: 11px; }
.auth-notice p { margin: 5px 0 0; color: #607483; font-size: 10px; line-height: 1.5; }
.auth-notice[data-tone="error"] { border-color: #ead1c3; background: #fff8f4; }
.auth-notice[data-tone="error"] strong { color: #9a4b2b; }
.auth-notice[data-tone="success"] { border-color: #bfe1d3; background: #f4fbf8; }
.auth-notice[data-tone="success"] strong { color: var(--green); }

.google-button,
.workspace-button {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 20px;
  align-items: center;
  min-height: 56px;
  margin-top: 29px;
  padding: 0 17px;
  gap: 12px;
  border: 1px solid #adbfcc;
  border-radius: 7px;
  background: white;
  color: #20303d;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.admin-dashboard-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  margin-top: 10px;
  padding: 0 17px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #f6fafc;
  color: #20303d;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.admin-dashboard-button[hidden] { display: none; }
.admin-dashboard-button:hover,
.admin-dashboard-button:focus-visible { border-color: #6aaed8; background: white; }

.google-button:hover,
.google-button:focus-visible {
  border-color: #6aaed8;
  box-shadow: 0 9px 24px rgba(49, 121, 168, 0.12);
  transform: translateY(-1px);
}

.google-button[aria-disabled="true"] {
  cursor: not-allowed;
  filter: grayscale(1);
  opacity: 0.55;
  transform: none;
}

.google-button svg { width: 22px; height: 22px; }
.google-button i { color: #718392; font-size: 18px; font-style: normal; }

.provider-status {
  display: flex;
  align-items: center;
  margin: 13px 0 0;
  gap: 8px;
  color: #728391;
  font-size: 10px;
}

.provider-status span {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #9da9b3;
}

.provider-status.ready { color: var(--green); }
.provider-status.ready span { background: var(--green); box-shadow: 0 0 0 4px rgba(22, 134, 91, 0.09); }
.provider-status.unavailable { color: #9b6434; }
.provider-status.unavailable span { background: #d99142; }

.auth-divider {
  display: flex;
  align-items: center;
  margin: 24px 0 20px;
  gap: 10px;
  color: #8795a1;
  font-size: 9px;
  letter-spacing: 0.02em;
}

.auth-divider::before,
.auth-divider::after { content: ""; height: 1px; flex: 1; background: var(--line); }

.email-auth {
  display: grid;
  gap: 14px;
}

.auth-field {
  display: grid;
  gap: 6px;
}

.auth-field[hidden],
.field-error[hidden],
.email-auth-status[hidden] { display: none; }

.auth-field label {
  color: #526879;
  font-size: 10px;
  font-weight: 720;
}

.auth-field input {
  width: 100%;
  height: 46px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: white;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.auth-field input::placeholder { color: #9ba7b1; }
.auth-field input:focus {
  border-color: var(--blue);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(24, 143, 223, 0.12);
}
.auth-field input[aria-invalid="true"] {
  border-color: #c87352;
  box-shadow: 0 0 0 3px rgba(200, 115, 82, 0.1);
}
.auth-field input:disabled { cursor: not-allowed; background: #f5f7f8; color: #7d8b96; }

.password-control { position: relative; }
.password-control input { padding-right: 65px; }
.password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  min-width: 48px;
  min-height: 32px;
  padding: 0 7px;
  transform: translateY(-50%);
  border: 0;
  border-radius: 5px;
  background: #f3f7fa;
  color: #536b7d;
  font-size: 9px;
  font-weight: 750;
}
.password-toggle:hover { background: #eaf2f7; color: var(--ink); }
.password-toggle:focus-visible { outline: 2px solid rgba(24, 143, 223, 0.35); outline-offset: 1px; }
.password-toggle:disabled { cursor: not-allowed; opacity: 0.55; }

.field-help,
.field-error {
  font-size: 9px;
  line-height: 1.45;
}
.field-help { color: #82919d; }
.field-error { color: #9a4b2b; }

.email-auth-submit {
  display: flex;
  min-height: 49px;
  align-items: center;
  justify-content: space-between;
  margin-top: 2px;
  padding: 0 16px;
  border: 0;
  border-radius: 6px;
  background: var(--ink);
  color: white;
  font-size: 12px;
  font-weight: 750;
  transition: background 150ms ease, transform 150ms ease, opacity 150ms ease;
}
.email-auth-submit:hover:not(:disabled) { background: #1f2c36; transform: translateY(-1px); }
.email-auth-submit:focus-visible { outline: 3px solid rgba(24, 143, 223, 0.24); outline-offset: 2px; }
.email-auth-submit:disabled { cursor: not-allowed; opacity: 0.62; transform: none; }
.email-auth[aria-busy="true"] .email-auth-submit:disabled { cursor: wait; }

.email-auth-status {
  margin: -1px 0 0;
  padding: 10px 11px;
  border: 1px solid #d5e2eb;
  border-radius: 6px;
  background: #f6fafc;
  color: #607483;
  font-size: 10px;
  line-height: 1.45;
}
.email-auth-status[data-tone="error"] { border-color: #ead1c3; background: #fff8f4; color: #9a4b2b; }
.email-auth-status[data-tone="success"] { border-color: #bfe1d3; background: #f4fbf8; color: var(--green); }
.email-auth-status[data-tone="pending"] { color: #536f84; }
.email-auth-status[data-tone="verification"] { border-color: #cbdde9; background: #f5fafe; color: #486b83; }

#authMethods[hidden],
.verification-success[hidden],
.verification-action[hidden],
.verification-action-status[hidden] { display: none; }

.verification-success,
.verification-action {
  display: grid;
  justify-items: start;
  margin-top: 27px;
}

.verification-success:focus,
.verification-action:focus { outline: 0; }

.verification-icon {
  display: grid;
  width: 48px;
  height: 48px;
  margin-bottom: 22px;
  place-items: center;
  border: 1px solid #bfe1d3;
  border-radius: 50%;
  background: #f4fbf8;
  color: var(--green);
}

.verification-icon svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.verification-success > span,
.verification-action > span {
  color: #708394;
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.verification-success h3,
.verification-action h3 {
  margin: 8px 0 0;
  font-family: var(--display);
  font-size: clamp(27px, 3vw, 36px);
  font-weight: 400;
  line-height: 1.15;
}

.verification-success p,
.verification-action p {
  margin: 13px 0 0;
  color: var(--copy);
  font-size: 11px;
  line-height: 1.55;
}

.verification-success > strong {
  max-width: 100%;
  margin-top: 14px;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 12px;
}

.verification-success > small {
  margin-top: 12px;
  color: #7e8d99;
  font-size: 9px;
  line-height: 1.5;
}

.verification-success > a,
.verification-action > button {
  display: flex;
  width: 100%;
  min-height: 49px;
  align-items: center;
  justify-content: space-between;
  margin-top: 23px;
  padding: 0 16px;
  border: 0;
  border-radius: 6px;
  background: var(--ink);
  color: white;
  font-size: 12px;
  font-weight: 750;
  text-decoration: none;
}

.verification-success > a:hover,
.verification-action > button:hover:not(:disabled) { background: #1f2c36; }
.verification-success > a:focus-visible,
.verification-action > button:focus-visible { outline: 3px solid rgba(24, 143, 223, 0.24); outline-offset: 2px; }
.verification-action > button:disabled { cursor: wait; opacity: 0.62; }

.verification-action-status {
  width: 100%;
  padding: 10px 11px;
  border: 1px solid #d5e2eb;
  border-radius: 6px;
  background: #f6fafc;
}
.verification-action-status[data-tone="error"] { border-color: #ead1c3; background: #fff8f4; color: #9a4b2b; }
.verification-action-status[data-tone="success"] { border-color: #bfe1d3; background: #f4fbf8; color: var(--green); }

.auth-terms {
  margin: 28px 0 0;
  color: #8795a1;
  font-size: 9px;
  line-height: 1.55;
  text-align: center;
}

.auth-terms a { color: #536a7b; text-underline-offset: 2px; }

.auth-card-footer {
  display: flex;
  justify-content: space-between;
  margin: 35px calc(clamp(28px, 4vw, 48px) * -1) calc(clamp(28px, 4vw, 48px) * -1);
  padding: 15px clamp(28px, 4vw, 48px);
  border-top: 1px solid var(--line);
  background: #f6fafc;
  color: #7e8d99;
  font-size: 9px;
}

.signed-in-panel[hidden],
#authEntry[hidden] { display: none; }

.workspace-button {
  grid-template-columns: 1fr auto;
  border-color: var(--ink);
  background: var(--ink);
  color: white;
}

.signed-in-panel button {
  width: 100%;
  margin-top: 10px;
  padding: 10px;
  border: 0;
  background: transparent;
  color: #6d7d8a;
  font-size: 10px;
}

@media (max-width: 1040px) {
  .auth-layout {
    grid-template-columns: 1fr;
    width: min(680px, calc(100% - 40px));
    gap: 44px;
  }

  .auth-story { gap: 35px; }
  .auth-story h1 { font-size: clamp(42px, 9vw, 66px); }
}

@media (max-width: 560px) {
  .auth-nav { min-height: 66px; padding: 0 16px; }
  .auth-brand { font-size: 16px; }
  .auth-brand img { width: 34px; height: 34px; }
  .back-link { font-size: 10px; }

  .auth-layout {
    width: min(100% - 28px, 520px);
    min-height: calc(100dvh - 66px);
    padding: 34px 0;
  }

  .auth-story h1 { font-size: 42px; }
  .auth-story > div > p { font-size: 15px; }
  .account-benefits { display: none; }
  .auth-card { padding: 25px 20px; border-radius: 9px; }
  .auth-card-mark { margin-bottom: 20px; }
  .auth-mode-switch { margin-bottom: 27px; }
  .auth-field input { font-size: 16px; }
  .auth-card-footer { margin: 30px -20px -25px; padding: 14px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
