:root {
    /* Aurora Nightfall Palette */
    --primary-gradient: linear-gradient(135deg, #4f46e5 0%, #8b5cf6 40%, #ec4899 100%);
    --secondary-gradient: linear-gradient(135deg, #020617 0%, #0f172a 50%, #1e293b 100%);
    --soft-gradient: linear-gradient(135deg, #22c55e 0%, #0ea5e9 100%);
    --accent-gradient: linear-gradient(135deg, #38bdf8 0%, #6366f1 100%);

    /* Modern Dark Aurora */
    --bg-body: #020617;
    --bg-card: rgba(15, 23, 42, 0.96);
    --bg-card-soft: #0b1220;
    --bg-glass: rgba(15, 23, 42, 0.82);
    --border-subtle: rgba(148, 163, 184, 0.32);
    --accent: #38bdf8;
    --accent-dark: #0ea5e9;
    --accent-soft: rgba(56, 189, 248, 0.2);
    --text-main: #e5e7eb;
    --text-muted: #9ca3af;
    --danger: #f87171;
    --success: #34d399;

    /* Glassmorphism */
    --glass-bg: rgba(15, 23, 42, 0.7);
    --glass-border: rgba(148, 163, 184, 0.3);
}

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

body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "SF Pro Text",
        "Segoe UI", Roboto, sans-serif;
    background: var(--bg-body);
    color: var(--text-main);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Animated Background Gradient */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 0% 0%, rgba(248, 113, 113, 0.16) 0, transparent 55%),
        radial-gradient(circle at 100% 0%, rgba(129, 140, 248, 0.22) 0, transparent 55%),
        radial-gradient(circle at 0% 100%, rgba(45, 212, 191, 0.16) 0, transparent 55%),
        linear-gradient(135deg, #020617 0%, #020617 40%, #020617 100%);
    background-size: 200% 200%;
    animation: gradientShift 20s ease infinite;
    z-index: -1;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Floating Particles */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(255, 255, 255, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(255, 255, 255, 0.06) 0%, transparent 50%);
    animation: float 20s ease-in-out infinite;
    pointer-events: none;
    z-index: -1;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }
}

.page {
    max-width: 920px;
    margin: 48px auto;
    padding: 0 20px 48px;
    position: relative;
    z-index: 1;
}

.card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    border: 1px solid var(--glass-border);
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.5) inset;
    padding: 42px 40px 46px;
    animation: fadeInUp 0.7s ease-out;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-gradient);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

h1 {
    margin: 0 0 8px;
    font-size: 36px;
    font-weight: 800;
    letter-spacing: -0.03em;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.subtitle {
    margin: 0 0 24px;
    color: var(--text-muted);
    font-size: 16px;
    font-weight: 400;
    line-height: 1.6;
}

.section {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 2px solid var(--border-subtle);
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.section h2 {
    margin: 0 0 6px;
    font-size: 22px;
    font-weight: 700;
    color: var(--accent-dark);
}

.section p.section-help {
    margin: 0 0 18px;
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.5;
}

.two-col {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px 20px;
}

.field {
    margin-bottom: 16px;
}

.field label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-main);
}

.field small {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
    line-height: 1.4;
}

input[type="text"],
input[type="email"],
select,
textarea {
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    border: 2px solid var(--border-subtle);
    font-size: 15px;
    font-family: 'Inter', inherit;
    color: var(--text-main);
    background: var(--bg-card-soft);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 400;
}

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

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--bg-card-soft);
    box-shadow: 0 0 0 4px var(--accent-soft),
        0 4px 12px rgba(102, 126, 234, 0.15);
    transform: translateY(-1px);
}

input::placeholder,
textarea::placeholder {
    color: #9ca3af;
    opacity: 1;
}

.question {
    margin-bottom: 24px;
    padding: 20px 22px 18px;
    border-radius: 16px;
    background: var(--bg-card-soft);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(102, 126, 234, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.question:hover {
    border-color: rgba(102, 126, 234, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.12);
}

.q-label {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-main);
    line-height: 1.5;
}

.q-help {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 10px;
    line-height: 1.4;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.chip {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    border: 2px solid var(--border-subtle);
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    background: var(--bg-card-soft);
    color: var(--text-main);
    user-select: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.chip:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
    transform: scale(1.03);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.chip input {
    display: none;
}

.chip.chip-selected {
    background: var(--accent);
    border-color: var(--accent);
    color: #ffffff;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
}

.chip-checkbox {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    border: 2px solid var(--border-subtle);
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    background: var(--bg-card-soft);
    color: var(--text-main);
    user-select: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.chip-checkbox:hover {
    border-color: var(--accent);
    transform: scale(1.03);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.chip-checkbox input[type="checkbox"] {
    display: none;
}

.chip-checkbox:has(input[type="checkbox"]:checked) {
    background: var(--accent);
    border-color: var(--accent);
    color: #ffffff;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
}

.chip-checkbox span {
    display: inline-block;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.likert-row {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: 8px;
    flex-wrap: wrap;
}

.likert-row label {
    font-size: 13px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 8px;
    transition: all 0.2s;
}

.likert-row label:hover {
    background: var(--accent-soft);
}

.likert-row input[type="radio"] {
    cursor: pointer;
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
}

.slider-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
}

.slider-wrapper input[type="range"] {
    flex: 1;
    height: 8px;
    border-radius: 999px;
    background: linear-gradient(to right, var(--accent-soft), var(--accent));
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.slider-wrapper input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
    transition: all 0.2s;
}

.slider-wrapper input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.6);
}

.slider-wrapper input[type="range"]::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
    transition: all 0.2s;
}

.slider-wrapper input[type="range"]::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.6);
}

.slider-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--accent);
    min-width: 48px;
    text-align: right;
}

.radio-group {
    margin-top: 10px;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 6px;
    padding: 6px 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.radio-group label:hover {
    background: var(--accent-soft);
}

.radio-group input[type="radio"] {
    cursor: pointer;
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
}

.free-response {
    margin-top: 10px;
}

.question-index {
    font-size: 11px;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 4px;
}

.actions {
    margin-top: 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

button[type="submit"],
.pageclip-form__submit {
    border: none;
    border-radius: 999px;
    padding: 14px 32px;
    font-size: 15px;
    font-weight: 600;
    background: var(--primary-gradient);
    color: #ffffff;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}

button[type="submit"]::before,
.pageclip-form__submit::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

button[type="submit"]:hover,
.pageclip-form__submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(102, 126, 234, 0.5);
}

button[type="submit"]:hover::before,
.pageclip-form__submit:hover::before {
    width: 300px;
    height: 300px;
}

button[type="submit"]:active,
.pageclip-form__submit:active {
    transform: translateY(0);
}

.note {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.error {
    font-size: 13px;
    color: var(--danger);
    margin-top: 6px;
    font-weight: 600;
    padding: 12px 16px;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 12px;
    border-left: 4px solid var(--danger);
}

@media (max-width: 768px) {
    .page {
        margin: 24px auto;
        padding: 0 16px 32px;
    }

    .card {
        padding: 28px 24px 32px;
        border-radius: 20px;
    }

    h1 {
        font-size: 28px;
    }

    .subtitle {
        font-size: 14px;
    }

    .section h2 {
        font-size: 20px;
    }

    .actions {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    button[type="submit"],
    .pageclip-form__submit {
        width: 100%;
        padding: 16px 32px;
    }

    .two-col {
        grid-template-columns: 1fr;
    }
}

/* Loading state for Pageclip */
.pageclip-form__submit.pageclip-form__submit--loading {
    opacity: 0.7;
    pointer-events: none;
}

.pageclip-form__submit.pageclip-form__submit--success {
    background: var(--success);
}
