:root {
    --bg: #f6f7f9;
    --panel: #ffffff;
    --text: #1f2933;
    --muted: #64748b;
    --border: #d8dee8;
    --accent: #146c5c;
    --accent-dark: #0f5146;
    --danger: #b42318;
    --warning-bg: #fff7e6;
    --warning-border: #f0b84f;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.5;
}

a {
    color: var(--accent);
}

.logout-form {
    margin: 0;
}

.link-button {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--accent);
    cursor: pointer;
    font-weight: 400;
    text-decoration: underline;
}

.link-button:hover {
    background: transparent;
    color: var(--accent-dark);
}

.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
}

.auth-shell,
.app-shell {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
}

.auth-panel,
.workspace {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

.auth-panel {
    max-width: 420px;
    margin: 0 auto;
    padding: 32px;
}

.auth-panel h1,
.section-heading h1 {
    margin: 0 0 8px;
    font-size: 26px;
}

.auth-panel p,
.section-heading p {
    margin: 0 0 24px;
    color: var(--muted);
}

.form-stack {
    display: grid;
    gap: 10px;
}

input,
textarea,
button {
    font: inherit;
}

input,
textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 11px 12px;
    background: #ffffff;
    color: var(--text);
}

textarea {
    resize: vertical;
    min-height: 280px;
}

button {
    border: 0;
    border-radius: 6px;
    padding: 11px 16px;
    background: var(--accent);
    color: #ffffff;
    cursor: pointer;
    font-weight: 700;
}

button:hover {
    background: var(--accent-dark);
}

button.secondary {
    background: #334155;
}

button.secondary:hover {
    background: #1f2937;
}

.alert {
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 18px;
}

.alert-error {
    color: var(--danger);
    background: #fff1f0;
    border: 1px solid #ffccc7;
}

.alert-warning {
    background: var(--warning-bg);
    border: 1px solid var(--warning-border);
}

.topbar {
    min-height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 0 24px;
    background: #ffffff;
    border-bottom: 1px solid var(--border);
}

.topbar span {
    color: var(--muted);
    margin-left: 8px;
}

.topbar nav {
    display: flex;
    align-items: center;
    gap: 14px;
}

.workspace {
    margin: 28px 0;
    padding: 24px;
}

.formatter-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.text-panel {
    display: grid;
    gap: 8px;
}

.text-panel > span {
    font-weight: 700;
}

.text-panel small {
    color: var(--muted);
}

.actions {
    grid-column: 1 / -1;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

@media (max-width: 760px) {
    .topbar,
    .topbar nav,
    .actions {
        align-items: stretch;
        flex-direction: column;
    }

    .formatter-grid {
        grid-template-columns: 1fr;
    }
}
