*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: linear-gradient(135deg, #0f172a, #1e293b 40%, #020617);
    color: #e5e7eb;
}

a {
    color: inherit;
    text-decoration: none;
}

code {
    font-family: "JetBrains Mono", "Fira Code", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.85rem;
    background: rgba(15, 23, 42, 0.8);
    padding: 0.15rem 0.35rem;
    border-radius: 0.25rem;
}

.auth-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.auth-wrapper {
    max-width: 420px;
    width: 100%;
}

.auth-card {
    background: radial-gradient(circle at top left, rgba(56, 189, 248, 0.12), transparent 55%),
    radial-gradient(circle at bottom right, rgba(129, 140, 248, 0.18), transparent 60%),
    rgba(15, 23, 42, 0.95);
    border-radius: 1.25rem;
    padding: 2.5rem 2.25rem;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(148, 163, 184, 0.25);
    backdrop-filter: blur(22px);
}

.auth-title {
    margin: 0 0 0.35rem;
    font-size: 1.75rem;
    letter-spacing: 0.02em;
}

.auth-subtitle {
    margin: 0 0 1.75rem;
    color: #9ca3af;
    font-size: 0.95rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.auth-form label {
    font-size: 0.9rem;
    color: #d1d5db;
}

.auth-form input {
    margin-top: 0.3rem;
    padding: 0.65rem 0.9rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(148, 163, 184, 0.4);
    background: rgba(15, 23, 42, 0.9);
    color: #e5e7eb;
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.auth-form input:focus {
    border-color: #38bdf8;
    box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.65);
    background: rgba(15, 23, 42, 1);
}

.btn-primary,
.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 0.6rem 1.4rem;
    font-weight: 500;
    font-size: 0.95rem;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform 0.12s ease-out, box-shadow 0.12s ease-out, background-color 0.12s ease-out, border-color 0.12s ease-out;
}

.btn-primary {
    margin-top: 0.9rem;
    background: linear-gradient(135deg, #38bdf8, #6366f1);
    box-shadow: 0 18px 40px rgba(56, 189, 248, 0.55);
    color: #0b1120;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 22px 50px rgba(56, 189, 248, 0.75);
}

.btn-secondary {
    background: rgba(15, 23, 42, 0.92);
    border-color: rgba(148, 163, 184, 0.45);
    color: #e5e7eb;
}

.btn-secondary:hover {
    background: rgba(30, 64, 175, 0.9);
    border-color: #6366f1;
}

.btn-clear {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 0.6rem 1.4rem;
    font-weight: 500;
    font-size: 0.95rem;
    border: 1px solid rgba(239, 68, 68, 0.5);
    cursor: pointer;
    transition: transform 0.12s ease-out, box-shadow 0.12s ease-out, background-color 0.12s ease-out, border-color 0.12s ease-out;
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    font-family: inherit;
}

.btn-clear:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: rgba(239, 68, 68, 0.7);
    transform: translateY(-1px);
}

.auth-footer {
    margin-top: 1.5rem;
    padding-top: 1.1rem;
    border-top: 1px dashed rgba(148, 163, 184, 0.4);
    font-size: 0.85rem;
    color: #9ca3af;
}

.auth-footer code {
    margin-top: 0.3rem;
    display: inline-block;
}

.flash-container {
    margin-bottom: 0.9rem;
}

.flash {
    padding: 0.55rem 0.75rem;
    border-radius: 0.65rem;
    font-size: 0.85rem;
}

.flash-error {
    background: rgba(248, 113, 113, 0.12);
    border: 1px solid rgba(248, 113, 113, 0.52);
    color: #fecaca;
}

.flash-success {
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.52);
    color: #86efac;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 1.8rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.3);
    background: rgba(15, 23, 42, 0.97);
    backdrop-filter: blur(18px);
    position: sticky;
    top: 0;
    z-index: 10;
}

.topbar-logo {
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-size: 0.85rem;
    color: #f9fafb;
}

.topbar-subtitle {
    margin-left: 0.75rem;
    font-size: 0.8rem;
    color: #9ca3af;
}

.page-content {
    padding: 1.5rem 1.8rem 2.5rem;
}

.card {
    background: rgba(15, 23, 42, 0.98);
    border-radius: 1rem;
    border: 1px solid rgba(148, 163, 184, 0.35);
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.85);
}

.card-header {
    padding: 1.3rem 1.4rem 0.8rem;
    border-bottom: 1px solid rgba(31, 41, 55, 0.9);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.card-header h2 {
    margin: 0;
    font-size: 1.2rem;
}

.card-subtitle {
    margin: 0.25rem 0 0;
    font-size: 0.85rem;
    color: #9ca3af;
}

.table-wrapper {
    overflow: auto;
    max-height: calc(100vh - 170px);
}

.log-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.log-table thead {
    background: rgba(15, 23, 42, 0.95);
}

.log-table th,
.log-table td {
    padding: 0.7rem 0.7rem;
    vertical-align: top;
    border-bottom: 1px solid rgba(31, 41, 55, 0.9);
}

.log-table th {
    text-align: left;
    font-weight: 500;
    color: #9ca3af;
    border-bottom-width: 2px;
}

.log-table tbody tr:nth-child(even) {
    background: rgba(15, 23, 42, 0.96);
}

.log-pre {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-all;
    background: rgba(15, 23, 42, 0.92);
    border-radius: 0.55rem;
    padding: 0.55rem 0.6rem;
    border: 1px solid rgba(30, 64, 175, 0.55);
    max-width: 480px;
}

.text-muted {
    color: #e5e7eb;
    text-align: center;
    padding: 2rem 0.75rem;
    background: radial-gradient(circle at top, rgba(56, 189, 248, 0.25), transparent 55%),
                rgba(15, 23, 42, 0.96);
}

.auth-badge {
    display: inline-block;
    padding: 0.3rem 0.65rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
}

.auth-success {
    background: rgba(34, 197, 94, 0.2);
    color: #86efac;
    border: 1px solid rgba(34, 197, 94, 0.4);
}

.auth-failed {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.4);
}

@media (max-width: 768px) {
    .topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.4rem;
    }

    .page-content {
        padding: 1.2rem;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
    }
}


