:root {
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --secondary: #0f766e;
  --background: #f5f6fa;
  --surface: #ffffff;
  --text: #171827;
  --text-muted: #62657a;
  --border: #e2e4ec;
  --danger: #c62828;
  --danger-hover: #a91f1f;
  --radius: 18px;
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 50% 0, rgba(79, 70, 229, 0.1), transparent 34rem),
    var(--background);
}

button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.55; }

a { color: var(--primary); text-underline-offset: 3px; }
a:hover { color: var(--primary-hover); }

.page-shell { width: min(100% - 32px, 640px); margin: 0 auto; padding: 40px 0 24px; }
.brand { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 24px; font-size: 1.05rem; font-weight: 750; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: white; background: linear-gradient(145deg, var(--primary), #6860ee); box-shadow: 0 7px 18px rgba(79, 70, 229, 0.22); }
.card { padding: clamp(24px, 5vw, 42px); border: 1px solid rgba(226, 228, 236, 0.9); border-radius: var(--radius); background: var(--surface); box-shadow: 0 18px 50px rgba(30, 31, 55, 0.07); }
.intro { text-align: center; }
.eyebrow { margin: 0 0 8px; color: var(--primary); font-size: 0.76rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 12px; font-size: clamp(1.9rem, 6vw, 2.55rem); line-height: 1.12; letter-spacing: -0.035em; }
h2 { margin-bottom: 8px; font-size: 1.08rem; line-height: 1.35; }
.lede { max-width: 30rem; margin: 0 auto; color: var(--text-muted); line-height: 1.65; }
.notice { margin: 30px 0; padding: 20px; border: 1px solid #dfe0f6; border-radius: 14px; background: #f8f8ff; }
.notice p, .notice li { color: #4f5269; font-size: 0.92rem; line-height: 1.55; }
.notice ul { margin: 10px 0 12px; padding-left: 21px; }
.notice li + li { margin-top: 4px; }
.notice .warning { margin-bottom: 0; color: var(--text); }
.view { animation: reveal 180ms ease-out; }
.section-heading { margin-bottom: 20px; }
.section-heading p { margin-bottom: 0; color: var(--text-muted); line-height: 1.55; }
.field { margin-bottom: 16px; }
.field label { display: block; margin-bottom: 7px; font-size: 0.88rem; font-weight: 700; }
.field input { width: 100%; min-height: 48px; padding: 11px 13px; color: var(--text); border: 1px solid #cfd1dc; border-radius: 10px; background: white; outline: none; }
.field input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.16); }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 48px; padding: 10px 18px; border: 1px solid transparent; border-radius: 11px; font-weight: 750; transition: background 140ms, border-color 140ms, transform 140ms; }
.button:not(:disabled):active { transform: translateY(1px); }
.button-primary { color: white; background: var(--primary); }
.button-primary:hover:not(:disabled) { background: var(--primary-hover); }
.button-secondary { color: #2d3043; border-color: #ced0dc; background: white; }
.button-secondary:hover:not(:disabled) { background: #f6f6fa; border-color: #b8bbc9; }
.button-outline-danger { color: var(--danger); border-color: #e8b6b6; background: #fffafa; }
.button-outline-danger:hover:not(:disabled) { background: #fff2f2; border-color: var(--danger); }
.button-danger { color: white; background: var(--danger); }
.button-danger:hover:not(:disabled) { background: var(--danger-hover); }
.text-button { display: block; margin: 13px auto 0; padding: 6px; color: var(--primary); border: 0; background: transparent; font-weight: 700; }
.text-button:hover { color: var(--primary-hover); text-decoration: underline; text-underline-offset: 3px; }
.google-mark { font: 800 1rem Arial, sans-serif; color: #4285f4; }
.divider { display: flex; align-items: center; gap: 12px; margin: 21px 0; color: #8a8d9f; font-size: 0.78rem; text-transform: uppercase; }
.divider::before, .divider::after { content: ""; height: 1px; flex: 1; background: var(--border); }
.status, .error { margin: 0 0 20px; padding: 12px 14px; border-radius: 10px; font-size: 0.9rem; line-height: 1.45; }
.status:empty, .error[hidden] { display: none; }
.status { color: #0d5e57; border: 1px solid #b8e0dc; background: #effaf8; }
.error { color: #8f2424; border: 1px solid #efc0c0; background: #fff3f3; }
.loading-view { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 28px 0; color: var(--text-muted); }
.loading-view p, .loading-view h2 { margin: 0; }
.spinner { width: 24px; height: 24px; flex: 0 0 auto; border: 3px solid #d9d8fa; border-top-color: var(--primary); border-radius: 50%; animation: spin 750ms linear infinite; }
.account-summary { display: flex; gap: 13px; padding: 16px; border: 1px solid var(--border); border-radius: 13px; background: #fafafe; }
.account-avatar { display: grid; place-items: center; width: 42px; height: 42px; flex: 0 0 auto; border-radius: 50%; color: white; background: linear-gradient(145deg, var(--primary), var(--secondary)); }
.account-avatar::after { content: "✓"; font-weight: 800; }
.account-label, .account-name, .account-email, .account-provider { margin-bottom: 2px; overflow-wrap: anywhere; }
.account-label { color: var(--text-muted); font-size: 0.78rem; font-weight: 700; }
.account-name { font-weight: 750; }
.account-email { color: #3f4255; }
.account-provider { color: var(--text-muted); font-size: 0.78rem; text-transform: capitalize; }
.action-panel { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--border); text-align: center; }
.action-panel p { color: var(--text-muted); font-size: 0.9rem; line-height: 1.5; }
.success-view { padding: 22px 0 10px; text-align: center; }
.success-icon { display: grid; place-items: center; width: 54px; height: 54px; margin: 0 auto 16px; border-radius: 50%; color: white; background: var(--secondary); font-size: 1.55rem; font-weight: 800; }
.success-view p { color: var(--text-muted); }
.app-note { display: flex; flex-direction: column; gap: 3px; margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--border); color: var(--text-muted); font-size: 0.81rem; line-height: 1.5; }
.app-note strong { color: #45485b; }
footer { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; padding: 20px 0 0; color: var(--text-muted); font-size: 0.78rem; }
dialog { width: min(calc(100% - 28px), 480px); padding: 0; border: 0; border-radius: 16px; color: var(--text); box-shadow: 0 25px 80px rgba(16, 18, 35, 0.28); }
dialog::backdrop { background: rgba(16, 18, 35, 0.58); backdrop-filter: blur(2px); }
.dialog-card { position: relative; padding: 30px; }
.dialog-card > p { color: var(--text-muted); line-height: 1.5; }
.dialog-close { position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; color: #5c5f71; border: 0; border-radius: 50%; background: transparent; font-size: 1.5rem; }
.dialog-close:hover { background: #f0f1f5; }
.danger-icon { display: grid; place-items: center; width: 42px; height: 42px; margin-bottom: 15px; border-radius: 50%; color: var(--danger); background: #fff0f0; font-size: 1.25rem; font-weight: 900; }
.dialog-actions { display: grid; grid-template-columns: 1fr 1.35fr; gap: 10px; margin-top: 22px; }
:focus-visible { outline: 3px solid rgba(79, 70, 229, 0.38); outline-offset: 2px; }
[hidden] { display: none !important; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes reveal { from { opacity: 0; transform: translateY(3px); } }
@media (max-width: 480px) {
  .page-shell { width: min(100% - 20px, 640px); padding-top: 22px; }
  .brand { margin-bottom: 16px; }
  .card { padding: 24px 18px; border-radius: 16px; }
  .notice { margin: 24px 0; padding: 16px; }
  .dialog-card { padding: 26px 20px 20px; }
  .dialog-actions { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
