/* Inter 800 and the mono weights above 400 are used all over the site; without
   them here the browser synthesises fake bold. Loading the families from the
   template <head> with a preconnect is faster and should replace this import. */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;700;800&display=swap');

/* Design tokens. Everything new is expressed with these; the names without an
   `am-` prefix predate the Amethyst palette and are kept because templates and
   older rules still reference them. */
:root {
    --bg-darkest: #05070a;
    --bg-card: #0d0918;
    --bg-nav: rgba(11, 7, 22, 0.8);
    --accent-blue: #a855f7;
    --accent-glow: rgba(168, 85, 247, 0.3);
    --text-main: #edeff2;
    --text-dim: #9ba1a6;
    --border-color: rgba(255, 255, 255, 0.05);
    --success: #00ff88;
    --danger: #ff4d4d;
    --warning: #ffc107;

    /* brand palette */
    --am-bg: #06040d;
    --am-violet: #7c3aed;
    --am-purple: #a855f7;
    --am-orchid: #c084fc;
    --am-pink: #ec4899;
    --am-pink-soft: #f472b6;
    --am-grad: linear-gradient(135deg, #7c3aed 0%, #a855f7 45%, #ec4899 100%);
    --am-grad-soft: linear-gradient(135deg, rgba(124, 58, 237, .16), rgba(236, 72, 153, .16));

    /* surfaces + text */
    --am-surface: rgba(168, 85, 247, .04);
    --am-surface-2: rgba(255, 255, 255, .03);
    --am-surface-3: rgba(13, 9, 24, .96);
    --am-border: rgba(168, 85, 247, .18);
    --am-border-strong: rgba(168, 85, 247, .38);
    --am-text-mute: #6b7280;

    /* semantic */
    --am-ok: #22c55e;
    --am-ok-soft: rgba(34, 197, 94, .12);
    --am-danger: #ef4444;
    --am-danger-soft: rgba(239, 68, 68, .12);
    --am-warn: #f59e0b;
    --am-warn-soft: rgba(245, 158, 11, .12);
    --am-info: #38bdf8;
    --am-info-soft: rgba(56, 189, 248, .12);
    /* admin/fragments/invoices.html references this name; without it the
       colour resolved to nothing and the text inherited. */
    --accent-orange: #f59e0b;

    /* third-party brand colours, only for buttons that must be recognisable */
    --am-discord: #5865F2;
    --am-paypal: #0079C1;

    /* spacing */
    --sp-1: .25rem;
    --sp-2: .5rem;
    --sp-3: .75rem;
    --sp-4: 1rem;
    --sp-5: 1.5rem;
    --sp-6: 2rem;
    --sp-7: 3rem;
    --sp-8: 4rem;

    /* radius */
    --r-sm: 8px;
    --r-md: 12px;
    --r-lg: 16px;
    --r-xl: 24px;
    --r-pill: 999px;

    /* elevation */
    --sh-1: 0 4px 14px rgba(0, 0, 0, .35);
    --sh-2: 0 10px 30px rgba(0, 0, 0, .5);
    --sh-3: 0 30px 100px rgba(0, 0, 0, .5);
    --sh-glow: 0 10px 30px rgba(168, 85, 247, .35);

    /* type */
    --ff-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --ff-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
    --fs-xs: .75rem;
    --fs-sm: .875rem;
    --fs-md: 1rem;
    --fs-lg: 1.125rem;
    --fs-xl: 1.375rem;
    --fs-2xl: 1.75rem;
    --fs-3xl: 2.25rem;
    --fs-4xl: 3rem;

    /* stacking order */
    --z-sticky: 100;
    --z-header: 1000;
    --z-overlay: 5000;
    --z-modal: 9000;
    --z-toast: 9500;

    /* layout metrics. --header-h is rewritten by script when the sticky header
       grows (banners stack inside it), so fixed elements below it stay clear. */
    --header-h: 64px;
    --sidebar-w: 280px;

    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

    color-scheme: dark;
}

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

.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
}

/* Altcha Widget Styling */
altcha-widget {
    --altcha-max-width: 100%;
    --altcha-border-width: 1px;
    --altcha-border-radius: 8px;
    --altcha-color-base: transparent;
    --altcha-color-border: var(--border-color);
    --altcha-color-text: var(--text-main);
    --altcha-color-border-focus: var(--accent-blue);
    --altcha-color-footer-bg: transparent;
    --altcha-color-error-text: var(--danger);
    display: block;
}

altcha-widget div {
    margin-bottom: 0 !important;
}

altcha-widget .altcha-main {
    padding: 1.2rem 1.5rem !important;
    gap: 1rem !important;
    display: flex !important;
    align-items: center !important;
}

altcha-widget .altcha-checkbox {
    width: 24px !important;
    height: 24px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
}

altcha-widget input[type="checkbox"] {
    width: 24px !important;
    height: 24px !important;
    background-color: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 4px !important;
    margin: 0 !important;
    cursor: pointer;
    accent-color: var(--accent-blue);
}

altcha-widget .altcha-label {
    font-size: 0.95rem !important;
    display: flex !important;
    align-items: center !important;
    margin: 0 !important;
    line-height: 1 !important;
}

altcha-widget:focus-within input[type="checkbox"] {
    border-color: var(--accent-blue) !important;
}

/* obfuscated text input — replaces type=password to avoid browser save-password prompts */
.obfuscated-secret {
    -webkit-text-security: disc;
    font-family: inherit !important;
    letter-spacing: 2px;
}

/* Only locks scrolling. The dimming used to live on body::before, which is the
   same pseudo-element the aurora backdrop uses further down the file: opening a
   modal lifted the aurora above the page instead of dimming it, and pages that
   never toggle this class got no backdrop at all. The backdrop now belongs to
   .modal-overlay itself. */
body.modal-active {
    overflow: hidden;
}

body.modal-active .container,
body.modal-active .admin-sidebar,
body.modal-active .admin-main,
body.modal-active .auth-card {
    pointer-events: none;
    user-select: none;
}

/* role colors */
.role-admin {
    color: #ff4d4d !important;
    font-weight: 700;
}

.role-support {
    color: #ffaa00 !important;
    font-weight: 600;
}

.role-customer {
    color: #ec4899 !important;
    font-weight: 600;
}

.role-user {
    color: #fff !important;
}

* {
    box-sizing: border-box;
}

/* This used to sit on `*`, which made the browser track four animatable
   properties — including transform — on every single node in the document.
   Scoped to the elements that actually have hover/focus states; the visual
   result is the same, the per-frame cost is not. */
a, button, input, select, textarea, summary, label,
.btn, .card, .feature-card, .product-card, .chip, .am-chip,
.nav-links a, .nav-links button, .dropdown-item, .cv-box,
[role="button"], [data-click-verify] {
    transition: background 0.2s ease, border 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.manage-user-grid {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    column-gap: 2rem;
    row-gap: 0;
}

select,
option {
    transition: none !important;
}

html {
    background-color: var(--am-bg) !important;
}

body {
    background-color: var(--am-bg) !important;
    color: var(--text-main);
    font-family: var(--ff-sans);
    margin: 0;
    line-height: 1.6;
    background-image:
        radial-gradient(circle at 50% 0%, rgba(168, 85, 247, 0.15), transparent 40%),
        radial-gradient(circle at 100% 0%, rgba(168, 85, 247, 0.05), transparent 30%) !important;
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    scrollbar-gutter: stable;
    overflow-x: hidden;
    max-width: 100vw;
}

/* animate only the content, not the sticky header or fixed sidebar wrappers */
main,
.container:not(header .container),
.admin-main,
.auth-card {
    animation: pageFadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes pageFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* glassmorphism navigation */
header {
    background-color: transparent;
    /* remove background, keep only blur */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 0.2rem 5%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: var(--z-header);
}

.logo {
    font-weight: 800;
    font-size: 1.3rem;
    letter-spacing: -0.5px;
    text-decoration: none !important;
    color: #fff !important;
    display: flex;
    align-items: center;
}

.logo:hover {
    text-decoration: none !important;
}

.logo img {
    height: 40px;
    width: 40px;
    border-radius: 8px;
    object-fit: cover;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-links a,
.nav-links button {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    background: none;
    border: none;
    padding: 0.3rem 0;
    cursor: pointer;
    position: relative;
    display: inline-flex;
    align-items: center;
    line-height: 1.2;
}

.nav-links a:hover,
.nav-links button:hover {
    color: #fff;
    text-decoration: none;
}

/* underline only for standard links, not buttons */
.nav-links a:not(.btn-nav):not(.btn-primary)::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-blue);
    transition: width 0.3s ease;
}

.nav-links a:not(.btn-nav):not(.btn-primary):hover::after {
    width: 100%;
}

/* Sizing only. The fill lives with the other button variants so a semantic
   override (or an inline colour) is not fighting a more specific selector. */
.nav-links .btn-nav {
    color: #fff !important;
    padding: 0.5rem 1.2rem;
    border-radius: var(--r-sm);
    border: none;
    font-weight: 600;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--sp-6);
    width: 100%;
}

.flex-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
}

/* modern card design */
.card {
    border: 1px solid var(--border-color);
    border-radius: var(--r-md);
    padding: 2.5rem;
    margin-bottom: var(--sp-6);
    box-shadow: var(--sh-2);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-blue), transparent);
    opacity: 0.3;
}

h1,
h2,
h3 {
    margin-top: 0;
    letter-spacing: -0.5px;
}

a {
    color: var(--accent-blue);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: #fff;
    text-decoration: underline;
}

/* sleek inputs */
input,
select,
textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: #fff;
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
    margin-top: 0.5rem;
    color-scheme: dark;
    transition: all 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--accent-blue);
    background-color: rgba(255, 255, 255, 0.03);
    box-shadow: 0 0 0 4px var(--accent-glow);
}

select option {
    background-color: #150f24;
    color: #fff;
}

/* buttons — variants live in the component layer at the end of the file */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-2);
    padding: 0.8rem var(--sp-5);
    border-radius: var(--r-sm);
    font-weight: 600;
    cursor: pointer;
    border: none;
    text-align: center;
    font-size: 0.95rem;
    text-decoration: none;
    white-space: nowrap;
    /* Was `transition: none !important`, which made every hover state except
       the primary one snap, because the theme layer re-enabled it there. */
    transition: background 0.2s ease, background-position 0.5s ease, border-color 0.2s ease, box-shadow 0.3s ease, color 0.2s ease, transform 0.12s ease;
}

.btn-discord {
    background-color: #5865F2;
    color: #fff !important;
    gap: 0.75rem;
}

.btn-discord:hover {
    background-color: #4752C4;
    box-shadow: 0 6px 20px rgba(88, 101, 242, 0.4);
    transform: translateY(-1px);
}

.btn-discord svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* No backdrop-filter here: it promoted every outline button — several per table
   row — to its own compositing layer for an effect nothing could see. */
.btn-outline {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-main);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.25);
    color: #fff;
    transform: translateY(-1px);
}

.btn-small {
    height: 38px;
    padding: 0 1.2rem;
    font-size: var(--fs-sm);
    border-radius: 6px;
}

.btn-danger {
    background-color: var(--danger);
    color: #fff;
}

/* smooth avatar loading */
.avatar-container {
    background-color: rgba(255, 255, 255, 0.03);
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
}

.avatar-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* tables */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
    margin-top: 1rem;
}

/* rich content support */
.rich-content h1,
.rich-content h2,
.rich-content h3 {
    color: #fff;
    margin: 1.5rem 0 1rem 0;
}

.rich-content p {
    margin-bottom: 1rem;
    color: var(--text-dim);
}

.rich-content ul,
.rich-content ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.rich-content li {
    margin-bottom: 0.5rem;
    color: var(--text-dim);
}

.rich-content pre {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.rich-content details {
    background: var(--am-surface-2);
    border: 1px solid var(--border-color);
    border-radius: var(--r-sm);
    padding: var(--sp-4);
    margin-bottom: var(--sp-4);
}

.rich-content summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--accent-blue);
}

.rich-content hr {
    border: 0;
    border-top: 1px solid var(--border-color);
    margin: 2rem 0;
}

.rich-content img {
    max-width: 100%;
    border-radius: 12px;
}

th {
    color: var(--text-dim);
    font-weight: 500;
    font-size: 0.85rem;
    text-transform: uppercase;
    padding: 0 1rem;
    text-align: center;
}

th:first-child,
td:first-child {
    text-align: left;
}

td {
    padding: 1.2rem 1rem;
    background-color: transparent;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    text-align: center;
    vertical-align: middle;
}

td:first-child {
    border-left: 1px solid var(--border-color);
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}

td:last-child {
    border-right: 1px solid var(--border-color);
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
}

code {
    font-family: 'JetBrains Mono', monospace;
    background: rgba(168, 85, 247, 0.1);
    color: var(--accent-blue);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
}

/* alerts */
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.card-placeholder {
    background: transparent;
    border: 1px solid var(--border-color);
    padding: 4rem 2rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
}

.card-placeholder::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-blue), transparent);
    opacity: 0.3;
}

.card-placeholder i,
.card-placeholder .icon {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    opacity: 0.5;
}

.card-placeholder p {
    margin: 0;
    max-width: 400px;
    line-height: 1.6;
}

.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.alert-success {
    background: rgba(0, 255, 136, 0.1);
    color: var(--success);
    border: 1px solid rgba(0, 255, 136, 0.2);
}

.alert-danger {
    background: rgba(255, 77, 77, 0.1);
    color: var(--danger);
    border: 1px solid rgba(255, 77, 77, 0.2);
}

.hero {
    text-align: center;
    padding: 5rem 1rem;
}

.hero h1 {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.hero p {
    color: var(--text-dim);
    font-size: 1.25rem;
    max-width: 600px;
    margin: 0 auto 2.5rem;
}

/* profile settings */
.profile-settings-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 4rem;
}

.profile-avatar-column {
    text-align: center;
    border-right: 1px solid var(--border-color);
    padding-right: 4rem;
}

.profile-input-group {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
}

.profile-input-group input {
    flex: 1;
    margin-top: 0;
}

.profile-input-group button {
    padding: 0.8rem 1.5rem;
}


/* admin dashboard layout */

.admin-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.admin-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.admin-actions-group {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.admin-search-form {
    display: flex;
    gap: 0.5rem;
    margin: 0;
    align-items: stretch;
    flex-wrap: wrap;
}

.admin-search-input {
    padding: 0 1.2rem;
    border-radius: 8px;
    width: 280px;
    max-width: 100%;
    height: 42px;
    margin: 0;
    box-sizing: border-box;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(520px, 1fr));
    gap: 3.5rem;
    margin-top: 3rem;
    justify-content: center;
}

@media (max-width: 1300px) {
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(450px, 1fr));
        gap: 2.5rem;
    }
}

@media (max-width: 992px) {
    .product-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

.dashboard-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.oauth-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.security-settings-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 1fr;
    gap: 2rem;
    margin-top: 2rem;
    align-items: stretch;
}

@media (max-width: 1200px) {
    .security-settings-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.recent-activity-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5rem;
    margin-top: 3rem;
    border-top: 1px solid var(--border-color);
    padding-top: 5rem;
}

.admin-layout {
    display: flex;
    opacity: 0;
}

.admin-layout.ready {
    opacity: 1;
}

.admin-sidebar {
    width: var(--sidebar-w);
    background: transparent;
    border-right: none;
    padding: var(--sp-6) var(--sp-4);
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
}

/* Desktop Stationary Sidebar */
@media (min-width: 769px) {
    /* The offset follows the real header height instead of assuming 64px: the
       header stacks verification/ticket/deletion banners and used to swallow
       the avatar and the first links. */
    .admin-sidebar {
        position: fixed;
        top: var(--header-h);
        left: 0;
        bottom: 0;
        width: var(--sidebar-w);
        max-height: calc(100vh - var(--header-h));
        z-index: var(--z-sticky);
        overflow-y: auto;
    }
    .admin-main {
        margin-left: var(--sidebar-w);
    }
}

/* dynamic footer for admin and dashboard */
@media (min-width: 769px) and (max-width: 1760px) {
    /* apply offset only if sidebar overlaps centered content (1200px + 2*280px = 1760px) */
    .admin-layout ~ .site-footer {
        padding-left: var(--sidebar-w);
    }
}

.admin-sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.8rem 1.2rem;
    color: var(--text-dim);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
}

/* sidebar link leading icon */
.admin-sidebar-link svg.nav-ico {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: 0.7;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.admin-sidebar-link:hover svg.nav-ico,
.admin-sidebar-link.active svg.nav-ico {
    opacity: 1;
    transform: scale(1.08);
}

.admin-sidebar-link:hover,
.admin-sidebar-link.active {
    background: rgba(168, 85, 247, 0.1);
    color: var(--accent-blue);
}

.admin-main {
    flex: 1;
    padding: 3rem;
    background: transparent;
}

.admin-section {
    display: none;
    opacity: 0;
    transform: translateY(8px);
}

.admin-section.active {
    display: block;
    animation: adminFadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.page-fade-in {
    opacity: 0;
    transform: translateY(10px);
    animation: adminFadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes adminFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* product grid & cards */

.product-card {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2.5rem;
    /* Only the three properties the hover state actually changes. `all` made
       the browser watch every animatable property, including layout ones. */
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-blue);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.product-card .card-content {
    flex: 1;
}

.product-card .description {
    color: var(--text-dim);
    font-size: 0.95rem;
    margin: 1rem 0;
    min-height: 3em;
}

.product-card .card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.price-tag {
    font-weight: 800;
    font-size: 1.75rem;
    color: #fff;
}

.button-group {
    display: flex;
    gap: 0.75rem;
}

.btn-stripe {
    background: rgba(103, 114, 229, 0.1);
    border: 1px solid #6772e5;
    color: #fff;
}

.btn-stripe:hover {
    background: #6772e5;
    transform: translateY(-2px);
}

/* modals */
.modal-overlay {
    position: fixed;
    inset: 0;
    display: none;
    justify-content: center;
    align-items: center;
    padding: var(--sp-4);
    z-index: var(--z-modal);
    /* The dim and the blur belong here, not on body::before: the overlay is
       shown on every page, including the auth pages that never toggle
       body.modal-active. */
    background: rgba(6, 4, 13, .62);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-content {
    background: rgba(255, 255, 255, 0.01);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--r-xl);
    padding: var(--sp-5) var(--sp-6);
    width: 95%;
    max-width: 500px;
    /* height/overflow let the panel grow with its content (the user search
       dropdown expands inside it) and scroll instead of leaving the viewport. */
    height: auto;
    max-height: 90vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    box-shadow: var(--sh-3);
    position: relative;
    animation: modalSlideUp 0.4s var(--ease-out) forwards;
}

@media screen and (max-width: 768px) {
    .modal-content {
        padding: 1.25rem;
        margin: 1rem;
        max-height: calc(100vh - 2rem);
    }
}

.modal-title {
    margin-bottom: 0.5rem;
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1.2;
}

@media screen and (max-width: 768px) {
    .modal-title {
        font-size: 1.3rem;
    }
}

/* Opacity and transform only. Animating backdrop-filter re-rasterised the
   whole panel on every frame of every modal open. */
@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Works for the <div class="modal-close"> markup that predates this rule and
   for a real <button>, which is what new markup should use. */
.modal-close {
    position: absolute;
    top: var(--sp-5);
    right: var(--sp-5);
    cursor: pointer;
    color: var(--text-dim);
    font-size: 1.2rem;
    line-height: 1;
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--am-surface-2);
    border: none;
    border-radius: 50%;
    transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.modal-close:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(90deg);
}

.payment-options-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 2rem;
}

.payment-opt {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.25rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
    text-align: left;
    width: 100%;
}

.payment-opt:hover {
    border-color: var(--accent-blue);
    background: rgba(168, 85, 247, 0.05);
}

.payment-opt img {
    width: 32px;
    height: 32px;
}

.payment-opt .opt-text {
    flex: 1;
}

.payment-opt .opt-title {
    display: block;
    font-weight: 600;
    color: #fff;
}

.payment-opt .opt-sub {
    font-size: 0.8rem;
    color: var(--text-dim);
}

/* admin plan management refinement */
.plans-container {
    background: transparent;
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
}

.plan-header-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr 100px;
    gap: 1rem;
    padding: 0 1rem 0.75rem 1rem;
    color: var(--text-dim);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.plan-item-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr 100px;
    gap: 1rem;
    padding: 1rem;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    align-items: center;
}

.plan-item-row:hover {
    border-color: rgba(168, 85, 247, 0.3);
    background: rgba(255, 255, 255, 0.04);
}

/* 1. Modify the form to ensure the wrapper spans the correct column */
.plan-add-form {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr 100px;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    align-items: flex-end;
}

/* Update the wrapper to align properly in the grid */
.price-input-wrapper {
    position: relative;
    display: flex;
    /* Keeps the $ and input on one line */
    align-items: center;
    width: 100%;
    /* Ensure it doesn't create extra height */
    margin: 0;
    padding: 0;
}

/* Ensure the symbol is vertically centered within the wrapper */
.currency-symbol {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    /* Perfectly centers the $ vertically */
    color: var(--text-dim);
    font-size: 0.85rem;
    pointer-events: none;
    z-index: 5;
}

/* Ensure the input itself matches the height of the others */
.price-input-wrapper .plan-input {
    margin: 0 !important;
    /* Removes any top/bottom margin causing it to jump up */
    padding-left: 1.5rem !important;
    display: block;
}

/* forms */
form div {
    margin-bottom: 1.25rem;
}

.auth-card {
    max-width: 450px;
    margin: 8rem auto;
    padding: 3rem;
}

.auth-footer {
    text-align: center;
    margin-top: 2rem;
    color: var(--text-dim);
    font-size: 0.95rem;
}



/* footer */
.site-footer {
    background: transparent;
    padding: 5rem 0 3rem 0;
    margin-top: auto;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    gap: 4rem;
    flex-wrap: wrap;
}

.footer-brand {
    max-width: 350px;
}

.logo-group {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.brand-name {
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
}

.footer-logo {
    height: 48px;
    width: 48px;
    border-radius: 10px;
    object-fit: cover;
}

.footer-brand h2 {
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0;
    color: #fff;
}

.footer-tagline {
    color: var(--text-dim);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-top: 1.5rem;
}

.footer-links {
    display: flex;
    gap: 5rem;
    flex-wrap: wrap;
}

.link-group h4 {
    color: #fff;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 1.5rem;
    font-weight: 700;
}

.link-group a {
    display: block;
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.95rem;
    margin-bottom: 0.8rem;
    transition: color 0.2s ease;
}

.link-group a:hover {
    color: var(--accent-blue);
    text-decoration: none;
}

.footer-bottom {
    margin-top: 5rem;
    padding-top: 2rem;
    text-align: center;
    color: var(--text-dim);
    font-size: 0.85rem;
}

/* base element extraction from index.html */
.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

/* mobile menu button - hidden by default on desktop */
.mobile-menu-btn {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-main);
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1001;
    /* above mobile menu */
}

.mobile-menu-btn:hover {
    color: #fff;
}

/* ========================================================================= */
/* media queries for mobile responsiveness                                   */
/* ========================================================================= */

@media (max-width: 900px) {

    /* header & navigation */
    .mobile-menu-btn {
        display: block;
    }

    /* wrap header inner content to allow stacking of alerts */
    header>div:first-child {
        flex-wrap: wrap;
    }

    header .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: rgba(5, 7, 10, 0.6);
        backdrop-filter: blur(25px);
        -webkit-backdrop-filter: blur(25px);
        flex-direction: column;
        padding: 1.5rem 2rem;
        gap: 0.5rem;
        border-top: 1px solid rgba(255, 255, 255, 0.05);
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
        height: 100vh;
        z-index: 1001;
    }

    header .nav-links.active {
        display: flex;
    }

    header .nav-links a,
    header .nav-links button {
        width: 100%;
        text-align: left;
        padding: 1rem 1.5rem;
        justify-content: flex-start;
        font-size: 1.05rem;
        border-radius: 8px;
        color: #fff !important;
        font-weight: 500;
    }

    header .nav-links a:not(.btn-nav):hover,
    header .nav-links button:not(.btn-nav):hover {
        background: rgba(255, 255, 255, 0.05);
        text-decoration: none;
    }

    header .nav-links a:not(.btn-nav):not(.btn-primary)::after {
        display: none !important;
    }

    .nav-links .btn-nav {
        text-align: center;
        justify-content: center;
        margin-top: 0.5rem;
    }
}

@media (max-width: 768px) {

    /* global adjustments */
    .container {
        padding: 0 1.5rem;
        max-width: 100vw;
        overflow-x: hidden;
    }

    .card {
        padding: 1.5rem;
        max-width: 100vw;
        box-sizing: border-box;
        display: flex;
        flex-direction: column;
    }

    /* hero section */
    .hero {
        padding: 6rem 1rem 4rem 1rem !important;
        /* override inline styles on index.html */
    }

    section[style*="padding: 12rem"] {
        padding: 6rem 1rem 4rem 1rem !important;
    }

    section[style*="padding: 2rem 0 10rem"] {
        padding: 2rem 0 4rem 0 !important;
    }

    .hero h1,
    h1[style*="font-size: 4.5rem"] {
        font-size: 2.8rem !important;
        margin-bottom: 1rem;
    }

    .hero p,
    p[style*="font-size: 1.25rem"] {
        font-size: 1rem !important;
        padding: 0 1rem;
        margin-bottom: 2rem !important;
    }

    div[style*="margin-bottom: 3.5rem"] h2 {
        font-size: 2.2rem !important;
    }

    /* grids */
    .features-grid,
    .product-grid,
    .oauth-grid,
    .profile-settings-grid,
    .security-settings-grid,
    .recent-activity-grid,
    .settings-grid {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }

    .profile-avatar-column {
        border-right: none !important;
        border-bottom: 1px solid var(--border-color);
        padding-right: 0 !important;
        padding-bottom: 2rem;
    }

    .profile-input-group {
        flex-direction: column;
        width: 100%;
    }

    .profile-input-group input {
        width: 100%;
        box-sizing: border-box;
    }

    .profile-input-group button {
        width: 100%;
        margin-top: 0.5rem;
        margin-bottom: 0.5rem;
    }

    .feature-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 1.5rem;
    }

    .feature-card[style*="grid-column"] {
        grid-column: 1 / -1 !important;
    }

    /* admin layout */
    .admin-layout {
        flex-direction: column;
        max-width: 100vw;
        box-sizing: border-box;
        overflow-x: hidden;
    }

    .dashboard-header-flex,
    .admin-header-flex {
        flex-direction: column;
        align-items: flex-start;
        margin-bottom: 1.5rem;
        gap: 1rem;
    }

    .admin-actions-group {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .admin-actions-group>* {
        width: 100%;
    }

    .admin-actions-group select,
    .admin-actions-group button {
        width: 100% !important;
    }

    .admin-search-form {
        flex-direction: column;
        width: 100%;
    }

    .admin-search-input {
        width: 100% !important;
    }

    .admin-main {
        padding: 2rem 1.25rem !important;
        /* standardize padding on mobile */
        max-width: 100vw;
        box-sizing: border-box;
        overflow-x: hidden;
    }

    .admin-sidebar {
        width: 100%;
        padding: 1rem 1.5rem;
        flex-direction: row;
        overflow-x: auto;
        border-bottom: 1px solid var(--border-color);
        border-right: none;
        box-sizing: border-box;
        justify-content: flex-start;
        align-items: center;
        gap: 0.5rem;
    }

    .admin-sidebar>div[style*="text-align: center"],
    .admin-sidebar-header {
        display: none !important;
    }

    .admin-sidebar-link {
        white-space: nowrap;
        padding: 0.5rem 1.2rem;
        margin: 0;
        border-radius: 100px;
        background: rgba(255, 255, 255, 0.03);
    }

    .admin-sidebar-link.active {
        background: var(--accent-blue);
        color: #fff;
    }

    .admin-sidebar-submenu {
        display: none;
        flex-direction: row;
        gap: 0.5rem;
        padding: 0 !important;
        margin: 0 !important;
    }

    .admin-sidebar-submenu[style*="display: block"] {
        display: flex !important;
    }

    .admin-sidebar-submenu .admin-sidebar-link {
        border-left: none !important;
        font-size: 0.85rem !important;
    }

    /* forms & auth */
    .auth-card {
        margin: 2rem auto;
        padding: 2rem 1.5rem;
        width: 100%;
        max-width: calc(100vw - 2.5rem);
    }

    /* bleed the scroll container to the screen edges */
    .table-wrap,
    .table-responsive-wrapper {
        margin: var(--sp-4) -1.5rem;
        padding: 0 1.5rem;
        width: auto;
        box-sizing: border-box;
    }

    /* A table narrow enough to fit is better read as rows than as cards, and
       max-content would force a horizontal scroll on the card layout below. */
    .table-wrap>table,
    .table-responsive-wrapper>table {
        min-width: 0;
    }

    /* Each row becomes a card, with the column name coming from the cell's
       data-label. One definition for every table that opts in: .table-cards is
       the name new markup uses, the rest are the tables that already had a
       copy of these rules. */
    .table-cards,
    .table-cards tbody,
    .table-cards tr,
    .table-cards td,
    .logs-table,
    .logs-table tbody,
    .logs-table tr,
    .logs-table td,
    .users-table,
    .users-table tbody,
    .users-table tr,
    .users-table td,
    .licenses-table,
    .licenses-table tbody,
    .licenses-table tr,
    .licenses-table td,
    .recent-logins-table,
    .recent-logins-table tbody,
    .recent-logins-table tr,
    .recent-logins-table td {
        display: block;
        width: 100%;
    }

    .table-cards,
    .logs-table,
    .users-table,
    .licenses-table,
    .recent-logins-table {
        min-width: 0;
    }

    .table-cards thead,
    .logs-table thead,
    .users-table thead,
    .licenses-table thead,
    .recent-logins-table thead {
        display: none;
    }

    .table-cards tr,
    .logs-table tr,
    .users-table tr,
    .licenses-table tr,
    .recent-logins-table tr {
        margin-bottom: var(--sp-5);
        border: 1px solid var(--border-color);
        border-radius: var(--r-lg);
        background: rgba(255, 255, 255, 0.02);
        overflow: hidden;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    }

    .table-cards td,
    .logs-table td,
    .users-table td,
    .licenses-table td,
    .recent-logins-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: var(--sp-4);
        text-align: right;
        padding: 0.9rem 1.25rem;
        border: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        word-break: break-word;
    }

    .table-cards td:last-child,
    .logs-table td:last-child,
    .users-table td:last-child,
    .licenses-table td:last-child,
    .recent-logins-table td:last-child {
        border-bottom: none;
    }

    .table-cards td::before,
    .logs-table td::before,
    .users-table td::before,
    .licenses-table td::before,
    .recent-logins-table td::before {
        content: attr(data-label);
        font-weight: 600;
        text-transform: uppercase;
        font-size: var(--fs-xs);
        letter-spacing: 0.5px;
        color: var(--text-dim);
        text-align: left;
        flex-shrink: 0;
    }

    /* a cell holding only an action reads better full width */
    .table-cards td:last-child .btn,
    .licenses-table td:last-child .btn {
        width: 100%;
    }

    /* modals */
    .modal-content {
        padding: 1.25rem;
        max-height: 95vh;
        overflow-y: auto;
        width: 95%;
        margin: auto;
    }

    .payment-opt {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
        gap: 1rem;
    }

    /* footer */
    .site-footer {
        padding: 3rem 0;
    }

    .footer-content {
        flex-direction: column;
        gap: 2.5rem;
    }

    .footer-links {
        flex-direction: column;
        gap: 2rem;
    }

    .plan-header-grid,
    .plan-item-row,
    .plan-add-form {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .plan-header-grid {
        display: none;
        /* hide headers on mobile */
    }

    .plan-item-row {
        position: relative;
        padding-bottom: 3.5rem;
    }

    .plan-item-row button {
        position: absolute;
        bottom: 1rem;
        left: 1rem;
        right: 1rem;
        width: calc(100% - 2rem);
    }

    .manage-user-grid {
        grid-template-columns: 1fr;
        row-gap: 1.5rem;
        /* tighter gap between identity & edit profile */
    }

    /* shrink identity box vertical padding */
    .manage-user-grid>div>div[style*="background: transparent"] {
        padding: 1.25rem 1rem !important;
    }

    /* shrink profile picture slightly */
    #manage-user-pfp-container {
        width: 80px !important;
        height: 80px !important;
        margin-bottom: 0.5rem !important;
    }

    /* compress user inputs */
    #modal-manage-user input {
        margin-bottom: 0.6rem !important;
        padding: 0.5rem !important;
    }

    /* compress row 2 (actions & restrictions) margin top */
    .manage-user-grid+div,
    #modal-manage-user>div>div>div:nth-child(4),
    #modal-manage-user>div>div>div:nth-child(5) {
        margin-top: 1rem !important;
    }
}

/* --- Custom Dropdown Search System --- */

/* 1. Container - necessary for the results to float correctly */
.custom-dropdown-container {
    position: relative;
    display: flex;
    flex-direction: column;
}

/* 2. The Floating Results Box */
.custom-dropdown-results {
    /* 1. Remove the large gap */
    margin-top: 0.25rem;
    /* Small 4px gap for a clean look */
    padding: 0.5rem;
    /* Tighter internal padding */

    /* 2. Set to absolute to float OVER the button below */
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;

    /* Opaque surface instead of a blur: at 96% alpha there was nothing to see
       through, and the blur cost a compositing layer per open dropdown. */
    background: var(--am-surface-3);
    border: 1px solid var(--border-color);
    border-radius: var(--r-sm);
    box-shadow: var(--sh-2);
    max-height: 200px;
    overflow-y: auto;
    display: none;
    /* Hidden until populated */
}

/* Automatic show when content exists */
.custom-dropdown-results:not(:empty) {
    display: block;
    animation: modalSlideUp 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* 3. Custom Scrollbar Styling (Matches Site Theme) */
.custom-dropdown-results::-webkit-scrollbar {
    width: 6px;
}

.custom-dropdown-results::-webkit-scrollbar-track {
    background: transparent;
}

.custom-dropdown-results::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    border: 1px solid transparent;
}

.custom-dropdown-results::-webkit-scrollbar-thumb:hover {
    background: var(--accent-blue);
}

/* 4. Individual Entry Styling */
.dropdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 4px;
    gap: 1rem;
}

.dropdown-item:last-child {
    margin-bottom: 0;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

/* 5. Typography & Color Hierarchy */
.dropdown-item .user-email {
    color: var(--text-main);
    font-size: 0.95rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.dropdown-item .user-id {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    font-weight: 600;
    /* Forced accent blue as requested */
    color: var(--accent-blue) !important;
    background: rgba(168, 85, 247, 0.12);
    padding: 0.2rem 0.6rem;
    border-radius: 5px;
    border: 1px solid rgba(168, 85, 247, 0.2);
    flex-shrink: 0;
}

/* Interactive States: Swap colors on hover for legibility */
.dropdown-item:hover .user-id {
    color: #fff !important;
    background: var(--accent-blue);
    border-color: var(--accent-blue);
}

/* Empty/No Results State */
.dropdown-no-results {
    padding: 1.5rem;
    text-align: center;
    color: var(--text-dim);
    font-size: 0.9rem;
    font-style: italic;
}

/* Override the dropdown to push the modal height */
#user-dropdown-results.custom-dropdown-results {
    position: relative; /* Changed from absolute */
    top: 0;
    margin-top: 1rem;
    width: 100%;
    /* Ensure the modal doesn't get too tall */
    max-height: 220px;
    overflow-y: auto;
    /* Optional: add a subtle border to separate from the input above */
    border-top: 1px solid var(--border-color);
}

#user-search-filter {
    margin-bottom: 0 !important;
}

@media (max-width: 768px) {
    .trusted-device-item {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 1rem;
    }
    .trusted-device-meta {
        flex-direction: column;
        gap: 0.25rem !important;
        margin-top: 0.25rem;
    }
    .trusted-device-meta-bullet {
        display: none !important;
    }
    .trusted-device-item form {
        margin-left: 0 !important;
        width: 100%;
    }
    .trusted-device-item button {
        width: 100%;
        justify-content: center;
    }
    }

/* Custom Switch Toggle — indented as if it were inside the media query above,
   which it never was. */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.05);
    transition: .3s;
    border: 1px solid var(--border-color);
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: var(--text-dim);
    transition: .3s;
}

input:checked + .slider {
    background-color: rgba(168, 85, 247, 0.1);
    border-color: var(--accent-blue);
}

input:checked + .slider:before {
    transform: translateX(20px);
    background-color: var(--accent-blue);
}

/* keyboard focus has to show on the track, the checkbox itself is invisible */
.switch input:focus-visible + .slider {
    outline: 2px solid var(--am-purple);
    outline-offset: 2px;
}

.slider.round {
    border-radius: var(--r-pill);
}

.slider.round:before {
    border-radius: 50%;
}
/* Small height optimizations for foldables/phones */
@media (max-height: 700px) {
    .modal-content {
        padding: 1rem !important;
        max-height: 98vh !important;
    }
    #btcpay-custom-qr {
        width: 160px !important;
        height: 160px !important;
    }
    .modal-overlay {
        padding: 10px !important;
    }
    .modal-title {
        margin-top: 0 !important;
        margin-bottom: 0.75rem !important;
        font-size: 1.1rem !important;
    }
    #btcpay-method-tabs {
        margin-bottom: 1rem !important;
    }
    #btcpay-custom-content > div {
        margin-bottom: 1rem !important;
    }
    #btcpay-custom-qr-container {
        margin-bottom: 1rem !important;
    }
}

/* ============================================================================
   AMETHYST THEME LAYER — Minecraft utility client redesign
   Appended last on purpose so these rules win the cascade and re-skin every
   page that loads style.css. Purple → pink, glass, glow, animated backdrop.
   ============================================================================ */

/* --- animated aurora + grid backdrop, on every page --- */
html { background: var(--am-bg); }
body { background: transparent !important; position: relative; }

body::before {
    content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
    background:
        radial-gradient(680px circle at 12% -8%, rgba(124, 58, 237, .30), transparent 60%),
        radial-gradient(620px circle at 92% 2%, rgba(236, 72, 153, .20), transparent 58%),
        radial-gradient(560px circle at 60% 108%, rgba(168, 85, 247, .16), transparent 60%);
    animation: am-breathe 16s ease-in-out infinite;
    /* Three viewport-sized radial gradients are expensive to rasterise. Giving
       this its own layer means the breathe animation composites instead of
       repainting the whole background on every frame — which is what made
       scrolling feel heavy. */
    will-change: transform, opacity;
    transform: translateZ(0);
    contain: strict;
}
body::after {
    content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
    contain: strict;
    background-image:
        linear-gradient(rgba(168, 85, 247, .05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(168, 85, 247, .05) 1px, transparent 1px);
    background-size: 60px 60px;
    -webkit-mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 15%, transparent 75%);
    mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 15%, transparent 75%);
}
@keyframes am-breathe {
    0%, 100% { opacity: .9; transform: translateY(0); }
    50%      { opacity: 1; transform: translateY(-12px); }
}

/* --- gradient text + hero --- */
.grad, .gradient-text {
    background: var(--am-grad); -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: transparent;
}
.hx-title .grad { filter: drop-shadow(0 8px 34px rgba(168, 85, 247, .35)); }
.hx-dot { background: var(--am-pink) !important; box-shadow: 0 0 12px var(--am-pink) !important; }
.hx-stat b {
    background: var(--am-grad); -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
}
.sec-tag { color: var(--am-orchid) !important; }

/* --- brand wordmark next to the logo --- */
.am-brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; }
.am-brand img { width: 42px; height: 42px; filter: drop-shadow(0 4px 16px rgba(168, 85, 247, .5)); }
.am-wordmark { display: flex; flex-direction: column; line-height: 1; }
.am-wordmark b {
    font-family: 'JetBrains Mono', monospace; font-size: 1.15rem; font-weight: 800; letter-spacing: .5px;
    background: var(--am-grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.am-wordmark span { font-size: .58rem; font-weight: 700; letter-spacing: .34em; color: var(--text-dim); margin-top: 2px; }

/* --- cards / surfaces --- */
.feature-card { background: rgba(168, 85, 247, .04) !important; border-color: var(--am-border) !important; }
.feature-card::after { background: linear-gradient(90deg, transparent, rgba(236, 72, 153, .6), transparent) !important; }
.feature-card:hover {
    border-color: rgba(236, 72, 153, .45) !important; background: rgba(168, 85, 247, .07) !important;
    box-shadow: 0 20px 52px rgba(124, 58, 237, .28) !important;
}
.icon-box {
    background: var(--am-grad-soft) !important; border: 1px solid rgba(168, 85, 247, .25) !important;
    color: #e9d5ff !important;
}
.hx-badge { background: rgba(168, 85, 247, .06) !important; border-color: var(--am-border) !important; color: #d8b4fe !important; }
.cx-card {
    background: linear-gradient(160deg, rgba(124, 58, 237, .14), rgba(236, 72, 153, .05) 60%) !important;
    border: 1px solid rgba(168, 85, 247, .25) !important;
}

/* --- header glass --- */
header > div:first-child { background: rgba(6, 4, 13, .72) !important; }

/* --- reusable chip + anticheat marquee for new sections --- */
.am-chip {
    display: inline-flex; align-items: center; gap: .45rem; padding: .4rem .85rem; border-radius: 999px;
    font-size: .78rem; font-weight: 600; color: #e9d5ff; background: rgba(168, 85, 247, .1);
    border: 1px solid rgba(168, 85, 247, .25); white-space: nowrap;
}
.am-chip.ok { background: rgba(34, 197, 94, .1); border-color: rgba(34, 197, 94, .3); color: #86efac; }
.am-marquee {
    overflow: hidden;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.am-marquee__t {
    display: flex; gap: .75rem; width: max-content;
    animation: am-scroll 32s linear infinite;
    /* Keeps the strip on the compositor instead of relayouting every frame. */
    will-change: transform;
}
/* Deliberately keeps running under the cursor — pausing made the row look
   stuck when the pointer merely crossed it on the way down the page. */
.am-marquee:hover .am-marquee__t { animation-play-state: running; }
/* The chips are decorative, so let the pointer pass straight through them. */
.am-marquee__t > * { pointer-events: none; }
@keyframes am-scroll { to { transform: translateX(-50%); } }

/* --- scrollbar + selection --- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: linear-gradient(180deg, var(--am-purple), var(--am-pink)); border-radius: 999px; border: 2px solid var(--am-bg); }
::-webkit-scrollbar-track { background: var(--am-bg); }
::selection { background: rgba(236, 72, 153, .35); color: #fff; }

@media (prefers-reduced-motion: reduce) {
    body::before { animation: none; }
    .am-marquee__t { animation: none; }
}


/* --- click-to-verify box -------------------------------------------------
   Decorative only: there is no challenge behind it. Server-side checking in
   AltchaFilter is off (altcha.enabled=false), so this never gates submission.
   ------------------------------------------------------------------------- */
.cv-box {
    display: flex; align-items: center; gap: .85rem;
    padding: .85rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: rgba(255, 255, 255, .02);
    cursor: pointer;
    user-select: none;
    transition: border-color .2s ease, background-color .2s ease;
}
.cv-box:hover { border-color: rgba(168, 85, 247, .45); }
.cv-box:focus-visible { outline: 2px solid var(--am-purple); outline-offset: 2px; }
.cv-mark {
    flex: 0 0 auto; width: 22px; height: 22px; border-radius: 5px;
    border: 2px solid var(--border-color);
    display: grid; place-items: center;
    transition: border-color .2s ease, background-color .2s ease;
}
.cv-mark svg { width: 14px; height: 14px; stroke: #fff; opacity: 0; transform: scale(.6); transition: opacity .18s ease, transform .18s ease; }
.cv-label { font-size: .92rem; color: var(--text-dim); }
.cv-box.is-verified { border-color: rgba(34, 197, 94, .4); background: rgba(34, 197, 94, .06); cursor: default; }
.cv-box.is-verified .cv-mark { border-color: #22c55e; background: #22c55e; }
.cv-box.is-verified .cv-mark svg { opacity: 1; transform: scale(1); }
.cv-box.is-verified .cv-label { color: #86efac; }
@media (prefers-reduced-motion: reduce) {
    .cv-box, .cv-mark, .cv-mark svg { transition: none; }
}

/* ============================================================================
   Component layer
   Appended last so these rules settle the cascade against the theme layer
   above, which marks the primary button !important and would otherwise swallow
   every semantic colour.
   ============================================================================ */

/* --- buttons ------------------------------------------------------------ */

.btn-sm {
    padding: .4rem .85rem !important;
    font-size: var(--fs-xs) !important;
    border-radius: var(--r-sm) !important;
    gap: var(--sp-1);
}

.btn-lg {
    padding: .95rem 1.9rem !important;
    font-size: var(--fs-md) !important;
    border-radius: var(--r-pill) !important;
}

.btn-block {
    display: flex !important;
    width: 100% !important;
    justify-content: center;
}

/* Square button that holds nothing but an icon. */
.btn-icon {
    padding: .45rem !important;
    width: 34px;
    height: 34px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
}

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

/* The theme layer forces every .btn-primary to the brand gradient with
   !important, so the semantic variants have to answer in kind. Before this
   existed, a delete button coloured red inline still rendered purple and a
   destructive action looked identical to a safe one. */
.btn-success,
.btn-danger,
.btn-ghost,
.btn-text {
    background-image: none !important;
    box-shadow: none !important;
}

.btn-success {
    background: var(--am-ok) !important;
    color: #05210f !important;
    font-weight: 700;
}

.btn-success:hover {
    background: #16a34a !important;
    box-shadow: 0 8px 24px rgba(34, 197, 94, .32) !important;
}

.btn-danger {
    background: var(--am-danger) !important;
    color: #fff !important;
    font-weight: 700;
}

.btn-danger:hover {
    background: #dc2626 !important;
    box-shadow: 0 8px 24px rgba(239, 68, 68, .32) !important;
}

.btn-ghost {
    background: transparent !important;
    color: var(--text-dim) !important;
    border: 1px solid var(--border-color) !important;
}

.btn-ghost:hover {
    color: var(--text-main) !important;
    border-color: var(--am-border-strong) !important;
    background: var(--am-surface) !important;
}

/* A button that reads as a link: inline edit and show-more controls. */
.btn-text {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    color: var(--am-orchid) !important;
    font-weight: 600;
    font-size: var(--fs-sm);
    cursor: pointer;
    text-decoration: none;
}

.btn-text:hover { color: var(--am-pink-soft) !important; text-decoration: underline; }

/* Dismiss control in a modal or a banner. */
.btn-close {
    background: transparent !important;
    border: none !important;
    color: var(--text-dim) !important;
    font-size: 1.5rem;
    line-height: 1;
    padding: var(--sp-1) var(--sp-2) !important;
    cursor: pointer;
    border-radius: var(--r-sm);
}

.btn-close:hover { color: var(--text-main) !important; background: var(--am-surface-2) !important; }

/* --- form fields -------------------------------------------------------- */

.field { display: flex; flex-direction: column; gap: var(--sp-2); margin-bottom: var(--sp-4); }

.field__label {
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--text-main);
    margin: 0;
}

.field__hint { font-size: var(--fs-xs); color: var(--text-dim); line-height: 1.5; margin: 0; }

.field__error { font-size: var(--fs-xs); color: var(--am-danger); font-weight: 600; margin: 0; }

.input,
.select,
.textarea,
.form-control {
    width: 100%;
    padding: .7rem .9rem;
    background: var(--am-surface-2);
    border: 1px solid var(--border-color);
    border-radius: var(--r-sm);
    color: var(--text-main);
    font-family: inherit;
    font-size: var(--fs-sm);
    transition: border-color .2s ease, background-color .2s ease;
}

.input::placeholder,
.textarea::placeholder { color: var(--am-text-mute); }

.input:hover,
.select:hover,
.textarea:hover,
.form-control:hover { border-color: var(--am-border); }

.input:focus,
.select:focus,
.textarea:focus,
.form-control:focus {
    outline: none;
    border-color: var(--am-purple);
    background: rgba(168, 85, 247, .06);
}

.textarea { min-height: 120px; resize: vertical; line-height: 1.6; }

.input[aria-invalid="true"],
.textarea[aria-invalid="true"] { border-color: var(--am-danger); }

/* A field with a fixed prefix or suffix, such as the currency symbol on a price. */
.input-group { display: flex; align-items: stretch; }

.input-group > .input,
.input-group > .select { border-radius: 0; }

.input-group > :first-child { border-top-left-radius: var(--r-sm); border-bottom-left-radius: var(--r-sm); }
.input-group > :last-child { border-top-right-radius: var(--r-sm); border-bottom-right-radius: var(--r-sm); }

.input-group__addon {
    display: flex;
    align-items: center;
    padding: 0 .75rem;
    background: var(--am-surface);
    border: 1px solid var(--border-color);
    color: var(--text-dim);
    font-size: var(--fs-sm);
    white-space: nowrap;
}

/* One-time codes: wide tracking so the digits are easy to check against a phone. */
.verification-input {
    text-align: center;
    letter-spacing: .55em;
    font-family: 'JetBrains Mono', monospace;
    font-size: var(--fs-xl);
    text-indent: .55em;
}

/* --- badges ------------------------------------------------------------- */

.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-1);
    padding: .25rem .6rem;
    border-radius: var(--r-pill);
    font-size: var(--fs-xs);
    font-weight: 600;
    line-height: 1.5;
    white-space: nowrap;
    border: 1px solid transparent;
}

/* Two spellings are in use across the templates. They have to look identical,
   so they are grouped here rather than renamed in the markup. */
.badge--ok,
.badge-success { background: var(--am-ok-soft); color: #86efac; border-color: rgba(34, 197, 94, .3); }

.badge--warn { background: var(--am-warn-soft); color: #fcd34d; border-color: rgba(245, 158, 11, .3); }

.badge--danger,
.badge-danger { background: var(--am-danger-soft); color: #fca5a5; border-color: rgba(239, 68, 68, .3); }

.badge--info,
.badge-info { background: var(--am-info-soft); color: #7dd3fc; border-color: rgba(56, 189, 248, .3); }

.badge--muted,
.badge-secondary {
    background: var(--am-surface-2);
    color: var(--text-dim);
    border-color: var(--border-color);
}

.badge--accent {
    background: rgba(168, 85, 247, .12);
    color: #e9d5ff;
    border-color: rgba(168, 85, 247, .3);
}

/* --- alerts ------------------------------------------------------------- */

.alert--ok { background: var(--am-ok-soft); border-color: rgba(34, 197, 94, .3); color: #86efac; }
.alert--warn { background: var(--am-warn-soft); border-color: rgba(245, 158, 11, .3); color: #fcd34d; }
.alert--danger { background: var(--am-danger-soft); border-color: rgba(239, 68, 68, .3); color: #fca5a5; }
.alert--info { background: var(--am-info-soft); border-color: rgba(56, 189, 248, .3); color: #7dd3fc; }

/* --- tables ------------------------------------------------------------- */

/* Scrolls at every width. The older wrapper only did so inside a mobile media
   query, so on a desktop a wide table was clipped by the overflow:hidden on the
   surrounding card, with no way to reach the columns that were cut off. */
.table-wrap,
.table-responsive-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table,
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--fs-sm);
}

.table th,
.admin-table th {
    text-align: left;
    padding: var(--sp-3) var(--sp-4);
    font-size: var(--fs-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text-dim);
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.table td,
.admin-table td {
    padding: var(--sp-3) var(--sp-4);
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
    vertical-align: middle;
}

.table tbody tr:last-child td,
.admin-table tbody tr:last-child td { border-bottom: none; }

.table tbody tr:hover,
.admin-table tbody tr:hover { background: var(--am-surface); }

/* --- tabs --------------------------------------------------------------- */

.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-1);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: var(--sp-1);
}

.tab,
.tab-btn,
.build-tab-btn,
.user-info-tab-btn {
    appearance: none;
    background: transparent;
    border: none;
    border-radius: var(--r-sm);
    padding: .5rem .95rem;
    color: var(--text-dim);
    font-family: inherit;
    font-size: var(--fs-sm);
    font-weight: 600;
    cursor: pointer;
    position: relative;
    transition: color .2s ease, background-color .2s ease;
}

.tab:hover,
.tab-btn:hover,
.build-tab-btn:hover,
.user-info-tab-btn:hover { color: var(--text-main); background: var(--am-surface); }

.tab.is-active,
.tab.active,
.tab-btn.active,
.build-tab-btn.active,
.user-info-tab-btn.active {
    color: #fff;
    background: rgba(168, 85, 247, .12);
}

/* The underline sits on the tab rather than the container so it lines up with
   the bottom border of the strip. */
.tab.is-active::after,
.tab.active::after,
.tab-btn.active::after,
.build-tab-btn.active::after,
.user-info-tab-btn.active::after {
    content: "";
    position: absolute;
    left: .5rem;
    right: .5rem;
    bottom: calc(-1 * var(--sp-1) - 1px);
    height: 2px;
    border-radius: 2px;
    background: var(--am-grad);
}

.tab-content,
.user-info-tab-content { display: none; }

.tab-content.is-active,
.tab-content.active,
.user-info-tab-content.active { display: block; }

/* --- modal parts -------------------------------------------------------- */

.modal__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--sp-4);
    padding-bottom: var(--sp-4);
    margin-bottom: var(--sp-5);
    border-bottom: 1px solid var(--border-color);
}

.modal__title { margin: 0; font-size: var(--fs-xl); font-weight: 700; letter-spacing: -.02em; }

.modal__body { display: flex; flex-direction: column; gap: var(--sp-2); }

.modal__foot {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-3);
    padding-top: var(--sp-5);
    margin-top: var(--sp-5);
    border-top: 1px solid var(--border-color);
}

/* --- stat tiles --------------------------------------------------------- */

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--sp-4);
}

.stat {
    display: flex;
    flex-direction: column;
    gap: var(--sp-1);
    padding: var(--sp-4);
    background: var(--am-surface);
    border: 1px solid var(--am-border);
    border-radius: var(--r-lg);
}

.stat__value {
    font-family: 'JetBrains Mono', monospace;
    font-size: var(--fs-2xl);
    font-weight: 800;
    line-height: 1.1;
    background: var(--am-grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat__label {
    font-size: var(--fs-xs);
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--text-dim);
}

/* --- empty state -------------------------------------------------------- */

.empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: var(--sp-3);
    padding: var(--sp-7) var(--sp-4);
    color: var(--text-dim);
}

.empty__icon {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--am-grad-soft);
    border: 1px solid var(--am-border);
    color: var(--am-orchid);
}

.empty__title { font-size: var(--fs-lg); font-weight: 700; color: var(--text-main); margin: 0; }

.empty__text { font-size: var(--fs-sm); max-width: 42ch; line-height: 1.6; margin: 0; }

/* --- skeletons ---------------------------------------------------------- */

.skeleton {
    position: relative;
    overflow: hidden;
    background: var(--am-surface-2);
    border-radius: var(--r-sm);
}

.skeleton::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .06), transparent);
    animation: am-shimmer 1.4s infinite;
}

.skeleton--text { height: 1em; margin-bottom: var(--sp-2); }
.skeleton--text:last-child { width: 60%; margin-bottom: 0; }
.skeleton--block { height: 120px; }

@keyframes am-shimmer { to { transform: translateX(100%); } }

/* --- utilities ---------------------------------------------------------- */

.u-mono { font-family: 'JetBrains Mono', monospace; font-size: .92em; }
.u-dim { color: var(--text-dim); }
.u-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

.stack { display: flex; flex-direction: column; gap: var(--sp-4); }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); }

/* Reaches a screen reader, never the screen. */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* --- assorted page pieces ----------------------------------------------- */

.payment-actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: center; }

.community-text { color: var(--text-dim); font-size: var(--fs-sm); line-height: 1.6; margin: 0 0 var(--sp-3); }

.discord-link { color: var(--am-discord) !important; font-weight: 600; }
.discord-link:hover { color: #7983f5 !important; }

.license-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--sp-3);
    padding: var(--sp-3) 0;
    border-bottom: 1px solid var(--border-color);
}

.license-row:last-child { border-bottom: none; }
.license-user { font-weight: 600; color: var(--text-main); }
.license-hwid { font-family: 'JetBrains Mono', monospace; font-size: var(--fs-xs); color: var(--text-dim); }

.trusted-device-info { display: flex; flex-direction: column; gap: var(--sp-1); font-size: var(--fs-sm); }

.build-fields { display: flex; flex-direction: column; gap: var(--sp-3); }

.build-manage-menu {
    position: absolute;
    right: 0;
    z-index: var(--z-sticky);
    min-width: 180px;
    padding: var(--sp-2);
    background: var(--am-surface-3);
    border: 1px solid var(--am-border);
    border-radius: var(--r-md);
    box-shadow: var(--sh-2);
}

/* A row that is mid-upload: dimmed and inert until the request finishes. */
.uploading-row { opacity: .55; pointer-events: none; }

.spinner-container { display: flex; align-items: center; justify-content: center; padding: var(--sp-6); }

.refresh-icon { transition: transform .4s ease; }
.refresh-icon:hover { transform: rotate(180deg); }

/* Scrollbars inside a panel, kept narrower than the page scrollbar. */
.custom-scrollbar { overflow-y: auto; }
.custom-scrollbar::-webkit-scrollbar { width: 6px; }
.custom-scrollbar::-webkit-scrollbar-thumb { background: var(--am-border-strong); border-radius: var(--r-pill); border: none; }
.custom-scrollbar::-webkit-scrollbar-track { background: transparent; }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .4; }
}

.pulse { animation: pulse 1.8s ease-in-out infinite; }

/* --- focus visibility --------------------------------------------------- */

/* One ring for everything focusable. Several components cleared the outline
   without putting anything back, which left a keyboard user with no indication
   of where they were on the page. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--am-purple);
    outline-offset: 2px;
    border-radius: var(--r-sm);
}

@media (prefers-reduced-motion: reduce) {
    .skeleton::after,
    .pulse { animation: none; }
    .refresh-icon { transition: none; }
}

/* Several templates apply a variant without the base .btn -- for example
   class="btn-danger" on its own. The variant only carries colour, so those
   buttons rendered as bare text with no padding or shape. Giving the variants
   the base geometry as well makes them work either way, which is cheaper and
   safer than editing every call site. */
.btn-primary,
.btn-outline,
.btn-success,
.btn-danger,
.btn-ghost,
.btn-restricted {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-2);
    padding: 0.8rem var(--sp-5);
    border-radius: var(--r-sm);
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    font-size: 0.95rem;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.2s ease, background-position 0.5s ease, border-color 0.2s ease,
        box-shadow 0.3s ease, color 0.2s ease, transform 0.12s ease;
}

/* The size modifiers have to beat the geometry above, and both spellings are in
   use across the templates. */
.btn-sm,
.btn-small {
    padding: .4rem .85rem !important;
    font-size: var(--fs-xs) !important;
    border-radius: var(--r-sm) !important;
}

.btn-lg { padding: .95rem 1.9rem !important; font-size: var(--fs-md) !important; }

/* Secondary action on the suspended-account page. */
.btn-restricted {
    background: rgba(255, 255, 255, .03);
    border: 1px solid var(--border-color);
    color: var(--text-dim);
}

.btn-restricted:hover {
    border-color: var(--am-border-strong);
    background: var(--am-surface);
    color: var(--text-main);
}

/* The brand gradient for the main call to action. This is the rule that makes a
   primary button look like anything at all: without it .btn-primary carries only
   geometry, so every "Manage", "Register" and "Save" button rendered as grey
   text on the page background. Kept last so it settles the cascade. */
.btn-primary,
.btn-nav,
.nav-links .btn-nav {
    background: var(--am-grad) !important;
    background-size: 180% 180% !important;
    border: none !important;
    color: #fff !important;
    box-shadow: var(--sh-glow) !important;
    transition: background-position .5s ease, box-shadow .3s ease, transform .12s ease !important;
}

.btn-primary:hover,
.btn-nav:hover,
.nav-links .btn-nav:hover {
    background-position: 100% 0 !important;
    box-shadow: 0 14px 44px rgba(236, 72, 153, .45) !important;
    transform: translateY(-1px);
}

.btn-primary:disabled,
.btn-primary[disabled] {
    opacity: .55;
    cursor: not-allowed;
    transform: none;
}

/* Destructive and confirming actions have to stay distinguishable from the
   primary gradient even when both classes are present on one element. */
.btn-primary.btn-danger,
.btn.btn-danger {
    background: var(--am-danger) !important;
    background-image: none !important;
    box-shadow: none !important;
}

.btn-primary.btn-success,
.btn.btn-success {
    background: var(--am-ok) !important;
    background-image: none !important;
    box-shadow: none !important;
    color: #05210f !important;
}
