:root {
    --bg-color: #000000;
    --text-color: #ffffff;
    --accent-color: #ffffff;
    --dim-color: rgba(255, 255, 255, 0.3);
    --card-bg: rgba(255, 255, 255, 0.04);
    --card-hover: rgba(255, 255, 255, 0.08);
    --transition-bezier: cubic-bezier(0.16, 1, 0.3, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
    outline: none;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body,
html {
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow: hidden;
    overscroll-behavior: none;
}

/* ── Slider Container ── */
#slider-container {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.8s var(--transition-bezier);
    will-change: transform;
}

.slide {
    min-width: 100vw;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: 40px 10vw;
    position: relative;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior-y: contain;
}

.slide::-webkit-scrollbar {
    display: none;
}

.slide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* ── Content Animations ── */
.content-wrapper {
    margin: auto 0;
    width: 100%;
    max-width: 850px;
    opacity: 0;
    transform: translateY(30px) scale(0.99);
    transition: all 0.8s var(--transition-bezier);
    transition-delay: 0.1s;
    padding: 40px 0 120px 0;
}

.slide.active .content-wrapper {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* ── Typography ── */
.slide-number {
    font-size: 0.85rem;
    letter-spacing: 5px;
    color: var(--dim-color);
    margin-bottom: 2rem;
    text-transform: uppercase;
    font-weight: 500;
}

h1 {
    font-size: 3.2rem;
    font-weight: 300;
    line-height: 1.15;
    margin-bottom: 2.5rem;
    letter-spacing: -0.5px;
}

p.desc {
    font-size: 1.15rem;
    color: var(--dim-color);
    margin-bottom: 3.5rem;
    line-height: 1.7;
    font-weight: 300;
    white-space: pre-wrap;
}

/* ── Inputs ── */
.input-group {
    margin-bottom: 4rem;
    width: 100%;
}

textarea,
input[type="text"],
input[type="email"] {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--dim-color);
    color: var(--text-color);
    font-size: 1.4rem;
    font-weight: 300;
    padding: 15px 0;
    resize: none;
    transition: border-color 0.4s var(--transition-bezier);
}

textarea:focus,
input[type="text"]:focus,
input[type="email"]:focus {
    border-bottom-color: var(--accent-color);
}

textarea::placeholder,
input::placeholder {
    color: var(--dim-color);
    font-weight: 300;
}

/* ── Option Cards ── */
.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}

.option-card {
    background: var(--card-bg);
    padding: 22px 25px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s var(--transition-bezier);
    font-size: 1.1rem;
    font-weight: 300;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid transparent;
}

.option-card:hover {
    background: var(--card-hover);
}

.option-card.selected {
    background: var(--accent-color);
    color: var(--bg-color);
    font-weight: 500;
    transform: scale(1.02);
    box-shadow: 0 10px 30px rgba(255, 255, 255, 0.1);
}

.opt-indicator {
    font-size: 0.9rem;
    opacity: 0.6;
}

.option-card.selected .opt-indicator {
    opacity: 1;
}

/* ── Linear Scale ── */
.scale-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 650px;
    margin: 3rem 0;
    position: relative;
}

.scale-line {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--dim-color);
    z-index: 0;
}

.scale-item {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.scale-circle {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--bg-color);
    border: 1px solid var(--dim-color);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s var(--transition-bezier);
    font-weight: 400;
    font-size: 1.1rem;
    color: var(--dim-color);
}

.scale-item:hover .scale-circle {
    border-color: var(--text-color);
    color: var(--text-color);
    transform: scale(1.1);
}

.scale-item.selected .scale-circle {
    background: var(--text-color);
    color: var(--bg-color);
    border-color: var(--text-color);
    font-weight: 500;
    transform: scale(1.15);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
}

/* ── Tools Flex Layout ── */
.tools-flex-layout {
    display: flex;
    gap: 20px;
    width: 100%;
    margin-bottom: 3rem;
    padding-bottom: 15px;
}

.tools-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.tool-rating-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: border-color 0.3s ease, background 0.3s ease;
}

.tool-rating-card:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
}

.tool-name {
    font-size: 1.1rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.95);
}

.tool-stars {
    display: flex;
    gap: 8px;
}

.tool-star-svg {
    width: 28px;
    height: 28px;
    fill: transparent;
    stroke: var(--dim-color);
    stroke-width: 1.5;
    cursor: pointer;
    transition: all 0.2s var(--transition-bezier);
}

.tool-star-svg:hover {
    transform: scale(1.15);
    stroke: #FFD700;
}

.tool-star-svg.selected {
    fill: #FFD700;
    stroke: #FFD700;
    filter: drop-shadow(0 0 6px rgba(255, 215, 0, 0.4));
}

/* ── Buttons ── */
.global-nav {
    position: fixed;
    bottom: 45px;
    right: 8vw;
    display: flex;
    gap: 15px;
    z-index: 50;
    transition: opacity 0.4s var(--transition-bezier);
}

.btn-wrapper {
    display: flex;
    gap: 15px;
    margin-top: 1rem;
}

.btn {
    background: var(--text-color);
    color: var(--bg-color);
    border: none;
    padding: 16px 36px;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 24px 6px 24px 6px;
    /* Unique forward-leaning dynamic shape */
    cursor: pointer;
    transition: all 0.3s var(--transition-bezier);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 160px;
    min-height: 54px;
    letter-spacing: 0.5px;
}

.btn:hover {
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 10px 25px rgba(255, 255, 255, 0.2);
}

.btn-secondary {
    background: transparent;
    color: var(--text-color);
    border: 1px solid var(--dim-color);
    border-radius: 6px 24px 6px 24px;
    /* Backwards-leaning shape */
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: scale(1) translateY(-2px);
    border-color: var(--text-color);
    box-shadow: none;
}

#btn-back {
    transition: all 0.7s var(--transition-bezier);
    opacity: 1;
    transform: translateX(0);
    max-width: 160px;
    overflow: hidden;
    white-space: nowrap;
}

#btn-back.hidden {
    opacity: 0;
    transform: translateX(100px);
    max-width: 0;
    min-width: 0;
    padding-left: 0;
    padding-right: 0;
    margin-right: -15px;
    pointer-events: none;
    color: transparent;
    border-color: transparent;
}

/* ── Background Elements ── */
.bg-glow {
    position: absolute;
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.02) 0%, rgba(0, 0, 0, 0) 60%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: -1;
    transition: transform 1.2s var(--transition-bezier);
}

/* ── Progress Bar ── */
#progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 2px;
    background: var(--text-color);
    width: 0%;
    transition: width 0.8s var(--transition-bezier);
    z-index: 100;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

.star-icon {
    width: 1.2em;
    height: 1.2em;
    vertical-align: -0.15em;
    fill: #FFD700;
    display: inline-block;
    filter: drop-shadow(0 2px 5px rgba(255, 215, 0, 0.25));
}

.other-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 12px 20px;
    color: var(--text-color);
    font-size: 1rem;
    margin-top: -10px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.other-input:focus {
    border-color: #FFD700;
    background: rgba(255, 255, 255, 0.06);
    outline: none;
}

.other-input.hidden {
    display: none;
}


/* ── Top Bar ── */
.top-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px 4vw;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    font-size: 0.9rem;
    color: var(--dim-color);
    pointer-events: none;
    /* Let clicks pass through except on links */
}

.top-bar a {
    color: aqua;
    text-decoration: none;
    pointer-events: auto;
    transition: opacity 0.3s ease;
}

.top-bar a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.top-right {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-color);
    letter-spacing: 0.5px;
}

/* ── Mobile Responsive Design ── */
@media (max-width: 768px) {
    /* Adjust main Typography and Spacing */
    h1 {
        font-size: 2.1rem;
        margin-bottom: 1.2rem;
        line-height: 1.2;
        letter-spacing: -0.2px;
    }
    p.desc {
        font-size: 1.05rem;
        margin-bottom: 2rem;
        line-height: 1.6;
    }
    .slide {
        padding: 80px 6vw 40px 6vw; /* Clearer top for top bar */
    }
    .content-wrapper {
        padding: 0 0 130px 0; /* Space for the bottom nav */
    }

    /* Adjust Inputs */
    textarea, input[type="text"], input[type="email"] {
        font-size: 1.2rem;
        padding: 12px 0;
    }

    /* Option Cards */
    .options-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .option-card {
        padding: 18px 20px;
        font-size: 1.05rem;
        border-radius: 12px; /* Slightly rounder for mobile tactile feel */
    }

    /* Scale / Rating (1-10 wrap on mobile) */
    .scale-container {
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        gap: 12px 8px;
        justify-content: center;
        margin: 2rem auto;
        max-width: 100%;
    }
    .scale-line {
        display: none; /* Hide absolute line because grid breaks it */
    }
    .scale-item {
        width: 100%;
    }
    .scale-circle {
        width: 100%;
        max-width: 48px;
        aspect-ratio: 1/1;
        height: auto;
        font-size: 1.05rem;
    }

    /* Tools Flex Layout (1-5 Grid) */
    .tools-flex-layout {
        flex-direction: column;
        gap: 15px;
    }
    .tool-rating-card {
        padding: 18px 20px;
        gap: 12px;
        border-radius: 16px;
    }
    .tool-name {
        font-size: 1.05rem;
        text-align: center;
        margin-bottom: 4px;
    }
    .tool-stars {
        justify-content: center;
        gap: 12px;
    }
    .tool-star-svg {
        width: 38px;
        height: 38px;
    }

    /* Navigation Buttons */
    .global-nav {
        right: 0;
        bottom: 0;
        width: 100%;
        justify-content: center;
        gap: 12px;
        padding: 20px 6vw 30px 6vw; /* Extra bottom padding for iOS safe area */
        background: linear-gradient(to top, rgba(0,0,0,0.95) 40%, rgba(0,0,0,0.6) 80%, transparent);
        pointer-events: none; /* let touches pass where transparent */
    }
    .global-nav > * {
        pointer-events: auto; /* Buttons are clickable */
    }
    
    .btn {
        padding: 15px 24px;
        font-size: 1.05rem;
        min-width: 0;
        min-height: 54px;
        flex: 1;
        max-width: 260px;
        border-radius: 20px 8px 20px 8px;
    }
    .btn-secondary {
        border-radius: 8px 20px 8px 20px;
    }
    #btn-back {
        flex: 0.45;
        max-width: 140px;
    }
    #btn-back.hidden {
        flex: 0;
        min-width: 0;
        max-width: 0;
        margin: 0;
        padding: 0;
        border: none;
    }

    /* Top Bar Mobile Modifications */
    .top-bar {
        padding: 15px 6vw;
        justify-content: center;
        background: rgba(0, 0, 0, 0.7);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }
    .top-right {
        display: none;
    }
    .top-left {
        font-size: 0.9rem;
        text-align: center;
    }
    
    .slide-number {
        margin-top: 10px; /* Offset for top bar */
    }
}

/* Extra small devices */
@media (max-width: 400px) {
    h1 {
        font-size: 1.8rem;
    }
    .scale-circle {
        max-width: 42px;
    }
    .btn {
        font-size: 0.95rem;
        padding: 14px 16px;
    }
    .tool-star-svg {
        width: 32px;
        height: 32px;
    }
}

/* Animations and touch targets */
@media (hover: none) {
    .option-card:active {
        background: var(--card-hover);
        transform: scale(0.98);
    }
    .btn:active {
        transform: scale(0.98);
    }
}