:root {
    --bg: #071018;
    --bg-elevated: #0f1a24;
    --panel: #122030;
    --border: rgba(255, 255, 255, 0.08);
    --text: #e8f4fc;
    --muted: #8ba3b8;
    --primary: #22d3ee;
    --primary-hover: #06b6d4;
    --accent: #38bdf8;
    --success: #34d399;
    --danger: #f87171;
    --shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
    --radius: 16px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(34, 211, 238, 0.15), transparent 35%),
        radial-gradient(circle at bottom right, rgba(56, 189, 248, 0.1), transparent 30%),
        var(--bg);
    color: var(--text);
    line-height: 1.5;
}

code {
    font-size: 0.85em;
    background: rgba(255, 255, 255, 0.06);
    padding: 0.15em 0.4em;
    border-radius: 6px;
}

.auth-page {
    display: grid;
    place-items: center;
    padding: 24px;
}

.auth-card,
.panel {
    background: rgba(18, 32, 48, 0.95);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.auth-card {
    width: min(100%, 440px);
    padding: 32px;
}

.brand {
    text-align: center;
    margin-bottom: 28px;
}

.brand-icon {
    display: inline-grid;
    place-items: center;
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(34, 211, 238, 0.35), rgba(56, 189, 248, 0.2));
    font-size: 1.25rem;
    margin-bottom: 12px;
}

.brand h1,
.hero h1 {
    margin: 0 0 8px;
}

.muted {
    color: var(--muted);
}

.topbar {
    border-bottom: 1px solid var(--border);
    background: rgba(7, 16, 24, 0.92);
    backdrop-filter: blur(8px);
}

.topbar-inner,
.container {
    width: min(100%, 760px);
    margin: 0 auto;
    padding: 16px 20px;
}

.topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.topbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-brand .brand-icon {
    margin: 0;
    width: 42px;
    height: 42px;
}

.subtitle {
    display: block;
    color: var(--muted);
    font-size: 0.875rem;
}

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

.user-pill {
    font-size: 0.875rem;
    color: var(--muted);
}

.container {
    padding-top: 28px;
    padding-bottom: 48px;
}

.panel {
    padding: 24px;
    margin-bottom: 20px;
}

.login-form,
.runpod-form {
    display: grid;
    gap: 16px;
}

label span {
    display: block;
    margin-bottom: 6px;
    font-size: 0.875rem;
    font-weight: 600;
}

input[type="text"],
input[type="password"],
input[type="url"] {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font: inherit;
    background: var(--bg-elevated);
    color: var(--text);
}

input:focus {
    outline: 2px solid rgba(34, 211, 238, 0.25);
    border-color: var(--primary);
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.925rem;
    color: var(--muted);
}

.checkbox-row input {
    width: auto;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 10px;
    border: 1px solid transparent;
    font: inherit;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s ease;
}

.btn-primary {
    background: var(--primary);
    color: #042f2e;
}

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

.btn-secondary {
    background: rgba(56, 189, 248, 0.15);
    color: var(--accent);
    border-color: rgba(56, 189, 248, 0.25);
}

.btn-secondary:hover {
    background: rgba(56, 189, 248, 0.25);
}

.btn-ghost {
    background: transparent;
    color: var(--muted);
    border-color: var(--border);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.04);
}

.btn-block {
    width: 100%;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.alert {
    margin-top: 16px;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 0.925rem;
}

.alert-error {
    background: rgba(248, 113, 113, 0.12);
    color: var(--danger);
    border: 1px solid rgba(248, 113, 113, 0.25);
}

.alert-info {
    background: rgba(56, 189, 248, 0.12);
    color: var(--accent);
    border: 1px solid rgba(56, 189, 248, 0.25);
}

.alert-success {
    background: rgba(52, 211, 153, 0.12);
    color: var(--success);
    border: 1px solid rgba(52, 211, 153, 0.25);
}

.hidden {
    display: none;
}

.scan-results {
    margin-top: 16px;
}

.file-list {
    list-style: none;
    margin: 12px 0 0;
    padding: 0;
    max-height: 220px;
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: 10px;
}

.file-list li {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    font-size: 0.875rem;
}

.file-list li:last-child {
    border-bottom: 0;
}

.auth-footnote {
    margin-top: 16px;
    font-size: 0.875rem;
    text-align: center;
}

.auth-footnote a {
    color: var(--accent);
    text-decoration: none;
}

.auth-footnote a:hover {
    text-decoration: underline;
}

@media (max-width: 640px) {
    .topbar-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .action-row .btn {
        flex: 1 1 100%;
    }
}
