:root {
    color-scheme: dark;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    font-feature-settings: "ss01" on, "cv11" on;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* ---- Focus ring ---- */
:focus-visible {
    outline: 2px solid rgba(76, 138, 255, 0.7);
    outline-offset: 2px;
}

/* ---- Components ---- */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    height: 2.75rem;
    padding: 0 1.25rem;
    border-radius: 0.75rem;
    background: #4c8aff;
    color: #0a0b0e;
    font-size: 0.875rem;
    font-weight: 600;
    transition: background-color 0.15s ease;
}

.btn-primary:hover {
    background: #3e78f0;
}

.btn-primary:active {
    background: #3569d6;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 2.75rem;
    padding: 0 1.25rem;
    border-radius: 0.75rem;
    border: 1px solid #333945;
    background: transparent;
    color: #f2f4f7;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.btn-secondary:hover {
    background: #1a1d23;
    border-color: #404858;
}

.icon-btn {
    display: inline-grid;
    place-items: center;
    height: 2.25rem;
    width: 2.25rem;
    border-radius: 0.75rem;
    color: #9ba3ae;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.icon-btn:hover {
    background: #1a1d23;
    color: #f2f4f7;
}

.icon-btn[aria-pressed="true"] {
    background: rgba(76, 138, 255, 0.14);
    color: #4c8aff;
}

.field {
    height: 2.75rem;
    width: 100%;
    padding: 0 0.875rem;
    border-radius: 0.75rem;
    border: 1px solid #333945;
    background: #131519;
    color: #f2f4f7;
    font-size: 0.875rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field::placeholder {
    color: #6a7280;
}

.field:hover {
    border-color: #404858;
}

.field:focus {
    outline: none;
    border-color: #4c8aff;
    box-shadow: 0 0 0 3px rgba(76, 138, 255, 0.18);
}

.field-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: #9ba3ae;
}

.field.invalid {
    border-color: #f0686b;
    box-shadow: 0 0 0 3px rgba(240, 104, 107, 0.14);
}

.card {
    border-radius: 0.75rem;
    border: 1px solid #24282f;
    background: #131519;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.card:hover {
    border-color: #333945;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    width: 100%;
    padding: 0.625rem 0.75rem;
    border-radius: 0.625rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #f2f4f7;
    text-align: left;
    transition: background-color 0.15s ease;
}

.menu-item:hover {
    background: #24282f;
}

/* ---- Countdown ring ---- */
#countdownRing {
    stroke-dasharray: 69.115;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 1s linear;
}

/* ---- Account card ---- */
.account-code {
    font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;
    font-size: 26px;
    font-weight: 600;
    line-height: 1;
    color: #f2f4f7;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.04em;
}

.card-action {
    display: inline-grid;
    place-items: center;
    height: 2rem;
    width: 2rem;
    border-radius: 0.625rem;
    color: #6a7280;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.card-action:hover {
    background: #24282f;
    color: #f2f4f7;
}

.card-action.danger {
    color: #6a7280;
}

.card-action.danger:hover {
    background: rgba(240, 104, 107, 0.14);
    color: #f0686b;
}

.card-action.danger.confirm {
    background: #f0686b;
    color: #0a0b0e;
}

/* ---- View transition ---- */
.view {
    animation: view-in 0.2s ease;
}

@keyframes view-in {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

/* ---- Dropdown ---- */
.dropdown {
    animation: pop-in 0.14s ease;
}

@keyframes pop-in {
    from {
        opacity: 0;
        transform: scale(0.97) translateY(-4px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-thumb {
    background: #24282f;
    border-radius: 9999px;
    border: 2px solid #0a0b0e;
}

::-webkit-scrollbar-thumb:hover {
    background: #333945;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        transition-duration: 0.001ms !important;
    }
}
