/* ==========================================================================
   Token Theme - base tokens and shared components
   Used by every page built on token_theme. Page specific styles live in
   their own file (e.g. token-auth.css) and only build on these classes.
   ========================================================================== */

:root {
    --tk-bg: #06090f;
    --tk-bg-2: #0b111c;
    --tk-surface: rgba(255, 255, 255, .04);
    --tk-surface-2: rgba(255, 255, 255, .07);
    --tk-border: rgba(255, 255, 255, .09);
    --tk-border-strong: rgba(255, 255, 255, .16);

    --tk-text: #eef1f7;
    --tk-text-2: #a3adc2;
    --tk-muted: #6f7a91;

    --tk-gold: #f7b500;
    --tk-gold-light: #ffd866;
    --tk-gold-deep: #c27c00;
    --tk-green: #2fd27b;
    --tk-danger: #ff6370;
    --tk-danger-bg: rgba(255, 99, 112, .1);

    --tk-gold-gradient: linear-gradient(135deg, #ffe58a 0%, #f7b500 45%, #d98a00 100%);

    --tk-radius: 14px;
    --tk-radius-lg: 22px;
    --tk-shadow: 0 24px 70px rgba(0, 0, 0, .5);
    --tk-font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

/* ---------- Base ---------- */

.tk-body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--tk-font);
    color: var(--tk-text);
    background: var(--tk-bg);
    -webkit-font-smoothing: antialiased;
    color-scheme: dark;
}

    .tk-body a {
        color: var(--tk-gold-light);
        text-decoration: none;
    }

        .tk-body a:hover {
            text-decoration: underline;
        }

    .tk-body ::selection {
        background: rgba(247, 181, 0, .35);
    }

.tk-gradient-text {
    background: var(--tk-gold-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* Fixed background: gold / green glows over a faint ledger grid */
.tk-backdrop {
    position: fixed;
    inset: 0;
    z-index: -1;
    background: radial-gradient(55% 45% at 12% 18%, rgba(247, 181, 0, .17), transparent 62%),
                radial-gradient(45% 45% at 88% 82%, rgba(47, 210, 123, .11), transparent 62%),
                linear-gradient(180deg, var(--tk-bg) 0%, var(--tk-bg-2) 100%);
}

    .tk-backdrop::after {
        content: "";
        position: absolute;
        inset: 0;
        background-image: linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px),
                          linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
        background-size: 56px 56px;
        -webkit-mask-image: radial-gradient(ellipse at center, #000 25%, transparent 75%);
        mask-image: radial-gradient(ellipse at center, #000 25%, transparent 75%);
    }

/* ---------- Surfaces ---------- */

.tk-glass {
    background: linear-gradient(180deg, rgba(255, 255, 255, .075), rgba(255, 255, 255, .025));
    border: 1px solid var(--tk-border);
    border-radius: var(--tk-radius-lg);
    box-shadow: var(--tk-shadow);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
}

.tk-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid rgba(247, 181, 0, .35);
    background: rgba(247, 181, 0, .08);
    color: var(--tk-gold-light);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

    .tk-badge::before {
        content: "";
        width: 7px;
        height: 7px;
        border-radius: 50%;
        background: var(--tk-green);
        box-shadow: 0 0 0 3px rgba(47, 210, 123, .2);
    }

/* ---------- Form fields ---------- */

.tk-field {
    margin-bottom: 18px;
}

.tk-label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--tk-text-2);
}

.tk-input {
    position: relative;
}

    .tk-input > svg {
        position: absolute;
        left: 16px;
        top: 50%;
        width: 18px;
        height: 18px;
        transform: translateY(-50%);
        color: var(--tk-muted);
        pointer-events: none;
        transition: color .2s;
    }

    .tk-input input {
        width: 100%;
        height: 52px;
        padding: 0 48px;
        border: 1px solid var(--tk-border-strong);
        border-radius: var(--tk-radius);
        background: rgba(6, 9, 15, .55);
        color: var(--tk-text);
        font: inherit;
        font-size: 15px;
        outline: none;
        transition: border-color .2s, box-shadow .2s, background .2s;
    }

        .tk-input input::placeholder {
            color: var(--tk-muted);
        }

        .tk-input input:focus {
            border-color: var(--tk-gold);
            background: rgba(6, 9, 15, .8);
            box-shadow: 0 0 0 4px rgba(247, 181, 0, .15);
        }

        .tk-input input:-webkit-autofill {
            -webkit-text-fill-color: var(--tk-text);
            -webkit-box-shadow: 0 0 0 100px #0c121d inset;
            caret-color: var(--tk-text);
        }

    .tk-input:focus-within > svg {
        color: var(--tk-gold);
    }

    .tk-input input.input-validation-error {
        border-color: var(--tk-danger);
    }

/* input without a leading icon */
.tk-control {
    width: 100%;
    height: 50px;
    padding: 0 16px;
    border: 1px solid var(--tk-border-strong);
    border-radius: var(--tk-radius);
    background: rgba(6, 9, 15, .55);
    color: var(--tk-text);
    font: inherit;
    font-size: 15px;
    outline: none;
    transition: border-color .2s, box-shadow .2s, background .2s;
}

    .tk-control::placeholder {
        color: var(--tk-muted);
    }

    .tk-control:focus {
        border-color: var(--tk-gold);
        background: rgba(6, 9, 15, .8);
        box-shadow: 0 0 0 4px rgba(247, 181, 0, .15);
    }

    .tk-control.input-validation-error {
        border-color: var(--tk-danger);
    }

.tk-icon-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    width: 38px;
    height: 38px;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--tk-muted);
    cursor: pointer;
}

    .tk-icon-btn:hover {
        color: var(--tk-gold-light);
        background: rgba(255, 255, 255, .06);
    }

    .tk-icon-btn:focus-visible {
        outline: 2px solid var(--tk-gold-light);
        outline-offset: 1px;
    }

    .tk-icon-btn svg {
        width: 18px;
        height: 18px;
    }

/* ASP.NET validation output */
.field-validation-error {
    display: block;
    margin-top: 7px;
    font-size: 13px;
    color: var(--tk-danger);
}

.field-validation-valid,
.validation-summary-valid {
    display: none;
}

.tk-alert,
.validation-summary-errors {
    margin-bottom: 18px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(255, 99, 112, .35);
    background: var(--tk-danger-bg);
    color: #ffb8bf;
    font-size: 14px;
}

    .validation-summary-errors ul {
        margin: 0;
        padding-left: 18px;
    }

/* ---------- Buttons ---------- */

.tk-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 52px;
    padding: 0 24px;
    border: 0;
    border-radius: var(--tk-radius);
    font: inherit;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: transform .15s, box-shadow .2s, filter .2s;
}

    .tk-btn svg {
        width: 18px;
        height: 18px;
    }

    .tk-btn:focus-visible {
        outline: 2px solid var(--tk-gold-light);
        outline-offset: 3px;
    }

    .tk-btn[disabled] {
        cursor: not-allowed;
        opacity: .85;
        transform: none !important;
    }

.tk-btn-gold,
.tk-body a.tk-btn-gold {
    background: var(--tk-gold-gradient);
    color: #1d1300;
    text-decoration: none;
    box-shadow: 0 10px 30px rgba(247, 181, 0, .28);
}

    .tk-btn-gold:hover {
        transform: translateY(-1px);
        box-shadow: 0 14px 36px rgba(247, 181, 0, .38);
        filter: brightness(1.04);
    }

.tk-btn-block {
    width: 100%;
}

.tk-spinner {
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(29, 19, 0, .25);
    border-top-color: #1d1300;
    border-radius: 50%;
    animation: tk-spin .7s linear infinite;
}

.tk-btn-ghost {
    height: 44px;
    padding: 0 18px;
    border: 1px solid var(--tk-border-strong);
    background: var(--tk-surface);
    color: var(--tk-text) !important;
    font-size: 14px;
    text-decoration: none !important;
}

    .tk-btn-ghost:hover {
        border-color: rgba(247, 181, 0, .5);
        background: var(--tk-surface-2);
    }

.tk-btn-sm {
    height: 44px;
    padding: 0 18px;
    font-size: 14px;
    text-decoration: none !important;
}

/* ---------- Toast notifications (TempData) ---------- */

.tk-toast-stack {
    position: fixed;
    top: 18px;
    left: 50%;
    z-index: 100;
    display: grid;
    gap: 10px;
    width: min(440px, calc(100% - 32px));
    transform: translateX(-50%);
}

.tk-toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 14px 14px 16px;
    border-radius: 14px;
    border: 1px solid var(--tk-border-strong);
    background: rgba(14, 20, 32, .96);
    box-shadow: var(--tk-shadow);
    font-size: 14px;
    line-height: 1.45;
    animation: tk-toast-in .25s ease-out;
}

    .tk-toast > svg {
        flex: none;
        width: 20px;
        height: 20px;
        margin-top: 1px;
    }

    .tk-toast span {
        flex: 1;
    }

.tk-toast-success {
    border-color: rgba(47, 210, 123, .4);
}

    .tk-toast-success > svg {
        color: var(--tk-green);
    }

.tk-toast-error {
    border-color: rgba(255, 99, 112, .45);
}

    .tk-toast-error > svg {
        color: var(--tk-danger);
    }

.tk-toast-warning {
    border-color: rgba(247, 181, 0, .45);
}

    .tk-toast-warning > svg {
        color: var(--tk-gold);
    }

.tk-toast-close {
    flex: none;
    width: 26px;
    height: 26px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--tk-muted);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

    .tk-toast-close:hover {
        color: var(--tk-text);
        background: var(--tk-surface-2);
    }

.tk-toast.is-hiding {
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity .25s, transform .25s;
}

@keyframes tk-toast-in {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
}

/* ---------- Motion ---------- */

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

/* gentle hover of a coin, tilting without flipping (a flipped face would mirror its letter) */
@keyframes tk-float {
    0%, 100% {
        transform: translateY(0) rotateY(-18deg);
    }

    50% {
        transform: translateY(-14px) rotateY(18deg);
    }
}

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