/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 14px;
    line-height: 1.2;
    padding: 12px 22px;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform .12s ease, background-color .12s ease, border-color .12s ease, opacity .12s ease, box-shadow .12s ease;
    text-decoration: none;
    line-height: 1.2;
}

.btn:hover {
    text-decoration: none;
}

.btn:active {
    transform: translateY(1px);
}

.btn:disabled,
.btn.is-disabled {
    opacity: .5;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-primary {
    background: var(--nitro-yellow);
    color: var(--nitro-black);
}

.btn-primary:hover {
    background: #e6c100;
    box-shadow: 0 0 0 4px rgba(255, 214, 0, .15);
}

.btn-secondary {
    background: transparent;
    color: var(--nitro-white);
    border-color: var(--gray-700);
}

.btn-secondary:hover {
    border-color: var(--nitro-yellow);
}

.btn-danger {
    background: var(--danger);
    color: var(--nitro-white);
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn-sm {
    padding: 8px 14px;
    font-size: 13px;
}

.btn-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn .spinner {
    display: none;
}

.btn.is-loading .spinner {
    display: inline-block;
}

.btn.is-loading .btn-label {
    opacity: .7;
}

.btn.is-popping {
    animation: nitro-btn-pop .35s ease;
}

@keyframes nitro-btn-pop {
    0% { transform: scale(1); }
    35% { transform: scale(1.045); }
    100% { transform: scale(1); }
}

/* ---------- Checkbox (CSS-drawn, no font glyph dependency) ---------- */
.check-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 19px;
    height: 19px;
    min-width: 19px;
    border: 2px solid currentColor;
    border-radius: 5px;
    flex-shrink: 0;
    transition: background-color .15s ease, border-color .15s ease, transform .2s ease;
}

.check-box::after {
    content: '';
    width: 5px;
    height: 9px;
    margin-top: -2px;
    border: solid var(--nitro-black);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) scale(0);
    transition: transform .15s ease .05s;
}

.check-box.is-checked {
    background: var(--nitro-yellow);
    border-color: var(--nitro-yellow);
    color: var(--nitro-yellow);
    animation: nitro-check-pop .35s ease;
}

.check-box.is-checked::after {
    transform: rotate(45deg) scale(1);
}

@keyframes nitro-check-pop {
    0% { transform: scale(1); }
    40% { transform: scale(1.25); }
    100% { transform: scale(1); }
}

/* ---------- Loading spinner ---------- */
.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: nitro-spin .6s linear infinite;
    opacity: .8;
}

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

/* ---------- Forms ---------- */
.field {
    margin-bottom: 20px;
}

.field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--gray-300);
}

.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field input[type="tel"],
.field input[type="url"],
.field input[type="file"],
.field select,
.field textarea {
    width: 100%;
    background: var(--gray-950);
    border: 1px solid var(--gray-700);
    color: var(--nitro-white);
    font-family: var(--font-body);
    font-size: 14px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    transition: border-color .12s ease;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--nitro-yellow);
}

.field input:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.field .error {
    color: var(--danger);
    font-size: 12px;
    margin-top: 6px;
}

.field .help {
    color: var(--gray-600);
    font-size: 12px;
    margin-top: 6px;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--gray-300);
}

.form-status {
    background: rgba(46, 204, 113, .12);
    border: 1px solid var(--success);
    color: var(--success);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 20px;
}

.form-status--error {
    background: rgba(255, 75, 75, .12);
    border-color: var(--danger);
    color: var(--danger);
}

/* ---------- Cards ---------- */
.card {
    background: var(--gray-900);
    border: 1px solid var(--gray-800);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.card-title {
    font-family: var(--font-title);
    font-weight: 900;
    font-size: 15px;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--gray-300);
    margin-bottom: 16px;
}

/* ---------- Badges ---------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.badge-yellow { background: rgba(255, 214, 0, .15); color: var(--nitro-yellow); }
.badge-green { background: rgba(46, 204, 113, .15); color: var(--success); }
.badge-gray { background: var(--gray-800); color: var(--gray-300); }
.badge-red { background: rgba(255, 75, 75, .15); color: var(--danger); }

/* ---------- Progress bar ---------- */
.progress {
    display: block;
}

.progress-track {
    background: var(--gray-800);
    border-radius: 999px;
    height: 10px;
    overflow: hidden;
}

.progress-fill {
    background: var(--nitro-yellow);
    height: 100%;
    border-radius: 999px;
    transition: width .3s ease;
}

.progress-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--gray-600);
    margin-top: 8px;
}

/* ---------- Empty state ---------- */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--gray-300);
}

.empty-state h3 {
    font-size: 18px;
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--gray-600);
    margin-bottom: 20px;
}

/* ---------- Modal ---------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 20px;
}

.modal-overlay.is-open {
    display: flex;
}

.modal {
    background: var(--gray-900);
    border: 1px solid var(--gray-800);
    border-radius: var(--radius-lg);
    max-width: 480px;
    width: 100%;
    padding: 28px;
}

/* ---------- Toast ---------- */
.nitro-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--nitro-yellow);
    color: var(--nitro-black);
    font-weight: 600;
    font-size: 13px;
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .4);
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
    z-index: 200;
}

.nitro-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ---------- NitroPoints / badges ---------- */
.nitro-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform .2s ease, opacity .2s ease;
}

.nitro-badge:hover {
    transform: translateY(-2px) scale(1.04);
}

.nitro-points-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--gray-900);
    border: 1px solid var(--gray-800);
    border-radius: 999px;
    padding: 6px 16px 6px 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--nitro-white);
    text-decoration: none;
    transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}

.nitro-points-pill:hover {
    border-color: var(--nitro-yellow);
    box-shadow: 0 0 0 1px rgba(255, 214, 0, .35);
    transform: translateY(-1px);
}

.nitro-points-pill .bolt {
    color: var(--nitro-yellow);
}

/* ---------- NitroPoints hero (dashboard) ---------- */
.nitro-hero {
    background: radial-gradient(circle at 15% 20%, rgba(255, 214, 0, .07) 0%, transparent 45%), linear-gradient(135deg, var(--gray-900) 0%, var(--gray-950) 100%);
    border: 1px solid var(--gray-800);
    border-radius: var(--radius-lg);
    padding: 28px;
}

.nitro-hero-main {
    display: flex;
    gap: 24px;
    align-items: center;
    flex-wrap: wrap;
}

.nitro-hero-badge-wrap {
    position: relative;
    flex-shrink: 0;
}

.nitro-hero-badge {
    filter: drop-shadow(0 0 18px rgba(255, 214, 0, .35));
    animation: nitro-hero-pulse 3.5s ease-in-out infinite;
}

@keyframes nitro-hero-pulse {
    0%, 100% { filter: drop-shadow(0 0 12px rgba(255, 214, 0, .25)); }
    50% { filter: drop-shadow(0 0 22px rgba(255, 214, 0, .5)); }
}

@media (prefers-reduced-motion: reduce) {
    .nitro-hero-badge {
        animation: none;
    }
}

.nitro-hero-info {
    flex: 1;
    min-width: 240px;
}

.nitro-hero-eyebrow {
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--gray-600);
    margin-bottom: 2px;
}

.nitro-hero-level-name {
    font-family: var(--font-title);
    font-size: 26px;
    font-weight: 800;
    margin: 0 0 4px;
    color: var(--nitro-white);
}

.nitro-hero-points {
    font-size: 14px;
    color: var(--gray-300);
    margin-bottom: 14px;
}

.nitro-hero-points strong {
    color: var(--nitro-yellow);
    font-size: 16px;
}

.nitro-hero-progress .progress-track {
    height: 12px;
}

.nitro-hero-progress .progress-fill {
    background: linear-gradient(90deg, #FFB020 0%, var(--nitro-yellow) 100%);
}

.nitro-hero-message {
    font-size: 13px;
    color: var(--gray-300);
    margin: 10px 0 0;
}

.nitro-hero-message strong {
    color: var(--nitro-white);
}

.nitro-hero-next {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
    padding: 14px 18px;
    border: 1px dashed var(--gray-700);
    border-radius: var(--radius-md);
    text-decoration: none;
    flex-shrink: 0;
    transition: border-color .15s ease, background .15s ease;
}

.nitro-hero-next:hover {
    border-color: var(--nitro-yellow);
    background: rgba(255, 214, 0, .05);
}

.nitro-hero-next-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--gray-600);
}

.nitro-hero-next-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-300);
}

.nitro-hero-movements {
    margin-top: 20px;
    border-top: 1px solid var(--gray-800);
    padding-top: 16px;
}

/* ---------- Level trail ---------- */
.nitro-trail {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    margin-top: 26px;
    padding-top: 22px;
    border-top: 1px solid var(--gray-800);
}

.nitro-trail-step {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-align: center;
    padding: 0 4px;
    opacity: .55;
}

.nitro-trail-step .nitro-badge {
    position: relative;
    z-index: 1;
}

.nitro-trail-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 18px;
    left: 50%;
    width: 100%;
    height: 2px;
    background: var(--gray-800);
    z-index: 0;
}

.nitro-trail-step.is-unlocked:not(:last-child)::after {
    background: var(--nitro-yellow);
}

.nitro-trail-step.is-unlocked {
    opacity: 1;
}

.nitro-trail-step.is-current .nitro-badge {
    filter: drop-shadow(0 0 10px rgba(255, 214, 0, .55));
}

.nitro-trail-name {
    font-size: 11px;
    font-weight: 600;
    color: var(--gray-300);
    line-height: 1.2;
}

.nitro-trail-tag {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--nitro-black);
    background: var(--nitro-yellow);
    border-radius: 999px;
    padding: 1px 8px;
    position: relative;
    z-index: 1;
}

.nitro-trail-check {
    font-size: 11px;
    font-weight: 700;
    color: var(--success);
    position: relative;
    z-index: 1;
}

.badge-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
}

.badge-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
    padding: 16px 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--gray-800);
    background: var(--gray-900);
    position: relative;
}

.badge-tile.is-current {
    border-color: var(--nitro-yellow);
    box-shadow: 0 0 0 1px var(--nitro-yellow);
}

.badge-tile .badge-name {
    font-weight: 600;
    font-size: 13px;
}

.badge-tile .badge-meta {
    font-size: 11px;
    color: var(--gray-600);
}

/* ---------- Announcements ---------- */
.announcement-board {
    display: grid;
    gap: 16px;
}

.announcement-card {
    display: flex;
    gap: 16px;
    background: var(--gray-900);
    border: 1px solid var(--gray-800);
    border-radius: var(--radius-lg);
    padding: 20px;
    align-items: flex-start;
}

.announcement-card.is-featured {
    border-color: var(--nitro-yellow);
    background: linear-gradient(135deg, rgba(255, 214, 0, .08) 0%, var(--gray-900) 60%);
}

.announcement-card img {
    width: 84px;
    height: 84px;
    border-radius: var(--radius-md);
    object-fit: cover;
    flex-shrink: 0;
}

.announcement-card .announcement-body {
    flex: 1;
    min-width: 0;
}

.announcement-card h4 {
    margin: 0 0 4px;
    font-size: 15px;
}

.announcement-card p {
    color: var(--gray-300);
    font-size: 13px;
    margin-bottom: 10px;
}

/* ---------- App shell ---------- */
.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 240px;
    flex-shrink: 0;
    background: var(--gray-950);
    border-right: 1px solid var(--gray-800);
    padding: 24px 16px;
    position: sticky;
    top: 0;
    height: 100vh;
}

.sidebar-logo {
    font-family: var(--font-title);
    font-weight: 900;
    font-size: 18px;
    color: var(--nitro-white);
    padding: 0 12px 24px;
}

.sidebar-logo span {
    color: var(--nitro-yellow);
}

.sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--gray-300);
    font-size: 14px;
    font-weight: 500;
    padding: 11px 12px;
    border-radius: var(--radius-sm);
    border-left: 2px solid transparent;
    text-decoration: none;
    transition: background-color .18s ease, color .18s ease, border-color .18s ease;
}

.sidebar-nav a svg {
    flex-shrink: 0;
}

.sidebar-nav a:hover {
    background: var(--gray-900);
    color: var(--nitro-white);
    text-decoration: none;
}

.sidebar-nav a.is-active {
    background: rgba(255, 214, 0, .08);
    border-left-color: var(--nitro-yellow);
    color: var(--nitro-yellow);
}

.app-main {
    flex: 1;
    min-width: 0;
}

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 32px;
    border-bottom: 1px solid var(--gray-800);
}

.app-header-user {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gray-800);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--nitro-yellow);
    object-fit: cover;
    overflow: hidden;
}

.app-content {
    padding: 32px;
    max-width: 1320px;
    margin: 0 auto;
}

.menu-toggle {
    display: none;
    background: transparent;
    border: none;
    color: var(--nitro-white);
    font-size: 22px;
    cursor: pointer;
}

@media (max-width: 900px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        z-index: 50;
        transform: translateX(-100%);
        transition: transform .2s ease;
    }

    .sidebar.is-open {
        transform: translateX(0);
    }

    .menu-toggle {
        display: block;
    }

    .app-content {
        padding: 20px;
    }

    .app-header {
        padding: 16px 20px;
    }
}
