@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;600;700&family=Noto+Serif+SC:wght@600;700&display=swap');

:root {
    --bg: #f4f2ed;
    --surface: #ffffff;
    --border: #ddd8cf;
    --text: #1c1b19;
    --text-muted: #8a847a;
    --accent: #c4471c;
    --accent-hover: #a33a15;
    --accent-soft: #fdf0ea;
    --danger: #b42318;
    --danger-soft: #fdeeed;
    --success: #2d6a4f;
    --success-soft: #eaf4ee;
    --font: 'Noto Sans SC', sans-serif;
    --font-display: 'Noto Serif SC', Georgia, serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body.auth-page {
    font-family: var(--font);
    min-height: 100vh;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    position: relative;
}

body.auth-page::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at 15% 20%, rgba(196, 71, 28, 0.06) 0%, transparent 45%),
        radial-gradient(circle at 85% 80%, rgba(28, 27, 25, 0.04) 0%, transparent 40%);
    pointer-events: none;
}

.auth-wrap {
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
}

.auth-brand {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-brand-icon {
    width: 48px;
    height: 48px;
    background: #1c1b19;
    color: #fff;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.auth-brand h1 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--text);
    margin-bottom: 0.35rem;
}

.auth-brand p {
    color: var(--text-muted);
    font-size: 0.88rem;
}

.auth-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(28, 27, 25, 0.06);
}

.auth-card h2 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    margin-bottom: 0.3rem;
}

.auth-card .subtitle {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
}

.form-group { margin-bottom: 1rem; }

.form-group label {
    display: block;
    margin-bottom: 0.35rem;
    color: var(--text);
    font-weight: 600;
    font-size: 0.82rem;
}

.input-wrap { position: relative; }

.input-wrap input {
    width: 100%;
    padding: 0.7rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.92rem;
    font-family: var(--font);
    background: var(--surface);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-wrap input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.toggle-pwd {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px;
}

.toggle-pwd:hover { color: var(--accent); }

.alert {
    padding: 0.7rem 0.85rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid;
}

.alert-error { background: var(--danger-soft); color: var(--danger); border-color: #f5c4c0; }
.alert-success { background: var(--success-soft); color: var(--success); border-color: #b7dfc8; }
.alert-warning { background: #fef6e8; color: #b45309; border-color: #fde0a8; }

.btn-primary {
    width: 100%;
    padding: 0.75rem;
    border: none;
    border-radius: 8px;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    color: #fff;
    background: var(--accent);
    font-family: var(--font);
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary:hover { background: var(--accent-hover); }

.btn-install {
    width: 100%;
    padding: 0.75rem;
    border: none;
    border-radius: 8px;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    color: #fff;
    background: var(--success);
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 0.5rem;
}

.auth-footer {
    text-align: center;
    margin-top: 1.25rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.auth-footer a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

.auth-footer a:hover { text-decoration: underline; }

.auth-divider {
    color: var(--border);
    margin: 0 8px;
}

.code-row {
    display: flex;
    gap: 8px;
}

.code-row input { flex: 1; }

.code-row button {
    padding: 0 1rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    font-family: var(--font);
}

.code-row button:hover { border-color: var(--accent); color: var(--accent); }

.btn-code {
    padding: 0 1rem;
    min-height: 42px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    font-family: var(--font);
    align-self: flex-end;
}

.btn-code:hover { border-color: var(--accent); color: var(--accent); }
.btn-code:disabled { opacity: 0.5; cursor: not-allowed; }

.code-row .form-group { flex: 1; margin-bottom: 0; }
