:root {
  color-scheme: light;
  --brand: #397a93;
  --brand-light: #4a8ca6;
  --brand-dark: #255a70;
  --background: #f8fafc;
  --surface: #ffffff;
  --text: #1e293b;
  --muted: #64748b;
  --border: #e2e8f0;
  --danger: #b42318;
  --danger-dark: #8f1c13;
  --danger-soft: #fff1f0;
  --warning-soft: #fff9e8;
  --success: #067647;
  --success-soft: #ecfdf3;
  --shadow: 0 18px 50px rgb(15 23 42 / 0.08);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--text);
  background: radial-gradient(
      circle at 85% 8%,
      rgb(57 122 147 / 0.12),
      transparent 28rem
    ),
    var(--background);
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--brand);
  border-bottom: 1px solid var(--brand-light);
}

.header-inner,
.footer-inner {
  width: min(72rem, calc(100% - 2rem));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-inner {
  min-height: 5rem;
}

.brand,
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  color: #fff;
  text-decoration: none;
  font-size: clamp(1.6rem, 4vw, 2rem);
  font-weight: 750;
  letter-spacing: -0.03em;
}

.brand img {
  width: auto;
  height: 3rem;
  filter: brightness(0) invert(1);
}

.header-actions,
.language-switch {
  display: flex;
  align-items: center;
}

.header-actions {
  gap: 1rem;
}

.language-switch {
  padding: 0.2rem;
  border: 1px solid rgb(255 255 255 / 0.28);
  border-radius: 0.65rem;
}

.language-switch button {
  min-width: 2.35rem;
  min-height: 2rem;
  border: 0;
  border-radius: 0.45rem;
  color: rgb(255 255 255 / 0.76);
  background: transparent;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 700;
}

.language-switch button[aria-pressed="true"] {
  color: var(--brand-dark);
  background: #fff;
}

.header-account {
  padding: 0.65rem 1rem;
  border: 1px solid rgb(255 255 255 / 0.32);
  border-radius: 0.65rem;
  color: #fff;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 700;
}

main {
  width: min(68rem, calc(100% - 2rem));
  margin: 0 auto;
  padding: clamp(2.5rem, 7vw, 5rem) 0;
  flex: 1;
}

.hero {
  max-width: 48rem;
  margin: 0 auto 2rem;
  text-align: center;
}

.eyebrow {
  display: inline-block;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  color: var(--brand-dark);
  background: rgb(57 122 147 / 0.12);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 1rem;
  font-size: clamp(2.15rem, 7vw, 3.9rem);
  line-height: 1.05;
  letter-spacing: -0.045em;
}

.hero p {
  margin: 0 auto;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.12rem);
  line-height: 1.7;
}

.panel,
.action-card {
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  background: rgb(255 255 255 / 0.96);
  box-shadow: var(--shadow);
}

.auth-panel {
  width: min(32rem, 100%);
  margin: 0 auto;
  padding: clamp(1.35rem, 5vw, 2.2rem);
}

.panel-heading,
.actions-heading {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.panel-heading {
  margin-bottom: 1.5rem;
}

.panel-heading h2,
.actions-heading h2 {
  margin-bottom: 0.45rem;
}

.panel-heading p,
.actions-heading p,
.action-card p,
.action-card li,
.backup-note,
.security-note,
.completion p {
  color: var(--muted);
  line-height: 1.55;
}

.step {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  flex: 0 0 auto;
  border-radius: 50%;
  color: #fff;
  background: var(--brand);
  font-weight: 800;
}

label {
  display: block;
  margin: 1rem 0 0.4rem;
  font-size: 0.9rem;
  font-weight: 700;
}

input {
  width: 100%;
  min-height: 3rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.65rem;
  color: var(--text);
  background: #fff;
}

input:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgb(74 140 166 / 0.38);
  outline-offset: 2px;
}

.button {
  min-height: 2.85rem;
  padding: 0.68rem 1rem;
  border: 1px solid transparent;
  border-radius: 0.7rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  cursor: pointer;
  text-decoration: none;
  font-weight: 750;
  transition: transform 120ms ease, background 120ms ease,
    border-color 120ms ease;
}

.button:not(:disabled):active {
  transform: translateY(1px);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.primary {
  color: #fff;
  background: var(--brand);
}

.primary:hover:not(:disabled) {
  background: var(--brand-light);
}

#emailLoginButton {
  width: 100%;
  margin-top: 1.25rem;
}

.secondary {
  color: var(--text);
  border-color: #cbd5e1;
  background: #fff;
}

.separator {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.4rem 0;
  color: #94a3b8;
  font-size: 0.8rem;
}

.separator::before,
.separator::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--border);
}

.social-buttons {
  display: grid;
  gap: 0.75rem;
}

.social {
  min-height: 3.5rem;
  padding-inline: 1.25rem;
  gap: 0.875rem;
  border-width: 1.25px;
  border-color: #cdd4d7;
  border-radius: 1.125rem;
  color: #111;
  background: #fff;
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: 0;
  overflow: hidden;
}

.social:hover:not(:disabled) {
  border-color: #aeb8bc;
  background: #f8fafb;
}

.provider-logo {
  display: block;
  flex: 0 0 auto;
}

.provider-logo.google {
  width: 1.5625rem;
  height: 1.5625rem;
}

.provider-logo.apple {
  width: 1.8125rem;
  height: 1.8125rem;
}

.security-note {
  margin: 1.4rem 0 0;
  padding: 0.9rem;
  border-radius: 0.75rem;
  background: #f1f5f9;
  font-size: 0.84rem;
}

.status {
  width: min(46rem, 100%);
  margin: 0 auto 1.25rem;
  padding: 0.9rem 1rem;
  border: 1px solid #f4c7c3;
  border-radius: 0.75rem;
  color: var(--danger-dark);
  background: var(--danger-soft);
  line-height: 1.5;
}

.status.success {
  border-color: #abefc6;
  color: var(--success);
  background: var(--success-soft);
}

.session-panel {
  margin-bottom: 2rem;
  padding: 1rem 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.signed-in-label {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.compact {
  min-height: 2.45rem;
}

.actions-heading {
  max-width: 45rem;
  margin-bottom: 1.25rem;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.action-card {
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
}

.action-card.warning-card {
  border-color: #f5d78e;
}

.action-card.critical-card {
  border-color: #f3b4ae;
}

.action-icon {
  width: 2.5rem;
  height: 2.5rem;
  margin-bottom: 1rem;
  display: grid;
  place-items: center;
  border-radius: 0.7rem;
  color: var(--danger);
  background: var(--danger-soft);
  font-size: 1.25rem;
  font-weight: 900;
}

.action-card h3 {
  margin-bottom: 0.65rem;
  font-size: 1.15rem;
}

.action-card ul {
  margin: 0 0 1.2rem;
  padding-left: 1.1rem;
  font-size: 0.9rem;
}

.action-card .button {
  width: 100%;
  margin-top: auto;
}

.danger-outline {
  color: var(--danger);
  border-color: #e9a6a0;
  background: #fff;
}

.danger {
  color: #fff;
  background: var(--danger);
}

.danger:hover:not(:disabled) {
  background: var(--danger-dark);
}

.backup-note {
  margin: 1.3rem 0 0;
  padding: 1rem 1.1rem;
  border-left: 4px solid var(--brand);
  border-radius: 0 0.75rem 0.75rem 0;
  background: #fff;
  font-size: 0.88rem;
}

.completion {
  width: min(40rem, 100%);
  margin: 0 auto;
  padding: clamp(1.5rem, 5vw, 2.5rem);
  text-align: center;
}

.success-mark {
  width: 4rem;
  height: 4rem;
  margin: 0 auto 1rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--success);
  background: var(--success-soft);
  font-size: 2rem;
  font-weight: 900;
}

.apple-notice {
  margin: 1.25rem 0;
  padding: 1rem;
  border: 1px solid #f5d78e;
  border-radius: 0.8rem;
  background: var(--warning-soft);
  text-align: left;
}

.apple-notice h3 {
  margin-bottom: 0.4rem;
}

.inline-button {
  margin-top: 0.6rem;
}

dialog {
  width: min(34rem, calc(100% - 2rem));
  padding: 0;
  border: 0;
  border-radius: 1.15rem;
  color: var(--text);
  box-shadow: 0 28px 80px rgb(15 23 42 / 0.28);
}

dialog::backdrop {
  background: rgb(15 23 42 / 0.66);
  backdrop-filter: blur(2px);
}

.dialog-card {
  position: relative;
  padding: clamp(1.4rem, 5vw, 2rem);
}

.dialog-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  border-radius: 50%;
  color: var(--muted);
  background: #f1f5f9;
  cursor: pointer;
  font-size: 1.5rem;
}

.dialog-warning {
  width: 2.6rem;
  height: 2.6rem;
  margin-bottom: 0.9rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--danger);
  background: var(--danger-soft);
  font-weight: 900;
}

.dialog-note {
  margin: 0.75rem 0 0;
  color: var(--muted);
  font-size: 0.83rem;
}

.dialog-actions {
  margin-top: 1.5rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

footer {
  color: rgb(255 255 255 / 0.8);
  background: var(--brand);
}

.footer-inner {
  min-height: 6.5rem;
  gap: 1rem;
}

.footer-brand {
  font-size: 1rem;
  letter-spacing: 0;
}

.footer-brand img {
  height: 2rem;
  filter: brightness(0) invert(1);
}

footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
}

footer a {
  color: inherit;
  text-decoration: none;
}

footer a:hover {
  color: #fff;
}

.hidden {
  display: none !important;
}

@media (max-width: 880px) {
  .action-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .header-inner {
    min-height: 4.5rem;
  }

  .brand span {
    display: none;
  }

  .brand img {
    height: 2.7rem;
  }

  .header-actions {
    gap: 0.55rem;
  }

  .header-account {
    padding: 0.55rem 0.7rem;
  }

  .session-panel,
  .footer-inner,
  .dialog-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .dialog-actions .button {
    width: 100%;
  }

  .footer-inner {
    padding: 1.5rem 0;
  }
}

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