:root {
    color-scheme: light;
    --primary: #1a1a2e;
    --accent: #667eea;
    --accent-hover: #764ba2;
    --border: #e8e8ec;
    --bg-light: #f0f0f5;
    --bg-white: #fafafa;
    --text: #1a1a2e;
    --text-muted: #888;
    --danger: #8b1e1e;
    --radius: 8px;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    background: linear-gradient(180deg, #f8f3eb, #ece7df);
    color: var(--text);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.editor-shell {
    min-height: 100vh;
}

.auth-shell {
    min-height: 100vh;
}

.auth-shell a {
    color: var(--accent);
}

.auth-shell .page-shell {
    width: min(1120px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 1.25rem 0 2rem;
}

.auth-shell .topbar {
    width: min(1120px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 1rem 0 0.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.auth-shell .topbar h1,
.auth-shell .page-shell h1,
.auth-shell .page-shell h2,
.auth-shell .card h1,
.auth-shell .card h2 {
    margin-top: 0;
}

.auth-shell .actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.auth-shell .card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 1.25rem;
    box-shadow: 0 10px 30px rgba(31, 41, 55, 0.06);
}

.auth-shell .card.danger {
    border-color: #f0b6b6;
}

.auth-shell .narrow {
    width: min(560px, calc(100% - 2rem));
    margin: 3rem auto 0;
}

.auth-shell .grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
    margin-top: 1rem;
}

.auth-shell .grid > .card {
    display: flex;
    flex-direction: column;
}

.auth-shell .account-form {
    display: flex;
    flex: 1;
    flex-direction: column;
}

.auth-shell .account-fields {
    display: grid;
    gap: 0.85rem;
    margin-block: auto;
    padding-block: 1rem;
}

.auth-shell .account-form > button {
    margin-top: auto;
    width: 100%;
}

.auth-shell .account-help {
    margin-top: 1.5rem;
}

.auth-shell .privacy-page {
    max-width: 840px;
}

.auth-shell .privacy-page section {
    margin-top: 1.75rem;
}

.auth-shell .privacy-page h2 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.auth-shell .privacy-page p {
    line-height: 1.65;
}

.auth-shell .privacy-footer {
    padding: 1rem 1rem 2rem;
    text-align: center;
    font-size: 0.95rem;
}

.auth-shell .stack {
    display: grid;
    gap: 0.85rem;
}

.auth-shell label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.auth-shell input,
.auth-shell textarea,
.auth-shell select {
    width: 100%;
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 0.9rem 1rem;
    font: inherit;
    background: white;
    color: var(--text);
}

.auth-shell input:focus,
.auth-shell textarea:focus,
.auth-shell select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15);
}

.auth-shell button,
.auth-shell .button-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 12px;
    padding: 0.85rem 1.15rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    color: white;
}

.auth-shell button.secondary,
.auth-shell .button-link.secondary {
    background: white;
    color: var(--text);
    border: 2px solid var(--border);
}

.auth-shell button.danger-button {
    background: var(--danger);
    color: white;
}

.auth-shell .small {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.auth-shell .info,
.auth-shell .error {
    padding: 0.85rem 1rem;
    border-radius: 12px;
    margin-bottom: 1rem;
}

.auth-shell .info {
    background: #dff3ea;
    color: #0f5132;
    border: 1px solid #b7e3cc;
}

.auth-shell .error {
    background: #fde2e1;
    color: #7f1d1d;
    border: 1px solid #f5b5b2;
}

.auth-shell .danger h2 {
    color: var(--danger);
}

@media (max-width: 980px) {
    .auth-shell .grid {
        grid-template-columns: 1fr;
    }

    .auth-shell .topbar {
        flex-direction: column;
        align-items: stretch;
    }

    .auth-shell .page-shell {
        width: min(1120px, calc(100% - 1rem));
    }
}
