@font-face {
    font-family: "Inter";
    src: url("../fonts/Inter-Variable.woff2") format("woff2");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

:root {
    color-scheme: light;
    --font-sans: "Inter", sans-serif;
    --bg: #f5f7fb;
    --bg-elevated: rgba(255, 255, 255, 0.88);
    --bg-soft: rgba(255, 255, 255, 0.7);
    --bg-inset: #eef2f7;
    --text: #101828;
    --text-soft: #475467;
    --text-muted: #667085;
    --line: #d0d5dd;
    --line-strong: #98a2b3;
    --accent: #155eef;
    --accent-strong: #0040c1;
    --accent-soft: rgba(21, 94, 239, 0.12);
    --success-bg: #ecfdf3;
    --success-line: #abefc6;
    --error: #b42318;
    --shadow-sm: 0 8px 24px rgba(16, 24, 40, 0.06);
    --shadow-md: 0 20px 48px rgba(16, 24, 40, 0.12);
    --radius-xl: 28px;
    --radius-lg: 20px;
    --radius-md: 14px;
    --grid-glow: radial-gradient(circle at top, rgba(21, 94, 239, 0.08), transparent 38%);
    --grid-lines:
        linear-gradient(rgba(16, 24, 40, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(16, 24, 40, 0.04) 1px, transparent 1px);
}

[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0f1728;
    --bg-elevated: rgba(16, 24, 40, 0.82);
    --bg-soft: rgba(15, 23, 40, 0.62);
    --bg-inset: #182230;
    --text: #f8fafc;
    --text-soft: #d0d5dd;
    --text-muted: #98a2b3;
    --line: rgba(208, 213, 221, 0.18);
    --line-strong: rgba(208, 213, 221, 0.36);
    --accent: #84adff;
    --accent-strong: #b2ccff;
    --accent-soft: rgba(132, 173, 255, 0.16);
    --success-bg: rgba(6, 78, 59, 0.28);
    --success-line: rgba(110, 231, 183, 0.24);
    --error: #f97066;
    --shadow-sm: 0 10px 32px rgba(0, 0, 0, 0.28);
    --shadow-md: 0 26px 70px rgba(0, 0, 0, 0.38);
    --grid-glow: radial-gradient(circle at top, rgba(132, 173, 255, 0.14), transparent 38%);
    --grid-lines:
        linear-gradient(rgba(248, 250, 252, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(248, 250, 252, 0.04) 1px, transparent 1px);
}

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

[hidden] {
    display: none !important;
}

html {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-sans);
    color: var(--text);
    background:
        var(--grid-glow),
        var(--grid-lines),
        linear-gradient(180deg, var(--bg), var(--bg));
    background-size: auto, 48px 48px, auto;
}

body.nav-open {
    overflow: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
textarea,
select {
    font: inherit;
}

.settings-grid,
.plans-layout {
    align-items: start;
}

.users-layout,
.account-layout {
    align-items: start;
}

.providers-layout {
    align-items: start;
}

.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
}

.setting-row:last-child {
    border-bottom: 0;
}

.setting-copy {
    display: grid;
    gap: 4px;
}

.setting-copy strong {
    font-size: 0.98rem;
    color: var(--text);
}

.setting-copy span {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.toggle-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.toggle-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.toggle-ui {
    width: 52px;
    height: 30px;
    border-radius: 999px;
    background: var(--bg-inset);
    border: 1px solid var(--line);
    position: relative;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.toggle-ui::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    background: #fff;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease;
}

.toggle-input:checked + .toggle-ui {
    background: var(--accent);
    border-color: var(--accent);
}

.toggle-input:checked + .toggle-ui::after {
    transform: translateX(22px);
}

.compact-grid {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.shell {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 20px 56px;
    position: relative;
}

.page-auth .shell {
    min-height: 100vh;
    display: grid;
    grid-template-rows: auto 1fr;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px 18px;
    border: 1px solid var(--line);
    background: var(--bg-soft);
    border-radius: 999px;
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(18px);
    margin-bottom: 28px;
    position: relative;
    z-index: 20;
}

.topbar-minimal {
    background: transparent;
    border-color: transparent;
    box-shadow: none;
    padding-inline: 2px;
}

.topbar-actions,
.nav {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.mobile-nav-overlay,
.menu-toggle,
.mobile-nav-header {
    display: none;
}

.brand {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.nav a,
.theme-toggle {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--bg-elevated);
    color: var(--text-soft);
    transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.nav a:hover,
.nav a:focus-visible,
.theme-toggle:hover,
.theme-toggle:focus-visible {
    border-color: var(--line-strong);
    color: var(--text);
    transform: translateY(-1px);
}

.theme-toggle {
    cursor: pointer;
}

.menu-toggle {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: var(--bg-elevated);
    padding: 10px;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
}

.menu-bar {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: var(--text);
}

.theme-toggle-nav {
    display: none;
}

.page {
    display: grid;
    gap: 20px;
    position: relative;
    z-index: 1;
}

.page-auth .page {
    align-content: center;
}

.alert,
.card {
    backdrop-filter: blur(18px);
}

.alert {
    padding: 14px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--success-line);
    background: var(--success-bg);
    color: var(--text-soft);
}

.section {
    display: grid;
    gap: 24px;
}

.section-auth {
    justify-items: center;
}

.module-shell {
    width: min(100%, 520px);
    display: grid;
    gap: 20px;
}

.module-heading {
    text-align: center;
    display: grid;
    gap: 10px;
}

.eyebrow {
    margin: 0;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
}

.module-heading h1,
.card h1,
.hero-copy h1 {
    margin: 0;
    font-size: clamp(2rem, 4vw, 2.7rem);
    line-height: 1.08;
    letter-spacing: -0.04em;
}

.module-heading p,
.hero-copy p,
.card p,
.disabled-copy,
.hint {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.65;
}

.card {
    background: var(--bg-elevated);
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    padding: 28px;
}

.form-card {
    position: relative;
}

.narrow-card {
    width: 100%;
}

.centered-copy,
.centered-links {
    text-align: center;
}

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

.metric-card {
    display: grid;
    gap: 8px;
}

.metric-card span {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.metric-card strong {
    font-size: 1.35rem;
    letter-spacing: -0.03em;
}

.section-header,
.card-header,
.stack-row,
.item-topline {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.section-header h1,
.card-title {
    margin: 0;
    letter-spacing: -0.03em;
}

.card-title {
    font-size: 1.35rem;
}

.inline-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.ghost-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--bg-elevated);
    color: var(--text-soft);
}

.compact-link {
    min-height: 36px;
    padding-inline: 12px;
}

.stack-form {
    display: grid;
    gap: 14px;
}

label {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-soft);
}

input {
    width: 100%;
    min-height: 52px;
    padding: 0 16px;
    color: var(--text);
    background: var(--bg-inset);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
}

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

textarea {
    width: 100%;
    min-height: 52px;
    padding: 14px 16px;
    color: var(--text);
    background: var(--bg-inset);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    resize: vertical;
}

select {
    width: 100%;
    min-height: 52px;
    padding: 0 16px;
    color: var(--text);
    background: var(--bg-inset);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
}

input:focus,
textarea:focus,
button:focus-visible,
a:focus-visible {
    outline: 3px solid var(--accent-soft);
    outline-offset: 2px;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--accent);
}

.password-field {
    position: relative;
}

.password-field input {
    padding-right: 58px;
}

.password-toggle-button {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
}

.password-toggle-button:hover,
.password-toggle-button:focus-visible {
    color: var(--text);
    border-color: var(--line);
    background: var(--bg-elevated);
}

.password-toggle-button svg {
    width: 18px;
    height: 18px;
}

.primary-button,
.ghost-button {
    min-height: 52px;
    border-radius: var(--radius-md);
    padding: 0 18px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.primary-button {
    background: var(--accent);
    color: #ffffff;
    font-weight: 600;
}

.primary-button:hover,
.primary-button:focus-visible {
    background: var(--accent-strong);
    transform: translateY(-1px);
}

.ghost-button {
    background: transparent;
    border-color: var(--line);
    color: var(--text-soft);
}

.ghost-button:hover,
.ghost-button:focus-visible {
    border-color: var(--line-strong);
    color: var(--text);
}

.danger-button {
    color: var(--error);
}

.compact-button {
    min-height: 38px;
    padding: 0 12px;
}

.hint {
    font-size: 0.88rem;
}

.error {
    color: var(--error);
    font-size: 0.88rem;
}

.card-links {
    display: flex;
    justify-content: center;
    gap: 18px;
    margin-top: 18px;
    flex-wrap: wrap;
    color: var(--text-soft);
}

.card-links a {
    color: var(--accent);
    font-weight: 500;
}

.panel {
    display: grid;
    gap: 20px;
}

.split-layout {
    display: grid;
    gap: 20px;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
}

.admin-logs-layout {
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
}

.meta-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.meta-grid span {
    display: block;
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.meta-grid strong {
    display: block;
    font-size: 1rem;
}

.account-grid strong {
    font-size: 1.05rem;
}

.stack-list {
    display: grid;
    gap: 12px;
}

.item-card {
    border: 1px solid var(--line);
    background: var(--bg-soft);
    border-radius: var(--radius-lg);
    padding: 18px;
    display: grid;
    gap: 14px;
}

.item-card-compact {
    gap: 8px;
}

.item-card h3 {
    margin: 0 0 4px;
    font-size: 1rem;
}

.item-card p,
.empty-copy,
.muted-inline,
.item-domains {
    color: var(--text-muted);
}

.empty-copy {
    margin: 0;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
    border: 1px solid var(--line);
}

.status-active {
    color: #067647;
    background: rgba(18, 183, 106, 0.12);
    border-color: rgba(18, 183, 106, 0.22);
}

.status-paid,
.status-open,
.status-trialing {
    color: #067647;
    background: rgba(18, 183, 106, 0.12);
    border-color: rgba(18, 183, 106, 0.22);
}

.status-revoked,
.status-disabled,
.status-failed,
.status-void,
.status-canceled {
    color: var(--error);
    background: rgba(217, 45, 32, 0.1);
    border-color: rgba(217, 45, 32, 0.18);
}

.status-paused,
.status-pending,
.status-inactive,
.status-past_due,
.status-draft {
    color: #b54708;
    background: rgba(247, 144, 9, 0.12);
    border-color: rgba(247, 144, 9, 0.2);
}

.secret-box {
    display: block;
    width: 100%;
    overflow-x: auto;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    background: var(--bg-inset);
    border: 1px solid var(--line);
    color: var(--accent-strong);
}

.callout-card {
    border-color: rgba(21, 94, 239, 0.22);
}

.table-wrap {
    overflow-x: auto;
}

.code-block {
    margin: 0;
    padding: 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    background: var(--bg-inset);
    color: var(--text);
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 0.9rem;
    line-height: 1.6;
}

.response-text-box {
    display: grid;
    gap: 10px;
    padding: 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    background: var(--bg-soft);
}

.response-text-box span {
    color: var(--text-muted);
    font-size: 0.88rem;
}

.docs-grid,
.code-grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.playground-layout {
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 14px 12px;
    text-align: left;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}

.data-table th {
    color: var(--text-muted);
    font-size: 0.86rem;
    font-weight: 600;
}

.hero-copy {
    display: grid;
    gap: 12px;
    max-width: 760px;
}

@media (max-width: 720px) {
    .shell {
        padding: 16px 14px 42px;
    }

    .topbar {
        border-radius: 24px;
        align-items: center;
        flex-direction: row;
        z-index: 260;
        isolation: isolate;
    }

    .topbar-actions {
        justify-content: flex-end;
        width: auto;
    }

    .nav {
        position: fixed;
        inset: 0 auto 0 0;
        width: min(84vw, 320px);
        height: 100vh;
        padding: 24px 18px;
        background: var(--bg);
        border-right: 1px solid var(--line);
        box-shadow: var(--shadow-md);
        display: grid;
        align-content: start;
        gap: 10px;
        transform: translateX(-105%);
        transition: transform 0.24s ease;
        z-index: 320;
        overflow-y: auto;
        opacity: 1;
        backdrop-filter: none;
    }

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

    .nav a,
    .theme-toggle-nav {
        flex: initial;
    }

    .nav a {
        justify-content: flex-start;
    }

    .theme-toggle-desktop {
        display: none;
    }

    .theme-toggle-nav {
        display: inline-flex;
        justify-content: flex-start;
        width: 100%;
    }

    .menu-toggle,
    .mobile-nav-header,
    .mobile-nav-overlay {
        display: flex;
    }

    .mobile-nav-header {
        align-items: center;
        justify-content: flex-start;
        margin-bottom: 12px;
        padding-bottom: 12px;
        border-bottom: 1px solid var(--line);
        color: var(--text);
    }

    .mobile-nav-overlay {
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 40, 0.42);
        z-index: 240;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
    }

    .mobile-nav-overlay.is-open {
        opacity: 1;
        pointer-events: auto;
    }

    .card {
        padding: 22px;
    }

    .section-header,
    .card-header,
    .stack-row,
    .item-topline {
        flex-direction: column;
    }

    .split-layout {
        grid-template-columns: 1fr;
    }

    .brand {
        max-width: 220px;
    }

    body.nav-open .page {
        z-index: 1;
    }
}
