/* Survey Frontend Styles */
:root {
    --primary: #002652;
    --primary-dark: #001a3a;
    --primary-light: #e8edf3;
    --success: #22c55e;
    --bg: #f5f5f5;
    --card-bg: #fff;
    --border: #d0d0d0;
    --text: #002652;
    --text-light: #4a5568;
    --radius: 6px;
    --shadow: 0 2px 4px rgba(0,38,82,0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Helvetica, Arial, sans-serif;
    background: #fff;
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
}

.survey-container {
    max-width: 680px;
    margin: 0 auto;
    padding: 1rem;
}

/* Header */
.survey-header {
    text-align: center;
    margin-bottom: 1rem;
}

.survey-header h1 {
    margin: 0 0 0.25rem;
    font-size: 1.5rem;
    font-weight: 700;
}

.survey-description {
    color: var(--text-light);
    margin: 0;
    font-size: 0.95rem;
}

/* Progress bar */
.progress-bar {
    height: 5px;
    background: var(--border);
    border-radius: 3px;
    margin-bottom: 1rem;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* Form */
.survey-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Questions */
.question-wrapper {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1rem;
    box-shadow: var(--shadow);
    border: 1px solid #e5e5e5;
}

.question-text {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.required {
    color: #ef4444;
}

.help-text {
    color: var(--text-light);
    font-size: 0.85rem;
    margin: -0.25rem 0 0.5rem;
}

/* Section headers */
.section-header {
    margin: 1rem 0 0.5rem;
    padding-bottom: 0.25rem;
    border-bottom: 2px solid var(--primary);
}

.section-header:first-of-type {
    margin-top: 0;
}

.section-header h2 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
}

/* Text input */
.text-input,
.textarea-input,
.number-input,
.dropdown-input {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: var(--card-bg);
}

.text-input:focus,
.textarea-input:focus,
.number-input:focus,
.dropdown-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* Textarea */
.textarea-input {
    resize: vertical;
    min-height: 70px;
}

/* Number input */
.number-input {
    max-width: 200px;
}

/* Dropdown */
.dropdown-input {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23002652' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

/* Other input (for "Annet" options) */
.other-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.9rem;
    margin-top: 0.4rem;
    transition: border-color 0.2s, box-shadow 0.2s, opacity 0.2s;
}

.other-input:disabled {
    opacity: 0.5;
    background: var(--bg);
    cursor: not-allowed;
}

.other-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* Options grid */
.options-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.option-label {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
}

/* Radio: inline på desktop */
.option-label.radio {
    flex: 0 0 auto;
}

/* Checkbox: flyter med wrap */
.option-label.checkbox {
    flex: 0 0 auto;
}

.option-label:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.option-label input {
    margin-right: 0.5rem;
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

.option-label input:checked + .option-text {
    font-weight: 500;
}

.option-label:has(input:checked) {
    border-color: var(--primary);
    background: var(--primary-light);
}

.option-text {
    white-space: nowrap;
}

/* Slider */
.slider-container {
    padding: 0.5rem 0;
}

.slider-input {
    width: 100%;
    height: 8px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--border);
    border-radius: 4px;
    outline: none;
}

.slider-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
    transition: transform 0.2s;
}

.slider-input::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.slider-input::-moz-range-thumb {
    width: 24px;
    height: 24px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 0.75rem;
    color: var(--text-light);
    font-size: 0.9rem;
}

.slider-value {
    font-weight: 600;
    color: var(--primary);
    font-size: 1.1rem;
}

/* Buttons */
.form-actions {
    margin-top: 0.75rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.7rem 1.5rem;
    border: none;
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-large {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Thank you message */
.thank-you-message {
    text-align: center;
    padding: 3rem 2rem;
}

.thank-you-content {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 3rem 2rem;
    box-shadow: var(--shadow);
}

.checkmark {
    width: 80px;
    height: 80px;
    background: var(--success);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin: 0 auto 1.5rem;
    animation: scaleIn 0.5s ease;
}

@keyframes scaleIn {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

.thank-you-content h2 {
    margin: 0 0 0.5rem;
    font-size: 1.75rem;
}

.thank-you-content p {
    color: var(--text-light);
    margin: 0;
    font-size: 1.1rem;
}

/* Coupon code */
.coupon-code {
    margin-top: 1.5rem;
    padding: 1rem 1.5rem;
    background: #fef3c7;
    border: 2px dashed #f59e0b;
    border-radius: var(--radius);
}

.coupon-code .label {
    font-size: 0.85rem;
    color: #92400e;
    margin-bottom: 0.25rem;
}

.coupon-code .code {
    font-size: 1.5rem;
    font-weight: 700;
    color: #92400e;
    font-family: monospace;
}

/* Loading state */
.btn.loading {
    position: relative;
    color: transparent;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid white;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Validation */
.question-wrapper.invalid {
    animation: shake 0.5s ease;
}

.question-wrapper.invalid .text-input,
.question-wrapper.invalid .option-label {
    border-color: #ef4444;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Hidden elements */
.hidden {
    display: none !important;
}

/* Exit link button */
.exit-link-btn {
    margin-top: 1.5rem;
}

/* GDPR Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 38, 82, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal-overlay.hidden {
    display: none;
}

.modal-content {
    background: var(--card-bg);
    border-radius: var(--radius);
    max-width: 540px;
    width: 100%;
    padding: 2rem;
    box-shadow: 0 20px 40px rgba(0, 38, 82, 0.3);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content h2 {
    margin: 0 0 1.5rem;
    color: var(--primary);
    font-size: 1.5rem;
}

.modal-body {
    margin-bottom: 1.5rem;
}

.modal-body p {
    margin: 0 0 1rem;
}

.modal-body ul {
    margin: 0 0 1rem;
    padding-left: 1.25rem;
}

.modal-body li {
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

.gdpr-note {
    font-size: 0.9rem;
    color: var(--text-light);
    font-style: italic;
}

.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.consent-checkbox {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
}

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

.consent-checkbox span {
    font-weight: 500;
}

.modal-actions .btn {
    width: 100%;
}

.modal-actions .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Responsive */
@media (max-width: 600px) {
    .survey-container {
        padding: 0.75rem;
    }

    .question-wrapper {
        padding: 0.75rem;
    }

    .survey-header h1 {
        font-size: 1.25rem;
    }

    .modal-content {
        padding: 1rem;
    }

    /* På mobil: stack options vertikalt hvis de har lang tekst */
    .options-grid {
        gap: 0.35rem;
    }

    .option-label {
        padding: 0.45rem 0.6rem;
        font-size: 0.85rem;
    }
}
