:root {
    --bg-gradient: radial-gradient(circle at top, #6a11cb 0%, #2575fc 40%, #0f172a 100%);
    --card-bg: rgba(15, 23, 42, 0.8);
    --card-border: rgba(255, 255, 255, 0.08);
    --input-bg: rgba(255, 255, 255, 0.04);
    --input-border: rgba(255, 255, 255, 0.18);
    --text-primary: #f8fafc;
    --text-muted: rgba(248, 250, 252, 0.7);
    --accent: #5eead4;
    --accent-strong: #2dd4bf;
    --shadow-strong: 0 25px 65px rgba(10, 10, 25, 0.55);
    --shadow-soft: 0 8px 25px rgba(15, 23, 42, 0.35);
    font-family: 'Inter', sans-serif;
}

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

body {
    min-height: 100vh;
    margin: 0;
    align-items: center;
    justify-content: center;
    background: var(--bg-gradient);
    color: var(--text-primary);
    padding: 20px;
}

/* ---------- Login Experience ---------- */

.login-container {
    width: min(960px, 100%);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 48px;
    align-items: stretch;
    background: rgba(15, 23, 42, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 28px;
    padding: clamp(28px, 4vw, 48px);
    box-shadow: var(--shadow-strong);
    backdrop-filter: blur(28px);
}

.login-hero {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 32px;
    padding-right: clamp(8px, 3vw, 24px);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.login-hero h1 {
    font-size: clamp(2rem, 4vw, 3rem);
    margin: 0;
    letter-spacing: -0.02em;
}

.login-hero p {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.6;
    margin: 0;
}

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

.login-metric {
    padding: 18px 20px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(15, 23, 42, 0.4);
    box-shadow: var(--shadow-soft);
}

.login-metric strong {
    display: block;
    font-size: 1.8rem;
    margin-bottom: 4px;
    color: var(--accent);
}

.login-box {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: clamp(24px, 4vw, 42px);
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.login-box header h2 {
    margin: 0;
    font-size: 1.35rem;
}

.login-box header p {
    margin: 6px 0 0;
    color: var(--text-muted);
}

.login-box form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.login-box input {
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 14px;
    padding: 16px 18px;
    font-size: 1rem;
    color: var(--text-primary);
    transition: border 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.login-box input::placeholder {
    color: rgba(248, 250, 252, 0.45);
}

.login-box input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(94, 234, 212, 0.25);
    transform: translateY(-1px);
}

.login-box button {
    border: none;
    border-radius: 14px;
    padding: 16px 20px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
    color: #0f172a;
    box-shadow: 0 15px 30px rgba(13, 110, 98, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.login-box button:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 40px rgba(13, 110, 98, 0.45);
}

.login-box button:active {
    transform: translateY(0);
    box-shadow: 0 10px 22px rgba(13, 110, 98, 0.35);
}

.signup-text {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.95rem;
    margin: 0;
}

.signup-text a {
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.signup-text a:hover {
    opacity: 0.8;
}

/* ---------- Signup Experience ---------- */

body.signup-page {
    padding: 32px;
    display: flex;
}

.signup-layout {
    width: min(1080px, 100%);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 52px;
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 32px;
    padding: clamp(32px, 5vw, 56px);
    box-shadow: 0 30px 70px rgba(10, 10, 25, 0.55);
    backdrop-filter: blur(30px);
}

.signup-hero {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

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

.signup-hero h1 {
    margin: 0;
    font-size: clamp(2.1rem, 4vw, 3.1rem);
    letter-spacing: -0.02em;
}

.signup-hero p {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.7;
    width: 100%;
}

.signup-form {
    background: rgba(15, 23, 42, 0.85);
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: clamp(28px, 4vw, 48px);
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.trial-badge {
    align-self: flex-start;
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid rgba(94, 234, 212, 0.5);
    background: rgba(94, 234, 212, 0.12);
    color: var(--accent);
    font-size: 0.85rem;
    font-weight: 600;
}

.signup-form h2 {
    margin: 0;
    font-size: 1.9rem;
}

.signup-form>p {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.6;
}

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

.form-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.92rem;
    color: var(--text-muted);
    letter-spacing: 0.01em;
}

.form-field input,
.form-field select,
.form-field textarea {
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 14px;
    padding: 14px 16px;
    font-size: 1rem;
    color: var(--text-primary);
    transition: border 0.2s ease, box-shadow 0.2s ease;
}

.form-field textarea {
    min-height: 110px;
    resize: vertical;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(94, 234, 212, 0.25);
}

.signup-form button {
    border: none;
    border-radius: 16px;
    padding: 18px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    color: #0b1324;
    box-shadow: 0 25px 45px rgba(13, 110, 98, 0.4);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin-top: 12px;
}

.signup-form button:hover {
    transform: translateY(-2px);
    box-shadow: 0 30px 60px rgba(13, 110, 98, 0.45);
}

.signup-form button:active {
    transform: translateY(0);
}

.legal-copy {
    font-size: 0.85rem;
    color: rgba(248, 250, 252, 0.6);
    text-align: center;
    margin: 0;
}

.card-fields {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 20px;
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 8px;
}

.card-fields h3 {
    margin: 0;
    font-size: 1.05rem;
}

.stripe-element-container {
    display: flex;
    gap: 12px;
}

.stripe-input-fake {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 14px;
    padding: 14px 16px;
    transition: border 0.2s ease, box-shadow 0.2s ease;
}

.stripe-input-fake:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(94, 234, 212, 0.25);
}

.credit-card-icon {
    color: var(--text-muted);
}

/* ---------- Dashboard ---------- */

body.dashboard-page {
    min-height: 100vh;
    margin: 0;
    padding: 32px;
    background: radial-gradient(circle at top, #0f172a, #020617 55%);
    color: var(--text-primary);
}

.dashboard-shell {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 32px;
    height: calc(100vh - 64px);
}

.dashboard-nav {
    background: rgba(15, 23, 42, 0.7);
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 32px 24px;
    display: flex;
    flex-direction: column;
    gap: 32px;
    box-shadow: var(--shadow-soft);
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-icon {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    display: grid;
    place-items: center;
    font-weight: 700;
    color: #0f172a;
}

.brand p {
    margin: 0;
    font-weight: 600;
}

.brand small {
    color: var(--text-muted);
}

.dashboard-nav nav {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.nav-link {
    border: 1px solid transparent;
    border-radius: 16px;
    padding: 14px 18px;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.95rem;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
}

.nav-link.active,
.nav-link:hover {
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
}

.nav-footer {
    margin-top: auto;
    color: var(--text-muted);
}

.nav-footer a {
    color: var(--accent);
    text-decoration: none;
}

.dashboard-content {
    background: rgba(15, 23, 42, 0.55);
    border-radius: 32px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 32px;
    overflow-y: auto;
    min-width: 0;
    width: 100%;
}

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

.panel {
    display: none;
    flex-direction: column;
    gap: 24px;
    width: 100%;
    min-width: 0;
}

.panel.active {
    display: flex;
}

.panel-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
}

.panel-header h1 {
    margin: 4px 0;
    font-size: clamp(1.6rem, 3vw, 2.4rem);
}

.panel-header>div {
    flex: 1;
    min-width: 280px;
}

.panel-header p {
    margin: 8px 0 0;
    color: var(--text-muted);
    line-height: 1.6;
    max-width: 600px;
}

.panel-body {
    background: rgba(2, 6, 23, 0.5);
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    min-width: 0;
}

.primary-btn {
    border: none;
    border-radius: 16px;
    padding: 14px 24px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    color: #04101a;
    box-shadow: 0 12px 30px rgba(13, 110, 98, 0.35);
    transition: transform 0.2s ease;
}

.primary-btn:hover {
    transform: translateY(-1px);
}

.form-field textarea,
.panel-body textarea {
    font-family: inherit;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 18px;
    padding: 18px;
    color: var(--text-primary);
    resize: vertical;
    min-height: 140px;
}

.panel-body textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(94, 234, 212, 0.25);
}

.script-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    width: 100%;
}

.script-grid.empty-state {
    grid-template-columns: 1fr;
    max-width: 600px;
}

.script-card {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 22px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    box-shadow: var(--shadow-soft);
    min-width: 0;
    width: 100%;
}

.script-body {
    color: var(--text-muted);
    line-height: 1.6;
    white-space: pre-line;
    word-wrap: break-word;
    overflow-wrap: break-word;
    min-width: 0;
}

.script-grid.empty-state p {
    color: var(--text-muted);
    text-align: center;
    padding: 40px 20px;
    font-size: 1rem;
}

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

.ghost-btn {
    flex: 1;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: transparent;
    color: var(--text-primary);
    padding: 10px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.ghost-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}

.ghost-btn.danger {
    border-color: rgba(248, 113, 113, 0.6);
    color: #fca5a5;
}

.timestamp {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.status-pill {
    min-height: 24px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.status-pill.pending {
    color: #facc15;
}

.status-pill.success {
    color: #34d399;
}

.status-pill.error {
    color: #f87171;
}

.settings-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
    width: 100%;
}

.settings-form .form-field {
    flex-direction: column;
    min-width: 0;
}

.settings-form .form-field span {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
}

.settings-form .form-field input,
.settings-form .form-field textarea {
    width: 100%;
}

/* Loading Animation */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    gap: 20px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top-color: var(--accent);
    animation: spin 1s ease-in-out infinite;
}

.loading-text {
    color: var(--text-muted);
    font-size: 0.95rem;
    animation: pulse 1.5s ease-in-out infinite;
}

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

@keyframes pulse {

    0%,
    100% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }
}

@media (max-width: 1100px) {
    .dashboard-shell {
        grid-template-columns: 1fr;
        height: auto;
    }

    .dashboard-nav {
        flex-direction: row;
        align-items: center;
        gap: 16px;
        flex-wrap: wrap;
    }

    .dashboard-nav nav {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .dashboard-content {
        padding: 24px;
    }
}

@media (max-width: 900px) {
    .login-container {
        display: flex;
        grid-template-columns: 1fr;
        padding: 28px;
    }

    .login-hero {
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
        padding-right: 0;
        padding-bottom: 24px;
    }
}

@media (max-width: 600px) {
    .login-container {
        padding: 24px;
    }

    .login-box {
        padding: 24px;
    }

    .signup-layout {
        padding: 28px;
        gap: 32px;
    }

    .stripe-element-container {
        flex-direction: column;
        gap: 18px;
    }

    body.signup-page {
        padding: 24px 16px;
    }

    body.dashboard-page {
        padding: 20px;
    }

    .panel-body {
        padding: 20px;
    }
}





/* Fix spacing for payment fields */
.stripe-element-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}