:root {
    --bg-page: #1a1a1a;
    --bg-card: #222222;
    --bg-input: #2d2d2d;
    --border-input: #555555;
    --border-focus: #888888;
    --text-primary: #ffffff;
    --text-heading: #f5f0e8;
    --text-muted: #999999;
    --text-placeholder: #777777;
    --accent-red: #e53935;
    --btn-bg: #3a3a3a;
    --btn-hover: #4a4a4a;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    background: var(--bg-page);
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    color: var(--text-primary);
    padding: 40px 20px;
}

.container {
    width: 100%;
    max-width: 420px;
    padding: 0;
}

.container-wide {
    max-width: 520px;
}

.card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 36px 32px;
}

.card h1 {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 28px;
    color: var(--text-heading);
}

.card-title {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-heading);
}

.card p {
    color: var(--text-muted);
    margin-bottom: 24px;
}

.form-group {
    margin-bottom: 18px;
}

label {
    display: block;
    font-weight: 400;
    font-size: 0.95rem;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.required {
    color: var(--accent-red);
}

input,
select,
textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border-input);
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    background: var(--bg-input);
    color: var(--text-primary);
}

input::placeholder,
textarea::placeholder {
    color: var(--text-placeholder);
}

select {
    color: var(--text-muted);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23ffffff' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
    cursor: pointer;
}

select:valid,
select option:checked {
    color: var(--text-primary);
}

select option {
    background: var(--bg-input);
    color: var(--text-primary);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--border-focus);
}

textarea {
    resize: vertical;
    min-height: 90px;
}

.form-row {
    display: block;
}

.checkbox-group {
    margin-top: 8px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 400;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin: 0;
    accent-color: var(--border-focus);
}

.btn {
    width: 100%;
    padding: 13px 16px;
    border: 1px solid var(--border-input);
    border-radius: 8px;
    background: var(--btn-bg);
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 8px;
}

.btn:hover {
    background: var(--btn-hover);
}

.btn-secondary {
    display: inline-block;
    margin-top: 16px;
    text-align: center;
    text-decoration: none;
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border-input);
}

.btn-secondary:hover {
    background: var(--btn-bg);
}

.alert {
    padding: 12px 14px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 0.95rem;
}

.alert-error {
    background: #2a2020;
    color: #ff8a80;
    border: 1px solid #5c3333;
}

.alert-success {
    background: #202a20;
    color: #a5d6a7;
    border: 1px solid #335c33;
}

.footer-link {
    margin-top: 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.footer-link a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
}

.footer-link a:hover {
    text-decoration: underline;
}

.welcome-card {
    text-align: center;
}

.welcome-card h1 {
    color: var(--text-heading);
    margin-bottom: 12px;
}

.welcome-card .username {
    color: var(--text-primary);
    font-weight: 700;
}

body.auth-page {
    display: block;
    padding: 0;
}

.auth-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.auth-header {
    text-align: center;
    padding: 32px 20px 16px;
}

.auth-brand {
    display: inline-block;
    margin-bottom: 12px;
}

.auth-logo {
    height: auto;
    max-width: 160px;
}

.auth-site-name {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.75rem;
    color: var(--text-heading);
    margin-bottom: 6px;
}

.auth-site-tagline {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.auth-main {
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 0 20px 32px;
}

.auth-footer {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-top: 1px solid #333;
}

.auth-footer a {
    color: var(--text-primary);
    text-decoration: none;
}

.auth-footer a:hover {
    text-decoration: underline;
}
