/* shared.css — jade + gold dual palette */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* Backgrounds */
    --bg: #eef4f0;
    --card: #fbfdfc;
    --input-bg: #f4faf6;

    /* Text */
    --text: #1c2f28;
    --muted: #526b60;

    /* Jade — identity */
    --brand: #0a7a58;
    --brand-dark: #086b4d;
    --brand-soft: #e0f0e9;

    /* Gold — accent */
    --accent: #a67c00;
    --accent-bright: #d4a13a;
    --accent-soft: #faf3e0;

    /* UI */
    --border: #d6e5dd;
    --border-hover: #c3dcd1;

    /* Semantic */
    --error: #b3352f;
    --error-bg: #fcf0ee;
    --error-border: #f0d0cc;
    --ok: #0a7a58;
    --warn: #a67c00;

    --radius: 14px;
    --radius-sm: 10px;
    --shadow: 0 1px 2px rgba(16, 40, 32, 0.04), 0 4px 16px rgba(16, 40, 32, 0.06);
    --shadow-hover: 0 2px 4px rgba(16, 40, 32, 0.06), 0 8px 24px rgba(16, 40, 32, 0.08);
    --shadow-gold: 0 2px 4px rgba(120, 90, 10, 0.06), 0 8px 24px rgba(166, 124, 0, 0.10);
    --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.55;
    letter-spacing: -0.005em;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    width: 100%;
    max-width: 460px;
    background: var(--card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    padding: 24px 22px 26px;
}

.container-wide {
    max-width: 1040px;
    padding: 26px 24px 28px;
}

.nav {
    margin-bottom: 18px;
}

.nav a {
    font-size: 0.85rem;
    color: var(--brand);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.15s;
}

.nav a:hover {
    color: var(--brand-dark);
}

h1 {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 6px;
    color: var(--text);
}

.subtitle {
    font-size: 0.9rem;
    color: var(--muted);
    margin-bottom: 20px;
}

/* Utility — add class="accent" to any element for gold */
.accent {
    color: var(--accent);
}

.accent-bg {
    background: var(--accent-soft);
    color: var(--accent);
}

.field {
    text-align: left;
    margin-bottom: 14px;
}

label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

input[type="text"] {
    width: 100%;
    font-size: 1rem;
    padding: 14px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--input-bg);
    color: var(--text);
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    -webkit-appearance: none;
    appearance: none;
    font-family: inherit;
}

input[type="text"]::placeholder {
    color: #93a89d;
}

input[type="text"]:focus {
    outline: none;
    border-color: var(--brand);
    background: var(--card);
    box-shadow: 0 0 0 3px rgba(10, 122, 88, 0.12);
}

textarea {
    width: 100%;
    min-height: 220px;
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.6;
    padding: 14px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--input-bg);
    color: var(--text);
    resize: vertical;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

textarea::placeholder {
    color: #93a89d;
}

textarea:focus {
    outline: none;
    border-color: var(--brand);
    background: var(--card);
    box-shadow: 0 0 0 3px rgba(10, 122, 88, 0.12);
}

.btn {
    display: block;
    width: 100%;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    padding: 14px 20px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: transform 0.08s, background 0.15s, box-shadow 0.15s;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.btn:active {
    transform: scale(0.98);
}

.btn:focus-visible {
    outline: 3px solid rgba(10, 122, 88, 0.35);
    outline-offset: 2px;
}

.btn-primary {
    background: var(--brand);
    color: #fff;
    box-shadow: 0 1px 2px rgba(16, 40, 32, 0.10), 0 2px 8px rgba(10, 122, 88, 0.18);
}

.btn-primary:hover {
    background: var(--brand-dark);
}

.btn-primary:disabled {
    background: #b8d4c6;
    box-shadow: none;
    cursor: not-allowed;
}

.btn-secondary {
    background: var(--brand-soft);
    color: var(--brand-dark);
    margin-top: 10px;
}

.btn-secondary:hover {
    background: #cbe5d9;
}

.btn-sm {
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 8px 14px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    background: var(--card);
    color: var(--text);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, transform 0.08s;
    -webkit-tap-highlight-color: transparent;
}

.btn-sm:hover {
    background: var(--input-bg);
    border-color: var(--border-hover);
}

.btn-sm:active {
    transform: scale(0.97);
}

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

.btn-sm.primary:hover {
    background: var(--brand-dark);
    border-color: var(--brand-dark);
}

.checks {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 14px;
    margin-bottom: 20px;
}

.check {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.88rem;
    color: var(--text);
    cursor: pointer;
    user-select: none;
    line-height: 1.4;
}

.check input {
    width: 17px;
    height: 17px;
    accent-color: var(--brand);
    cursor: pointer;
    flex: 0 0 auto;
    margin-top: 2px;
}

.check code {
    font-family: var(--mono);
    font-size: 0.82rem;
    background: var(--input-bg);
    color: var(--brand-dark);
    padding: 1px 5px;
    border-radius: 4px;
}

#error-msg {
    display: none;
    font-size: 0.88rem;
    color: var(--error);
    background: var(--error-bg);
    border: 1px solid var(--error-border);
    border-radius: 8px;
    padding: 10px 12px;
    margin-top: 12px;
    text-align: left;
}

.status {
    font-size: 0.85rem;
    font-weight: 600;
    min-height: 1.5em;
    margin-top: 14px;
    text-align: center;
    word-break: break-word;
}

.status.ok {
    color: var(--ok);
}

.status.err {
    color: var(--error);
}

.status.info {
    color: var(--muted);
    font-weight: 500;
}

.status.warn {
    color: var(--warn);
}

.stats {
    display: none;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 8px;
    margin-top: 16px;
}

.stats.show {
    display: grid;
}

.stat {
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px;
    text-align: center;
}

.stat-value {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--brand);
    font-variant-numeric: tabular-nums;
}

.stat-label {
    font-size: 0.68rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 2px;
    font-weight: 600;
}

.footer-note {
    margin-top: 22px;
    font-size: 0.78rem;
    color: var(--muted);
    text-align: center;
}

.footer-note a {
    color: var(--brand);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s;
}

.footer-note a:hover {
    color: var(--brand-dark);
    text-decoration: underline;
}

.footer-note strong {
    color: var(--accent);
    font-weight: 700;
}

@media (max-width: 360px) {
    .container {
        padding: 22px 16px 20px;
    }

    h1 {
        font-size: 1.2rem;
    }

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

    .btn,
    input[type="text"],
    textarea {
        font-size: 0.95rem;
    }
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0c1410;
        --card: #152420;
        --input-bg: #0f1a16;
        --text: #e6f0eb;
        --muted: #8fa89d;
        --brand: #3fb891;
        --brand-dark: #4dc9a0;
        --brand-soft: #1c3a2f;
        --accent: #e0b86b;
        --accent-bright: #f0c674;
        --accent-soft: #2a2213;
        --border: #2a3d35;
        --border-hover: #3a5045;
        --error: #f0a29e;
        --error-bg: #2a1715;
        --error-border: #4a2926;
        --ok: #4dc9a0;
        --warn: #e0b86b;
        --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 16px rgba(0, 0, 0, 0.25);
        --shadow-hover: 0 2px 4px rgba(0, 0, 0, 0.35), 0 8px 24px rgba(0, 0, 0, 0.30);
        --shadow-gold: 0 2px 4px rgba(224, 184, 107, 0.06), 0 8px 24px rgba(224, 184, 107, 0.12);
    }

    input[type="text"],
    textarea {
        color: var(--text);
    }

    input[type="text"]::placeholder,
    textarea::placeholder {
        color: #5c7066;
    }

    input[type="text"]:focus,
    textarea:focus {
        background: var(--input-bg);
        box-shadow: 0 0 0 3px rgba(63, 184, 145, 0.18);
    }

    .btn-primary:disabled {
        background: #2a4a3d;
        color: #6a8076;
    }

    .btn-secondary:hover {
        background: #244638;
    }

    .btn-sm:hover {
        background: #1e2f28;
        border-color: var(--border-hover);
    }

    .check code {
        background: var(--input-bg);
        color: #7dd5b0;
    }

    .stat {
        background: var(--input-bg);
    }
}