:root {
    --bg: #f5f7fb;
    --surface: #ffffff;
    --text: #0f172a;
    --muted: #64748b;
    --border: #e2e8f0;
    --primary: #2bb7f0;
    --primary-deep: #1b8ec0;
    --accent: #3be3c6;
    --danger-bg: #fee2e2;
    --danger-text: #991b1b;
    --radius: 14px;
    --radius-lg: 20px;
    --shadow: 0 20px 60px rgba(15, 23, 42, 0.08);
    --shadow-hover: 0 28px 70px rgba(15, 23, 42, 0.14);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    color: var(--text);
    background: var(--bg);
    min-height: 100vh;
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary-deep); }

/* ---------- Auth (login) ---------- */
body.auth {
    display: grid;
    place-items: center;
    padding: 24px;
    background: radial-gradient(1200px 800px at 20% 0%, #d2f7ee 0%, transparent 50%),
                radial-gradient(1000px 700px at 100% 100%, #bde6fb 0%, transparent 55%),
                var(--bg);
}

.card {
    background: var(--surface);
    width: 100%;
    max-width: 440px;
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

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

.logo {
    width: 72px;
    height: 72px;
    margin-bottom: 14px;
    filter: drop-shadow(0 8px 18px rgba(43, 183, 240, 0.25));
}

.card h1 {
    margin: 0 0 6px;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.subtitle {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

form label {
    display: block;
    margin: 18px 0 6px;
    font-weight: 600;
    font-size: 13px;
    color: var(--text);
}

form input[type="text"],
form input[type="password"] {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
    background: #fbfbfd;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

form input:focus {
    outline: none;
    background: #fff;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(43, 183, 240, 0.15);
}

.cf-turnstile {
    margin: 22px 0 18px;
    display: flex;
    justify-content: center;
}

button.primary {
    width: 100%;
    padding: 13px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--primary) 100%);
    color: #fff;
    border: 0;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.2s, filter 0.2s;
    box-shadow: 0 10px 24px rgba(43, 183, 240, 0.25);
}

button.primary:hover { filter: brightness(1.05); box-shadow: 0 14px 30px rgba(43, 183, 240, 0.3); }
button.primary:active { transform: translateY(1px); }
button.primary:disabled { cursor: not-allowed; opacity: 0.85; }

button.primary .spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    margin-left: 8px;
    vertical-align: middle;
}

button.primary.loading .label { opacity: 0.6; }
button.primary.loading .spinner { display: inline-block; }

@keyframes spin { to { transform: rotate(360deg); } }

.alert {
    background: var(--danger-bg);
    color: var(--danger-text);
    padding: 11px 14px;
    border-radius: 10px;
    font-size: 14px;
    margin-bottom: 4px;
    border: 1px solid rgba(153, 27, 27, 0.15);
}

.muted {
    color: var(--muted);
    font-size: 13px;
    text-align: center;
    margin-top: 22px;
}
.muted a { text-decoration: none; }
.muted a:hover { text-decoration: underline; }

/* ---------- Topbar (dashboard) ---------- */
.topbar {
    background: #0f172a;
    color: #fff;
}
.topbar-inner {
    max-width: 1080px;
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    letter-spacing: 0.01em;
}
.logo-sm { width: 30px; height: 30px; }
.who {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 14px;
}
.who .name { font-weight: 600; }
.who .upn { color: rgba(255,255,255,0.6); font-size: 13px; }
.logout-form { margin: 0; }
.linklike {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.15s;
}
.linklike:hover { background: rgba(255,255,255,0.08); }

/* ---------- Dashboard layout ---------- */
.shell {
    max-width: 1080px;
    margin: 0 auto;
    padding: 40px 24px 64px;
}
.hero { margin-bottom: 28px; }
.hero h1 {
    margin: 0 0 8px;
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -0.02em;
}
.hero p { margin: 0; color: var(--muted); max-width: 640px; }

.steps {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}
.tile-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
@media (max-width: 640px) {
    .tile-pair { grid-template-columns: 1fr; }
}

.tile {
    position: relative;
    display: block;
    padding: 22px 22px 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s, transform 0.15s, box-shadow 0.2s;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
}
.tile:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}
.tile .step {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--accent), var(--primary));
    color: #0f172a;
    font-weight: 800;
    font-size: 13px;
    margin-bottom: 10px;
}
.tile .t {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 4px;
    letter-spacing: -0.01em;
}
.tile .d {
    color: var(--muted);
    font-size: 14px;
    margin-bottom: 12px;
}
.tile .cta {
    color: var(--primary-deep);
    font-weight: 600;
    font-size: 14px;
}
.tile.primary-tile {
    background: linear-gradient(135deg, #0ea8de 0%, #1b8ec0 100%);
    color: #fff;
    border-color: transparent;
}
.tile.primary-tile .d { color: rgba(255,255,255,0.85); }
.tile.primary-tile .cta { color: #fff; }
.tile.primary-tile .step {
    background: rgba(255,255,255,0.2);
    color: #fff;
}
.tile.ghost { background: transparent; border-style: dashed; box-shadow: none; }
.tile.ghost:hover { background: var(--surface); }

.pagefoot {
    max-width: 1080px;
    margin: 0 auto;
    padding: 20px 24px 32px;
    color: var(--muted);
    font-size: 13px;
    text-align: center;
}
.pagefoot a { color: var(--primary-deep); text-decoration: none; }
