@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600&family=Unbounded:wght@400;600;800&display=swap');

:root {
    --font-display: "Unbounded", "Segoe UI", sans-serif;
    --font-body: "Space Grotesk", "Segoe UI", sans-serif;
    --radius-lg: 24px;
    --radius-md: 16px;
    --shadow: 0 20px 60px rgba(0, 0, 0, 0.22);
    --transition: 0.35s ease;
}

body {
    margin: 0;
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

body[data-theme="dark"] {
    --bg: #070a10;
    --surface: rgba(16, 20, 32, 0.8);
    --surface-strong: #111628;
    --text: #f4f6fb;
    --muted: #9aa5b8;
    --accent: #1dd6b5;
    --accent-strong: #7ef0d4;
    --border: rgba(255, 255, 255, 0.08);
}

body[data-theme="light"] {
    --bg: #f8f3e8;
    --surface: rgba(255, 255, 255, 0.9);
    --surface-strong: #ffffff;
    --text: #1d1f24;
    --muted: #596071;
    --accent: #e06b47;
    --accent-strong: #f39c6b;
    --border: rgba(17, 19, 28, 0.08);
}

.backdrop {
    position: fixed;
    inset: 0;
    z-index: -1;
    background: radial-gradient(circle at top right, rgba(126, 240, 212, 0.2), transparent 45%),
        radial-gradient(circle at 10% 20%, rgba(240, 156, 107, 0.15), transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(97, 117, 255, 0.12), transparent 40%);
    transition: background var(--transition);
}

body[data-theme="light"] .backdrop {
    background: radial-gradient(circle at 15% 15%, rgba(240, 156, 107, 0.25), transparent 45%),
        radial-gradient(circle at 85% 20%, rgba(74, 191, 178, 0.2), transparent 40%),
        radial-gradient(circle at 50% 80%, rgba(102, 140, 255, 0.2), transparent 45%);
}

.backdrop::before,
.backdrop::after {
    content: "";
    position: absolute;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.6;
    animation: float 12s ease-in-out infinite;
}

.backdrop::before {
    background: rgba(29, 214, 181, 0.4);
    top: -80px;
    left: -60px;
}

.backdrop::after {
    background: rgba(224, 107, 71, 0.35);
    bottom: -120px;
    right: -40px;
    animation-delay: 2s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(20px);
    }
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 8vw;
}

.brand {
    font-family: var(--font-display);
    font-size: 26px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.nav-links {
    display: flex;
    gap: 20px;
}

.nav-links a,
.nav-links button {
    color: var(--muted);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition);
}

.nav-links a:hover,
.nav-links button:hover {
    color: var(--accent);
}

.nav-links form {
    margin: 0;
}

.logout-button {
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
}

.theme-toggle {
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    padding: 10px 16px;
    border-radius: 999px;
    cursor: pointer;
    transition: transform var(--transition), background var(--transition), color var(--transition);
}

.theme-toggle:hover {
    transform: translateY(-2px);
}

.content {
    padding: 40px 8vw 60px;
}

.auth-layout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 30px;
    align-items: center;
}

.hero h1 {
    font-family: var(--font-display);
    font-size: clamp(32px, 4vw, 52px);
    margin-bottom: 10px;
}

.hero p {
    color: var(--muted);
    font-size: 18px;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
    animation: fadeUp 0.6s ease;
}

.section-gap {
    margin-top: 24px;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card h2 {
    margin-top: 0;
    font-family: var(--font-display);
}

.form-card label,
.card label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
    font-weight: 500;
}

input,
select,
textarea {
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface-strong);
    color: var(--text);
    padding: 12px 14px;
    font-family: var(--font-body);
    font-size: 15px;
    resize: vertical;
}

textarea {
    min-height: 200px;
}

button {
    font-family: var(--font-body);
}

.primary {
    background: linear-gradient(120deg, var(--accent), var(--accent-strong));
    color: #0b0f14;
    border: none;
    padding: 12px 18px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition);
}

.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
}

.ghost {
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text);
    padding: 10px 14px;
    border-radius: 12px;
    cursor: pointer;
}

.danger {
    border: none;
    background: #ef4d4d;
    color: #fff;
    padding: 10px 14px;
    border-radius: 12px;
    cursor: pointer;
}

.hint {
    color: var(--muted);
    font-size: 14px;
}

.muted {
    color: var(--muted);
}

.flash-stack {
    display: grid;
    gap: 12px;
    margin-bottom: 20px;
}

.flash {
    padding: 12px 16px;
    border-radius: 12px;
    font-weight: 500;
}

.flash-success {
    background: rgba(29, 214, 181, 0.2);
    color: var(--text);
}

.flash-error {
    background: rgba(239, 77, 77, 0.2);
    color: var(--text);
}

.flash-warning {
    background: rgba(240, 156, 107, 0.2);
    color: var(--text);
}

.dashboard .section-header {
    margin-bottom: 24px;
}

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

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

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

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.split {
    display: flex;
    align-items: center;
    gap: 12px;
}

.build-output .kv {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.build-output .kv:last-child {
    border-bottom: none;
}

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

.build-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.build-row:last-child {
    border-bottom: none;
}

.table {
    display: grid;
    gap: 12px;
}

.table-head,
.table-row {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr 0.4fr 0.8fr;
    gap: 12px;
    align-items: center;
}

.table-head {
    font-weight: 600;
    color: var(--muted);
}

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

.tag {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    font-size: 12px;
    margin-top: 6px;
}

.search {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.inline-form {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
}

.checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

.checkbox input {
    margin: 0;
}

.script-form {
    display: grid;
    gap: 12px;
    margin-bottom: 18px;
}

.script-list {
    display: grid;
    gap: 18px;
}

.script-item {
    border-top: 1px solid var(--border);
    padding-top: 16px;
}

.script-delete {
    margin-top: 8px;
}

.script-picker {
    display: grid;
    gap: 12px;
}

.script-option {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

.script-option input {
    margin: 0;
}

.script-editor {
    margin-left: 24px;
    margin-bottom: 12px;
}

.notice {
    border-left: 4px solid var(--accent);
}

.captcha {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
}

.captcha-question {
    font-weight: 600;
    font-size: 18px;
}

.site-footer {
    padding: 24px 8vw 32px;
    display: flex;
    justify-content: space-between;
    color: var(--muted);
    font-size: 13px;
}

.hidden {
    display: none;
}

@media (max-width: 900px) {
    .site-header {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }

    .nav-links {
        flex-wrap: wrap;
    }

    .table-head,
    .table-row {
        grid-template-columns: 1fr;
    }

    .build-row {
        flex-direction: column;
    }

    .site-footer {
        flex-direction: column;
        gap: 12px;
    }
}
