:root {
    --primary: #ff8c69;
    /* Coral/Peach */
    --secondary: #4a90e2;
    /* Sky Blue */
    --accent: #ffcc33;
    /* Sunlight Yellow */
    --success: #48bb78;
    --text-dark: #2d3748;
    --text-light: #718096;
    --bg-glass: rgba(255, 255, 255, 0.85);
    --shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    --radius: 20px;
    --font-main: 'Anuphan', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-main);
    color: var(--text-dark);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 2rem 1rem;
    overflow-x: hidden;
    position: relative;
    background: #f7fafc;
}

/* Background Image styling */
.background-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('happiness_abstract_background.png');
    /* We will assume the local copy name */
    background-size: cover;
    background-position: center;
    z-index: -1;
    opacity: 0.6;
    filter: blur(50px);
}

/* Fallback background if image is not found */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #fff9e6 0%, #e6f7ff 50%, #ffe6e6 100%);
    z-index: -2;
}

.app-container {
    width: 100%;
    max-width: 700px;
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 3rem;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

@media (max-width: 480px) {
    .app-container {
        padding: 1.5rem;
    }
}

/* Progress Bar */
.progress-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: var(--radius) var(--radius) 0 0;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--secondary), var(--primary));
    transition: width 0.4s ease;
}

/* Form Steps */
.step {
    display: none;
    animation: fadeIn 0.5s ease;
}

.step.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hero Section */
.hero-section {
    text-align: center;
}

.logo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.logo-sakaeo {
    width: 75px;
    height: auto;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.1));
}

.logo-paopulse {
    width: 180px;
    height: auto;
    animation: logoPulse 4s infinite ease-in-out;
}

@keyframes logoPulse {

    0%,
    100% {
        transform: scale(1);
        filter: drop-shadow(0 0 0px rgba(255, 140, 105, 0));
    }

    50% {
        transform: scale(1.03);
        filter: drop-shadow(0 10px 20px rgba(255, 140, 105, 0.2));
    }
}

.logo-wrapper {
    width: 80px;
    height: 80px;
    background: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 1.5rem;
    box-shadow: 0 10px 20px rgba(255, 140, 105, 0.2);
    color: var(--primary);
}

.pulse-icon {
    width: 40px;
    height: 40px;
    animation: heartbeat 1.5s infinite;
}

@keyframes heartbeat {
    0% {
        transform: scale(1);
    }

    15% {
        transform: scale(1.1);
    }

    30% {
        transform: scale(1);
    }

    45% {
        transform: scale(1.15);
    }

    60% {
        transform: scale(1);
    }
}

h1 {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: 2px;
    background: linear-gradient(90deg, #4a90e2, #ff8c69);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1.2rem;
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

.title-badge {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    background: var(--accent);
    color: #856404;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

.instruction-card {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    text-align: left;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
}

.instruction-card h3 {
    margin-bottom: 1rem;
    color: var(--primary);
}

.instruction-card p {
    line-height: 1.7;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.time-estimate {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-light);
    font-size: 0.9rem;
    border-top: 1px solid #eee;
    padding-top: 1rem;
}

/* Typography & Labels */
.section-header {
    margin-bottom: 2.5rem;
}

.step-counter {
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
}

h2 {
    font-size: 1.8rem;
    margin: 0.5rem 0;
}

.instruction-text {
    color: var(--text-light);
    font-size: 0.95rem;
}

.question-label {
    display: block;
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 1.2rem;
    line-height: 1.4;
}

.helper-text {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: -0.8rem;
    margin-bottom: 1rem;
}

/* Form Controls */
.form-group {
    margin-bottom: 2.5rem;
}

.form-select,
.form-control {
    width: 100%;
    padding: 1rem 1.2rem;
    border-radius: 12px;
    border: 2px solid #edf2f7;
    background: white;
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-select:focus,
.form-control:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 4px rgba(74, 144, 226, 0.1);
}

/* Custom Radio List */
.radio-group-vertical {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.radio-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: white;
    border: 2px solid #edf2f7;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.radio-item:hover {
    border-color: var(--secondary);
    background: rgba(74, 144, 226, 0.02);
}

.radio-item input {
    display: none;
}

.radio-custom {
    width: 22px;
    height: 22px;
    border: 2px solid #cbd5e0;
    border-radius: 50%;
    position: relative;
    flex-shrink: 0;
}

.radio-item input:checked+.radio-custom {
    border-color: var(--secondary);
    background: var(--secondary);
}

.radio-item input:checked+.radio-custom::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.radio-item input:checked~.label-text {
    font-weight: 600;
    color: var(--secondary);
}

/* Likert Scale (1-5) */
.likert-scale {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    background: #f7fafc;
    padding: 1.5rem;
    border-radius: 15px;
}

.likert-scale label {
    flex: 1;
    text-align: center;
    cursor: pointer;
    position: relative;
}

.likert-scale input {
    display: none;
}

.likert-scale span {
    display: block;
    width: 45px;
    height: 45px;
    line-height: 45px;
    margin: 0 auto;
    background: white;
    border: 2px solid #edf2f7;
    border-radius: 50%;
    font-weight: 700;
    color: var(--text-light);
    transition: all 0.3s ease;
}

.likert-scale label:nth-child(1) span {
    border-color: #feb2b2;
}

/* 1 - Not happy */
.likert-scale label:nth-child(5) span {
    border-color: #9ae6b4;
}

/* 5 - Very happy */

.likert-scale input:checked+span {
    transform: scale(1.15);
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 5px 15px rgba(255, 140, 105, 0.3);
}

/* Category Dividers */
.category-divider {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin: 3rem 0 2rem;
    color: var(--primary);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.9rem;
}

.category-divider i {
    width: 20px;
}

.category-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--primary), transparent);
}

/* NPS Scale (0-10) */
.nps-scale-wrapper {
    background: #f7fafc;
    padding: 2rem 1.5rem;
    border-radius: var(--radius);
}

.nps-labels {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
    color: var(--text-light);
    font-weight: 600;
}

.nps-scale {
    display: grid;
    grid-template-columns: repeat(11, 1fr);
    gap: 5px;
}

.nps-scale label {
    cursor: pointer;
}

.nps-scale input {
    display: none;
}

.nps-scale span {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    background: white;
    border: 2px solid #edf2f7;
    border-radius: 8px;
    font-weight: 700;
    transition: all 0.2s ease;
}

.nps-scale input:checked+span {
    background: var(--secondary);
    color: white;
    border-color: var(--secondary);
    transform: translateY(-5px);
}

@media (max-width: 600px) {
    .nps-scale {
        grid-template-columns: repeat(6, 1fr);
        gap: 8px;
    }
}

/* Buttons */
.btn-group {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.btn {
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    font-family: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--secondary), #357abd);
    color: white;
    flex: 2;
}

.btn-secondary {
    background: #edf2f7;
    color: var(--text-light);
    flex: 1;
}

.btn-submit {
    background: linear-gradient(135deg, #48bb78, #38a169);
    color: white;
    flex: 2;
}

.btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.btn-lg {
    padding: 1.2rem 2.5rem;
    font-size: 1.2rem;
    border-radius: 50px;
}

/* Success Card */
.success-card {
    text-align: center;
    padding: 2rem 0;
}

.success-logo-container {
    margin-bottom: 2rem;
}

.logo-paopulse-success {
    width: 160px;
    height: auto;
}

.success-icon-wrapper {
    width: 100px;
    height: 100px;
    background: #c6f6d5;
    color: #2f855a;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 2rem;
}

.success-icon-wrapper i {
    width: 60px;
    height: 60px;
}

.success-message {
    color: var(--text-light);
    line-height: 1.8;
    margin: 1.5rem 0 3rem;
}

.signature {
    margin-bottom: 3rem;
    padding: 1.5rem;
    background: white;
    border-radius: 12px;
}

.signature p {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* Modals */
.modal {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(4px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 1.5rem;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 2.5rem;
    border-radius: var(--radius);
    width: 100%;
    max-width: 600px;
    box-shadow: var(--shadow);
    max-height: 90vh;
    overflow-y: auto;
    animation: modalPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modalPop {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.pdpa-header {
    text-align: center;
    margin-bottom: 2rem;
}

.pdpa-header i {
    color: var(--secondary);
    width: 50px;
    height: 50px;
    margin-bottom: 1rem;
}

.pdpa-body h3 {
    font-size: 1.1rem;
    margin: 1.5rem 0 0.5rem;
    color: var(--primary);
}

.pdpa-body p {
    font-size: 0.95rem;
    color: var(--text-dark);
    line-height: 1.7;
    margin-bottom: 1rem;
}

.consent-check-wrapper {
    margin-top: 2rem;
    padding: 1.5rem;
    background: #f7fafc;
    border-radius: 12px;
}

/* Custom Checkbox */
.checkbox-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    cursor: pointer;
}

.checkbox-item input {
    display: none;
}

.checkbox-custom {
    width: 24px;
    height: 24px;
    border: 2px solid #cbd5e0;
    border-radius: 6px;
    flex-shrink: 0;
    position: relative;
    transition: all 0.2s ease;
    margin-top: 3px;
}

.checkbox-item input:checked+.checkbox-custom {
    background: var(--success);
    border-color: var(--success);
}

.checkbox-item input:checked+.checkbox-custom::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 6px;
    border-left: 2px solid white;
    border-bottom: 2px solid white;
    top: 45%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-45deg);
}

.pdpa-footer {
    margin-top: 2.5rem;
    text-align: center;
}

.pdpa-footer .btn {
    width: 100%;
}

.btn:disabled {
    background: #cbd5e0;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Custom Utilities */
.mt-4 {
    margin-top: 2rem;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.spin {
    animation: spin 1s linear infinite;
}