:root {
    --primary: #6366f1;
    --primary-glow: rgba(99, 102, 241, 0.4);
    --secondary: #a855f7;
    --bg-dark: #09090b;
    --surface: rgba(24, 24, 27, 0.7);
    --border: rgba(63, 63, 70, 0.4);
    --text-main: #fafafa;
    --text-muted: #a1a1aa;
    --error: #ef4444;
    --success: #22c55e;
    --warning: #f59e0b;
    --glass-grad: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.01) 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    overflow-x: hidden;
    max-width: 100%;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
}

h1,
h2,
h3,
h4,
.logo {
    font-family: 'Outfit', sans-serif;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.flex-justify {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Background Atmosphere */
.glow-bg {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100vh;
    background:
        radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(168, 85, 247, 0.15) 0%, transparent 40%);
    z-index: -1;
}

/* Navigation */
.demo-nav {
    padding: 1.5rem 0;
    background: rgba(9, 9, 11, 0.5);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo small {
    font-size: 0.7rem;
    background: var(--primary);
    color: white;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    text-transform: uppercase;
}

.back-link {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
    font-size: 0.9rem;
}

.back-link:hover {
    color: var(--text-main);
}

/* Main Layout */
.demo-wrapper {
    padding: 4rem 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.demo-header {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInDown 0.8s ease;
}

.demo-header h1 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.demo-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.demo-card-container {
    width: 650px;
    perspective: 1000px;
}

/* Stepper */
.stepper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    padding: 0 1rem;
}

.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    transition: all 0.4s ease;
}

.step-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

.step-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.step-item.active {
    color: var(--primary);
}

.step-item.active .step-icon {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 0 15px var(--primary-glow);
}

.step-item.completed {
    color: var(--success);
}

.step-item.completed .step-icon {
    background: var(--success);
    color: white;
    border-color: var(--success);
}

.step-connector {
    flex: 1;
    height: 1px;
    background: var(--border);
    margin: -1.5rem 0.5rem 0;
}

/* Glass Card */
.glass-card {
    background: var(--surface);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
}

.demo-step {
    display: none;
    animation: slideIn 0.5s ease;
}

.demo-step.active {
    display: block;
}

.step-title {
    margin-bottom: 2rem;
}

.step-title h3 {
    font-size: 1.5rem;
    margin-bottom: 0.4rem;
}

.step-title p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Form Elements */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.input-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-wrapper label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

.input-with-icon {
    position: relative;
}

.input-with-icon i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.9rem;
}

.input-with-icon input {
    width: 100%;
    padding: 0.8rem 1rem 0.8rem 2.8rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: white;
    font-family: inherit;
    transition: all 0.3s;
}

.input-with-icon input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(0, 0, 0, 0.4);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Buttons */
.btn-premium {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    font-family: inherit;
    justify-content: center;
}

.btn-premium:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px var(--primary-glow);
}

.btn-premium:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 0.8rem 2rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-outline:hover {
    border-color: var(--text-main);
    color: var(--text-main);
}

.button-footer {
    margin-top: 2.5rem;
    display: flex;
    justify-content: flex-end;
}

.split-btns {
    justify-content: space-between;
}

/* Preference Cards */
.preference-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.pref-card {
    cursor: pointer;
}

.pref-card input {
    display: none;
}

.pref-content {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: 16px;
    transition: all 0.4s;
    position: relative;
}

.pref-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--primary);
}

.pref-text h4 {
    font-size: 1.1rem;
    margin-bottom: 0.2rem;
}

.pref-text p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.pref-check {
    margin-left: auto;
    width: 24px;
    height: 24px;
    border: 2px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: transparent;
}

.pref-card input:checked+.pref-content {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

.pref-card input:checked+.pref-content .pref-check {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* Upload UI */
.upload-container {
    padding: 3rem;
    background: rgba(0, 0, 0, 0.2);
    border: 2px dashed var(--border);
    border-radius: 20px;
    text-align: center;
    transition: all 0.3s;
    margin-bottom: 1.5rem;
}

.upload-container.dragover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

.upload-icon-pulse {
    width: 80px;
    height: 80px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 50%;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: var(--primary);
}

.upload-controls {
    margin-top: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.upload-controls span {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.btn-upload {
    background: var(--surface);
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 0.6rem 1.5rem;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-upload:hover {
    background: var(--primary);
    color: white;
}

.selected-file-info {
    margin-top: 1.5rem;
    background: var(--surface);
    padding: 0.8rem 1.2rem;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.remove-file {
    margin-left: auto;
    background: transparent;
    border: none;
    color: var(--error);
    cursor: pointer;
}

/* Overlay & Review */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    text-align: center;
}

.brain-loader {
    margin-bottom: 2rem;
    position: relative;
}

.brain-icon {
    font-size: 4rem;
    color: var(--primary);
    animation: pulseBrain 2s infinite;
}

.loading-waves {
    display: flex;
    gap: 5px;
    justify-content: center;
    margin-top: 10px;
}

.loading-waves span {
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    animation: wave 1.2s infinite;
}

.loading-waves span:nth-child(2) {
    animation-delay: 0.2s;
}

.loading-waves span:nth-child(3) {
    animation-delay: 0.4s;
}

/* Review UI */
.demo-review {
    animation: fadeInUp 0.6s ease;
}

.review-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.confidence-meter {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.conf-label {
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--text-muted);
}

.meter-track {
    width: 100px;
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    overflow: hidden;
}

.meter-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--success));
}

.conf-value {
    font-weight: 700;
    color: var(--success);
    font-size: 0.9rem;
}

.voucher-box {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    padding: 2rem;
    border: 1px solid var(--border);
}

.vch-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.meta-pill {
    background: var(--surface);
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    font-size: 0.85rem;
}

.party-box {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    padding: 1rem;
    background: rgba(99, 102, 241, 0.05);
    border-radius: 12px;
    margin-bottom: 2rem;
}

.party-box i {
    font-size: 1.5rem;
    color: var(--primary);
}

.review-tables-premium {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.table-wrap h5 {
    margin-bottom: 0.8rem;
    color: var(--primary);
    text-transform: uppercase;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    text-align: left;
    padding: 0.8rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
}

th {
    color: var(--text-muted);
    font-weight: 500;
}

.insight-cards {
    margin-top: 2rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.insight-card {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1rem;
    border-radius: 12px;
    font-size: 0.8rem;
}

.insight-card.success {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success);
}

.insight-card.warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

/* Utilities & Animations */
.gradient-text {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulseBrain {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
        filter: drop-shadow(0 0 0px var(--primary));
    }

    50% {
        transform: scale(1.1);
        opacity: 0.8;
        filter: drop-shadow(0 0 20px var(--primary));
    }
}

@keyframes wave {

    0%,
    60%,
    100% {
        transform: scale(1);
    }

    30% {
        transform: scale(1.5);
    }
}

.btn-glow {
    position: relative;
    overflow: hidden;
}

.btn-glow::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, transparent 70%);
    opacity: 0;
    transition: 0.5s;
}

.btn-glow:hover::after {
    opacity: 1;
}

.w-100 {
    width: 100%;
}

.demo-footer {
    padding: 3rem 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

@media (max-width: 700px) {
    .demo-card-container {
        width: 95%;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .demo-header h1 {
        font-size: 2.2rem;
    }

    .insight-cards {
        grid-template-columns: 1fr;
    }
}