:root {
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;

    /* Modern Palette - Reverted to Original Bright Scheme */
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-soft: #dbeafe;
    --primary-light: #bfdbfe;

    --bg-gradient-start: #0ea5e9;
    --bg-gradient-end: #2563eb;

    --surface: #ffffff;
    --surface-alt: #f8fafc;

    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-inverse: #ffffff;

    --border: #e5e7eb;
    --border-focus: #2563eb;

    --success: #22c55e;
    --error: #ef4444;

    --radius-lg: 18px;
    --radius-md: 12px;
    --radius-sm: 8px;

    --shadow-lg: 0 14px 40px rgba(15, 23, 42, .18), 0 3px 10px rgba(15, 23, 42, .10);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);

    --ease-spring: cubic-bezier(0.4, 0.0, 0.2, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    min-height: 100vh;
    font-family: var(--font-sans);
    color: var(--text-main);
    background: linear-gradient(180deg, var(--bg-gradient-start), var(--bg-gradient-end));
    background-attachment: fixed;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    -webkit-font-smoothing: antialiased;
}

.wrap {
    width: 100%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Header */
header {
    text-align: center;
    color: var(--text-inverse);
    animation: slideDown 0.6s var(--ease-spring);
}

header .brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 16px;
}

header img.logo {
    height: 48px;
    width: auto;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.3));
}

header h1 {
    margin: 0 0 8px;
    font-size: clamp(24px, 5vw, 36px);
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #ffffff;
    opacity: 1;
    text-shadow: none;
}

header p {
    margin: 0 auto;
    font-size: 16px;
    color: var(--primary-light);
    max-width: 600px;
    line-height: 1.5;
}

/* Main Card */
.card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    animation: scaleIn 0.5s var(--ease-spring) 0.1s both;
}

/* Progress Bar */
.topbar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 32px;
}

.progress {
    flex: 1;
    height: 8px;
    background: var(--surface-alt);
    border-radius: 999px;
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

.bar {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--primary), #3b82f6);
    border-radius: 999px;
    transition: width 0.3s ease-out;
}

.count {
    min-width: 90px;
    text-align: right;
    font-weight: 700;
    font-size: 14px;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

/* Steps */
.step {
    display: none;
}

.step.active {
    display: block;
    animation: slideUpFade 0.4s ease-out;
    transform: none;
}

.step-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 24px;
}

.step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.step-header h2 {
    margin: 0 0 4px;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.01em;
}

.step-description {
    margin: 0;
    font-size: 15px;
    color: var(--text-muted);
}

/* Inputs & Form Elements */
.question-container {
    margin: 20px 0;
}

select,
textarea,
input[type="text"] {
    width: 100%;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    font-size: 15px;
    font-family: inherit;
    transition: all 0.2s ease;
    background: var(--surface-alt);
    color: var(--text-main);
}

select:hover,
textarea:hover,
input[type="text"]:hover {
    border-color: var(--text-muted);
}

select:focus,
textarea:focus,
input[type="text"]:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
    background: var(--surface);
}

textarea {
    min-height: 200px;
    resize: vertical;
    line-height: 1.6;
}

/* Options Grid */
.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
}

.option-card,
.shoutout-option {
    display: block;
    border-radius: var(--radius-md);
    padding: 16px;
    border: 2px solid var(--surface-alt);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--surface);
    position: relative;
    /* Staggered entry for cards */
    animation: slideUpFade 0.5s var(--ease-spring) backwards;
}

/* Stagger delays */
.option-card:nth-child(1) {
    animation-delay: 0.1s;
}

.option-card:nth-child(2) {
    animation-delay: 0.15s;
}

.option-card:nth-child(3) {
    animation-delay: 0.2s;
}

.option-card:nth-child(4) {
    animation-delay: 0.25s;
}

.option-card:nth-child(5) {
    animation-delay: 0.3s;
}

.option-card:nth-child(6) {
    animation-delay: 0.35s;
}

.option-card:hover,
.shoutout-option:hover {
    border-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.option-card input,
.shoutout-option input {
    display: none;
}

.option-card.selected,
.shoutout-option.selected {
    border-color: var(--primary);
    background: var(--primary-soft);
    box-shadow: 0 0 0 1px var(--primary);
}

.option-content {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: var(--text-main);
}

.option-icon {
    font-size: 24px;
    line-height: 1;
    filter: grayscale(0.2);
    transition: transform 0.2s;
}

.option-card:hover .option-icon,
.option-card.selected .option-icon {
    transform: scale(1.1);
    filter: grayscale(0);
}

.option-text {
    font-weight: 600;
    line-height: 1.4;
}

/* Buttons */
.step-actions {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.btn {
    appearance: none;
    border-radius: var(--radius-sm);
    padding: 12px 24px;
    border: 1px solid transparent;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.btn.primary {
    background: var(--primary);
    color: var(--text-inverse);
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2);
}

.btn.primary:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 8px 12px -2px rgba(37, 99, 235, 0.25);
}

.btn.ghost {
    background: transparent;
    color: var(--text-muted);
    border-color: transparent;
}

.btn.ghost:hover:not(:disabled) {
    color: var(--text-main);
    background: var(--surface-alt);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    background: var(--surface-alt);
    color: var(--text-muted);
}

/* Shoutout Section */
.shoutout-section {
    margin-top: 16px;
    padding: 20px;
    border-radius: var(--radius-md);
    background: var(--surface-alt);
    border: 1px dashed var(--border);
}

.shoutout-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

.shoutout-toggle input {
    accent-color: var(--primary);
    width: 20px;
    height: 20px;
}

.toggle-text {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-main);
}

.shoutout-details {
    display: none;
    margin-top: 16px;
    padding: 16px;
    background: var(--surface);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    animation: slideDown 0.3s ease;
}

/* Banners */
.banner {
    display: none;
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: slideUp 0.3s ease;
}

.banner.ok {
    background: rgba(16, 185, 129, 0.1);
    color: #065f46;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.banner.error {
    background: rgba(239, 68, 68, 0.1);
    color: #7f1d1d;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Pill & Steps */
.pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--surface-alt);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.steps {
    margin-top: 12px;
    padding-left: 20px;
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.6;
}

/* Animations Mode */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Responsive */
@media (max-width: 640px) {
    body {
        padding: 16px;
        align-items: flex-start;
    }

    .card {
        padding: 20px;
    }

    .step-actions {
        flex-wrap: wrap;
    }

    .step-actions .btn.primary,
    .step-actions .btn.ghost {
        flex: 1 0 100%;
        order: 1;
    }

    .step-actions .btn.ghost {
        order: 2;
        margin-top: 8px;
    }

    .options-grid {
        grid-template-columns: 1fr;
    }
}