/* Shared styles for the authentication and user-management screens. */
:root {
    color-scheme: light;
    --auth-bg: #f3f4f6;
    --auth-card: #ffffff;
    --auth-border: #d1d5db;
    --auth-text: #111827;
    --auth-muted: #6b7280;
    --auth-primary: #111827;
    --auth-primary-hover: #1f2937;
    --auth-accent: #2563eb;
    --auth-success-bg: #dcfce7;
    --auth-success-text: #166534;
    --auth-error-bg: #fee2e2;
    --auth-error-text: #991b1b;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    background: var(--auth-bg);
    color: var(--auth-text);
    font-family: Arial, Helvetica, sans-serif;
}

body.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

body.auth-page.auth-page-top {
    align-items: flex-start;
}

.auth-shell {
    width: 100%;
    max-width: 1100px;
}

.auth-card {
    background: var(--auth-card);
    border: 1px solid rgba(17, 24, 39, 0.08);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(17, 24, 39, 0.08);
    padding: 24px;
}

.auth-card + .auth-card {
    margin-top: 16px;
}

.auth-header {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.auth-header h1,
.auth-header h2 {
    margin: 0;
    line-height: 1.1;
}

.auth-header p {
    margin: 0;
    color: var(--auth-muted);
}

.auth-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.auth-link,
.auth-button {
    appearance: none;
    border: 0;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 700;
    padding: 11px 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
}

.auth-button {
    background: var(--auth-primary);
    color: #fff;
}

.auth-button:hover {
    background: var(--auth-primary-hover);
}

.auth-link.secondary,
.auth-button.secondary {
    background: #e5e7eb;
    color: var(--auth-text);
}

.auth-link.secondary:hover,
.auth-button.secondary:hover {
    background: #d1d5db;
}

.auth-link.text {
    background: transparent;
    color: var(--auth-accent);
    padding-left: 0;
    padding-right: 0;
}

.flash {
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 16px;
    font-size: 14px;
}

.flash.success {
    background: var(--auth-success-bg);
    color: var(--auth-success-text);
}

.flash.error {
    background: var(--auth-error-bg);
    color: var(--auth-error-text);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.form-grid.three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field.full {
    grid-column: 1 / -1;
}

.field label {
    font-size: 13px;
    font-weight: 700;
    color: var(--auth-muted);
}

.field input,
.field select,
.field textarea {
    width: 100%;
    border: 1px solid var(--auth-border);
    border-radius: 10px;
    padding: 12px 13px;
    font-size: 15px;
    background: #fff;
    color: var(--auth-text);
}

.field input[type="checkbox"] {
    width: 18px;
    height: 18px;
    padding: 0;
}

.field-help {
    font-size: 12px;
    color: var(--auth-muted);
}

.inline-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid rgba(17, 24, 39, 0.08);
    border-radius: 14px;
}

.user-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 960px;
    background: #fff;
}

.user-table th,
.user-table td {
    padding: 12px;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: top;
    text-align: left;
    font-size: 14px;
}

.user-table th {
    background: #f9fafb;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--auth-muted);
}

.user-table tr:last-child td {
    border-bottom: 0;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.status-pill.active {
    background: var(--auth-success-bg);
    color: var(--auth-success-text);
}

.status-pill.inactive {
    background: #e5e7eb;
    color: #374151;
}

.row-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.small-button {
    min-height: 38px;
    padding: 8px 12px;
    font-size: 13px;
}

.secondary-note {
    color: var(--auth-muted);
    font-size: 13px;
}

@media (max-width: 820px) {
    body.auth-page {
        align-items: stretch;
    }

    .auth-shell {
        max-width: none;
    }

    .auth-card {
        padding: 18px;
    }

    .form-grid,
    .form-grid.three {
        grid-template-columns: 1fr;
    }
}
