:root {
    --brand-primary: #1a73e8;
    --brand-secondary: #0f9d58;
    --brand-danger: #d93025;
    --surface: #ffffff;
    --surface-alt: #f5f7fb;
    --text-main: #202124;
    --text-muted: #5f6368;
    --border-soft: #e0e3eb;
    --shadow-soft: 0 16px 40px rgba(15, 41, 77, 0.12);
    --radius-lg: 16px;
}

* {
    box-sizing: border-box;
}

body {
    font-family: "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--surface-alt);
    margin: 0;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 3rem 1.5rem;
}

.card-shell {
    width: 100%;
    max-width: 420px;
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 2.25rem 2rem;
    box-shadow: var(--shadow-soft);
    text-align: left;
}

.card-shell.centered {
    text-align: center;
}

.login-container {
    width: 100%;
    max-width: 420px;
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 2.25rem 2rem;
    box-shadow: var(--shadow-soft);
    text-align: left;
}

.login-container.centered {
    text-align: center;
}

.admin-shell {
    width: 100%;
    max-width: 1260px;
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 2.5rem 2.25rem;
    box-shadow: var(--shadow-soft);
}

.admin-shell h1 {
    margin-top: 0;
    font-size: 2rem;
    color: var(--text-main);
}

.admin-toolbar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.75rem;
}

.admin-table-wrapper {
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    overflow: hidden;
    background: var(--surface);
}

.admin-table-scroll {
    overflow-x: visible;
}

.admin-table-scroll table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.admin-table-scroll th,
.admin-table-scroll td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-soft);
    background: var(--surface);
    vertical-align: top;
    word-break: break-word;
}

.admin-table-scroll thead th {
    background: #f2f5ff;
    font-weight: 600;
    color: var(--text-main);
    text-transform: uppercase;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
}

.admin-table-scroll tbody tr:last-child td {
    border-bottom: none;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.dashboard-card {
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    padding: 1.5rem 1.4rem;
    background: var(--surface);
    box-shadow: 0 10px 30px rgba(15, 41, 77, 0.08);
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.25rem;
}

.card-identity {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.card-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
}

.card-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.card-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    align-items: flex-end;
    text-align: right;
}

.card-label {
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.card-value {
    font-weight: 600;
    color: var(--text-main);
}

.card-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    background: rgba(26, 115, 232, 0.12);
    color: var(--brand-primary);
    font-weight: 600;
    font-size: 0.75rem;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem 1.25rem;
}

.card-subtext {
    color: var(--text-muted);
    font-size: 0.88rem;
    margin-top: 0.25rem;
}

.card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    justify-content: flex-end;
}

.actions-stack form {
    margin: 0;
}

.actions-stack button,
.actions-stack .link-button {
    width: auto;
}

.subtle-button {
    padding: 0.5rem 0.9rem;
    font-size: 0.85rem;
}

.empty-state {
    border: 1px dashed rgba(32, 33, 36, 0.2);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
    background: rgba(26, 115, 232, 0.04);
    margin-top: 1rem;
}

.empty-state h4 {
    margin: 0 0 0.5rem 0;
    color: var(--text-main);
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-pill.success { background: rgba(15, 157, 88, 0.12); color: var(--brand-secondary); }
.status-pill.warning { background: rgba(244, 180, 0, 0.15); color: #c47f00; }
.status-pill.danger { background: rgba(217, 48, 37, 0.12); color: var(--brand-danger); }
.status-pill.muted { background: rgba(95, 99, 104, 0.12); color: var(--text-muted); }

.table-subtext {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
}

.table-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.1rem;
}

.table-strong {
    font-weight: 600;
    color: var(--text-main);
}

.actions-cell {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    min-width: 140px;
}

.actions-cell .link-button {
    width: 100%;
    display: flex;
    justify-content: center;
}

.actions-cell .danger {
    width: 100%;
}

.actions-cell form {
    margin: 0;
}

.brand-badge {
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--brand-primary);
    margin-bottom: 0.5rem;
}

.page-title {
    margin: 0 0 1.25rem 0;
    color: var(--text-main);
    font-size: 1.7rem;
    line-height: 1.2;
}

.page-subtitle {
    color: var(--text-muted);
    margin-bottom: 1.75rem;
}

form {
    margin-top: 1.25rem;
}

label {
    display: block;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.4rem;
}

input[type="text"],
input[type="password"],
input[type="number"] {
    width: 100%;
    padding: 0.75rem 0.9rem;
    border-radius: 8px;
    border: 1px solid var(--border-soft);
    font-size: 1rem;
    margin-bottom: 1rem;
}

input:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.18);
}

button {
    width: 100%;
    padding: 0.75rem;
    border: none;
    border-radius: 8px;
    background: var(--brand-primary);
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

button.secondary {
    background: var(--text-muted);
}

button.success {
    background: var(--brand-secondary);
}

button.danger {
    background: var(--brand-danger);
}

button:hover {
    background: #155ac9;
}

button.secondary:hover {
    background: #4a4d52;
}

button.success:hover {
    background: #0c7a43;
}

button.danger:hover {
    background: #b22c1f;
}

.link-button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: auto;
    padding: 0.5rem 1rem;
    background: transparent;
    color: var(--brand-primary);
    border: 1px solid var(--brand-primary);
    border-radius: 999px;
    font-size: 0.95rem;
    text-decoration: none;
    transition: all 0.2s ease;
}

.link-button:hover {
    background: rgba(26, 115, 232, 0.12);
}

p {
    color: var(--text-muted);
    line-height: 1.55;
}

.hero-copy {
    margin-bottom: 1.5rem;
}

.section-title {
    margin: 0 0 0.75rem 0;
    color: var(--text-main);
    font-size: 1.35rem;
    font-weight: 700;
}
.acknowledgement {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-top: 1.5rem;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.acknowledgement input[type="checkbox"] {
    margin-top: 0.3rem;
}

hr {
    border: none;
    border-top: 1px solid var(--border-soft);
    margin: 2rem 0;
}

code {
    background: rgba(32, 33, 36, 0.08);
    padding: 0.15rem 0.35rem;
    border-radius: 6px;
    font-family: "JetBrains Mono", "Fira Code", "Courier New", monospace;
    font-size: 0.95rem;
    color: var(--text-main);
}

.feedback {
    margin-top: 1.25rem;
    font-weight: 600;
    color: var(--text-muted);
}

.feedback.success { color: var(--brand-secondary); }
.feedback.warning { color: #c47f00; }
.feedback.danger { color: var(--brand-danger); }

.instruction-list {
    margin: 0 0 1.5rem 0;
    padding-left: 1.1rem;
    color: var(--text-muted);
}

.instruction-list li {
    margin-bottom: 0.5rem;
}

.alert {
    border-radius: 10px;
    padding: 0.9rem 1rem;
    margin: 1rem 0;
    text-align: left;
}

.alert-success { background: rgba(15, 157, 88, 0.12); color: var(--brand-secondary); }
.alert-danger { background: rgba(217, 48, 37, 0.12); color: var(--brand-danger); }
.alert-warning { background: rgba(244, 180, 0, 0.18); color: #a66c00; }

.stack {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.cta-group {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-top: 1.75rem;
}

.button-stack {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1.25rem;
}

a.solid-button {
    display: block;
    text-align: center;
    width: 100%;
    padding: 0.75rem;
    border-radius: 8px;
    background: var(--brand-primary);
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    transition: background 0.2s ease;
}

a.solid-button:hover {
    background: #155ac9;
}

a.solid-button.secondary {
    background: var(--text-muted);
}

a.solid-button.secondary:hover {
    background: #4a4d52;
}

a.text-link {
    color: var(--brand-primary);
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
    margin-top: 1.25rem;
}

a.text-link:hover {
    text-decoration: underline;
}

.hidden {
    display: none !important;
}

@media (max-width: 900px) {
    body {
        padding: 2rem 1rem;
    }

    .admin-shell {
        padding: 2rem 1.5rem;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .card-group {
        align-items: flex-start;
        text-align: left;
    }

    .card-actions {
        justify-content: flex-start;
    }


    pre.code-block {
        background: rgba(32, 33, 36, 0.08);
        padding: 1rem;
        border-radius: 10px;
        font-family: "JetBrains Mono", "Fira Code", "Courier New", monospace;
        font-size: 0.95rem;
        line-height: 1.6;
        color: var(--text-main);
        white-space: pre-wrap;
        word-break: break-word;
    }
    .admin-table-scroll table {
        min-width: 0;
    }
}

@media (max-width: 600px) {
    body {
        padding: 1.5rem 1rem;
    }

    .card-shell,
    .admin-shell {
        padding: 1.75rem 1.25rem;
    }

    .admin-toolbar {
        grid-template-columns: 1fr;
    }

    button {
        font-size: 0.95rem;
    }
}
/* WebAuthn Page - Larger, easier to tap buttons */
.webauthn-page button {
    width: 100%;
    padding: 1.2rem 1.5rem;  /* Increased from 0.75rem */
    border: none;
    border-radius: 12px;  /* Slightly more rounded */
    font-weight: 600;
    font-size: 1.1rem;  /* Increased from 1rem */
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 0.5rem 0;  /* Add spacing between buttons */
    min-height: 56px;  /* Ensure minimum tap target size */
}

/* Primary action button (Authenticate) */
.webauthn-page button#btnAuth {
    background: var(--brand-primary);
    color: #fff;
    font-size: 1.2rem;  /* Even larger for primary action */
    padding: 1.4rem 1.5rem;
}

.webauthn-page button#btnAuth:hover {
    background: #1a5eae;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* Secondary action button (Register) */
.webauthn-page button.secondary {
    background: var(--text-muted);
    color: #fff;
}

.webauthn-page button.secondary:hover {
    background: #5a5d64;
    transform: translateY(-2px);
}

/* Reset button - keep it smaller but still tappable */
.webauthn-page button#btnReset.subtle-button {
    padding: 1rem 1.2rem;
    font-size: 0.95rem;
    min-height: 48px;
}

.webauthn-page button#btnReset:hover {
    background: #7a7d84;
}

/* Add touch-friendly spacing between button groups */
.webauthn-page .actions-stack {
    gap: 0.8rem;
    display: flex;
    flex-direction: column;
}


/* Form section headers */
.login-container h3,
.card-shell h3 {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-main);
    font-size: 1.1rem;
    font-weight: 600;
    border-bottom: 2px solid var(--border-soft);
    padding-bottom: 0.5rem;
}

/* Consistent form field spacing */
.login-container label,
.card-shell label {
    display: block;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-main);
    font-size: 0.95rem;
}

.login-container input[type="text"],
.login-container input[type="password"],
.login-container input[type="number"],
.login-container select,
.card-shell input[type="text"],
.card-shell input[type="password"],
.card-shell input[type="number"],
.card-shell select {
    width: 100%;
    padding: 12px;
    margin-bottom: 0.75rem;
    border: 1px solid var(--border-soft);
    border-radius: 8px;
    font-size: 1rem;
    box-sizing: border-box;
    background: var(--surface);
    transition: border-color 0.2s;
}

.login-container input:focus,
.login-container select:focus,
.card-shell input:focus,
.card-shell select:focus {
    outline: none;
    border-color: var(--brand-primary);
}

.login-container input[readonly],
.card-shell input[readonly] {
    background-color: var(--surface-alt);
    cursor: not-allowed;
}

/* Help text below form fields */
.login-container small,
.card-shell small {
    display: block;
    margin-top: -0.5rem;
    margin-bottom: 1rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Back link styling */
.back-link {
    display: inline-block;
    margin-top: 1rem;
    color: var(--brand-primary);
    text-decoration: none;
    font-weight: 500;
}

.back-link:hover {
    text-decoration: underline;
}
