/* The Cortex Free — CSS */
:root {
    --bg: #0a0a0f;
    --card: #141420;
    --text: #e8e8f0;
    --muted: #8888a0;
    --accent: #ff6b35;
    --success: #4ade80;
    --warning: #fbbf24;
    --danger: #ef4444;
    --border: #2a2a3a;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

header {
    background: linear-gradient(135deg, var(--card), var(--bg));
    border-bottom: 1px solid var(--border);
    padding: 40px 0;
    text-align: center;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 12px;
}

.avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
}

.tagline {
    color: var(--accent);
    font-size: 1.1rem;
    margin-bottom: 4px;
}

.subtitle {
    color: var(--muted);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

main {
    padding: 40px 0;
}

section {
    margin-bottom: 48px;
}

h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.agents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.agent-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.agent-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.agent-name {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.agent-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 12px;
}

.status-active {
    background: rgba(74, 222, 128, 0.2);
    color: var(--success);
}

.status-waitlisted {
    background: rgba(251, 191, 36, 0.2);
    color: var(--warning);
}

.agent-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    font-size: 0.9rem;
}

.agent-details .label {
    color: var(--muted);
}

.agent-details .value {
    font-weight: 600;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.stat-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent);
}

.stat-label {
    color: var(--muted);
    font-size: 0.9rem;
    margin-top: 4px;
}

#cta {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 32px;
    text-align: center;
}

#cta p {
    color: var(--muted);
    margin-bottom: 20px;
}

.btn-primary {
    display: inline-block;
    background: var(--accent);
    color: white;
    padding: 14px 28px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: #ff8555;
}

footer {
    border-top: 1px solid var(--border);
    padding: 24px 0;
    text-align: center;
    color: var(--muted);
    font-size: 0.9rem;
}

footer a {
    color: var(--accent);
    text-decoration: none;
}

.loading {
    color: var(--muted);
    padding: 40px;
    text-align: center;
}

/* Badge */
.badge {
    background: var(--accent);
    color: white;
    font-size: 0.9rem;
    padding: 4px 12px;
    border-radius: 20px;
    vertical-align: middle;
    margin-left: 8px;
}

/* Forms */
form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 400px;
}

input, button {
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text);
    font-size: 1rem;
}

input:focus {
    outline: none;
    border-color: var(--accent);
}

button {
    background: var(--accent);
    color: white;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}

button:hover {
    background: #ff8555;
}

/* Status result */
.status-result {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    margin-top: 16px;
}

.status-result h3 {
    margin-bottom: 12px;
    color: var(--accent);
}

/* Leaderboard */
.leaderboard-row {
    display: grid;
    grid-template-columns: 50px 1fr 100px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    align-items: center;
}

.leaderboard-row .rank {
    color: var(--muted);
    font-weight: 600;
}

.leaderboard-row .name {
    font-weight: 500;
}

.leaderboard-row .points {
    text-align: right;
    color: var(--accent);
    font-weight: 600;
}

/* Note */
.note {
    color: var(--muted);
    font-size: 0.85rem;
    margin-top: 8px;
}

/* Error */
.error {
    color: var(--danger);
    font-weight: 500;
}

/* TOU modal */
.tou-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.tou-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
}
.tou-dialog {
    position: relative;
    background: var(--bg-card, #1a1a2e);
    color: var(--text, #eee);
    max-width: 560px;
    width: 90%;
    max-height: 80vh;
    border-radius: 12px;
    padding: 1.5rem;
    overflow-y: auto;
    border: 1px solid rgba(255,255,255,0.1);
}
.tou-dialog h3 {
    margin-top: 0;
}
.tou-body ul {
    padding-left: 1.2rem;
}
.tou-body li {
    margin-bottom: 0.6rem;
    font-size: 0.9rem;
    line-height: 1.4;
}
.tou-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.25rem;
    justify-content: flex-end;
}
.tou-actions .btn-secondary {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.25);
    color: var(--text, #eee);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
}


/* FAQ */
#faq details {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    padding: 0.9rem 1.1rem;
    margin-bottom: 0.6rem;
}
#faq summary {
    cursor: pointer;
    font-weight: 600;
}
#faq details[open] summary {
    margin-bottom: 0.5rem;
}
#faq p {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.5;
    color: rgba(255,255,255,0.75);
}
footer a {
    color: var(--accent, #7c6ff0);
    text-decoration: none;
}
footer a:hover {
    text-decoration: underline;
}

/* Footer icons */
.footer-icon {
    display: inline-block;
    vertical-align: middle;
    margin-left: 0.6rem;
    opacity: 0.7;
    transition: opacity 0.15s;
}
.footer-icon:hover { opacity: 1; }


/* Header avatar image */
.avatar-img {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: 0 0 0 2px rgba(124,111,240,0.4), 0 4px 16px rgba(0,0,0,0.4);
}


/* Top 10 leaderboard */
#top10 .leaderboard-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.65rem 1rem;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    margin-bottom: 0.5rem;
}
#top10 .rank {
    font-weight: 700;
    color: var(--accent, #7c6ff0);
    min-width: 3rem;
}
#top10 .name { flex: 1; font-weight: 600; }
#top10 .points { color: rgba(255,255,255,0.6); font-size: 0.9rem; }

/* Hero emphasis for the status section */
#check-status {
    background: rgba(124,111,240,0.06);
    border: 1px solid rgba(124,111,240,0.25);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}
