/* ================================================================
   ΕΡΩΤΗΜΑΤΟΛΟΓΙΟ ΔΙΑΓΕΝΕΑΚΟΥ ΤΡΑΥΜΑΤΟΣ — Stylesheet
   Modern, elegant, mobile-first design
   ================================================================ */

:root {
    --primary: #6C3FA0;
    --primary-light: #8B5FBF;
    --primary-dark: #4A2170;
    --primary-bg: #F5F0FA;
    --accent: #E8DFF5;
    --surface: #FFFFFF;
    --bg: #F8F6FB;
    --text: #1A1A2E;
    --text-secondary: #555570;
    --text-muted: #8888A0;
    --border: #E0DCE8;
    --border-focus: #6C3FA0;
    --error: #D32F2F;
    --error-bg: #FDECEA;
    --success: #2E7D32;
    --success-bg: #E8F5E9;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 16px rgba(108,63,160,0.08);
    --shadow-lg: 0 8px 32px rgba(108,63,160,0.12);
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --font: 'Inter', 'Noto Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --max-width: 720px;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    line-height: 1.65;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ================================================================
   PROGRESS BAR
   ================================================================ */

.progress-bar-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--accent);
    z-index: 1000;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    border-radius: 0 2px 2px 0;
    transition: width 0.5s ease;
}

/* ================================================================
   CONTAINER & LAYOUT
   ================================================================ */

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 40px 20px 60px;
}

@media (min-width: 768px) {
    .container {
        padding: 60px 24px 80px;
    }
}

/* ================================================================
   SECTIONS / STEPS
   ================================================================ */

.form-section {
    display: none;
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 32px 24px;
    box-shadow: var(--shadow-md);
    animation: fadeSlideIn 0.4s ease;
}

.form-section.active {
    display: block;
}

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (min-width: 768px) {
    .form-section {
        padding: 48px 40px;
    }
}

/* ================================================================
   SECTION HEADER (Intro)
   ================================================================ */

.section-header {
    text-align: center;
    margin-bottom: 32px;
}

.section-icon {
    font-size: 3rem;
    margin-bottom: 12px;
}

.section-header h1 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary-dark);
    line-height: 1.3;
    margin-bottom: 8px;
}

.subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 400;
}

@media (min-width: 768px) {
    .section-header h1 {
        font-size: 1.85rem;
    }
}

/* ================================================================
   SECTION BADGES & TITLES
   ================================================================ */

.section-badge {
    display: inline-block;
    background: var(--primary-bg);
    color: var(--primary);
    font-size: 0.78rem;
    font-weight: 600;
    padding: 4px 14px;
    border-radius: 20px;
    margin-bottom: 16px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.section-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 8px;
    line-height: 1.3;
}

.section-desc {
    font-size: 0.92rem;
    color: var(--text-secondary);
    margin-bottom: 28px;
    line-height: 1.6;
}

/* ================================================================
   CONSENT BOX
   ================================================================ */

.consent-box {
    background: var(--primary-bg);
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
}

.consent-box h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 12px;
}

.consent-box p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
    line-height: 1.65;
}

.consent-points {
    margin: 16px 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.consent-point {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.9rem;
    color: var(--text);
}

.consent-icon {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--success);
    color: #fff;
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 700;
    margin-top: 2px;
}

.consent-note {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 12px;
    margin-bottom: 0;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.time-estimate {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 8px;
}

.required-note {
    font-size: 0.82rem;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 24px;
}

/* ================================================================
   FORM GROUPS
   ================================================================ */

.form-group {
    margin-bottom: 24px;
}

fieldset.form-group {
    border: none;
}

.form-group > label,
.form-group legend {
    display: block;
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 8px;
    line-height: 1.5;
}

.form-group legend {
    padding: 0;
    float: none;
    width: 100%;
}

.hint {
    font-weight: 400;
    color: var(--text-muted);
    font-size: 0.84rem;
}

.required {
    color: var(--error);
    font-weight: 600;
}

/* ================================================================
   TEXT INPUTS & TEXTAREAS
   ================================================================ */

input[type="text"],
input[type="number"],
input[type="email"],
input[type="url"],
input[type="date"],
input[type="password"],
textarea,
select {
    width: 100%;
    padding: 12px 16px;
    font-family: var(--font);
    font-size: 0.92rem;
    color: var(--text);
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="email"]:focus,
input[type="url"]:focus,
input[type="date"]:focus,
input[type="password"]:focus,
textarea:focus,
select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(108, 63, 160, 0.12);
}

/* Never apply text-field styling to native choice inputs */
input[type="radio"],
input[type="checkbox"] {
    width: auto;
    max-width: none;
    min-width: 0;
    padding: 0;
    margin: 0;
    border: none;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
    appearance: none;
    -webkit-appearance: none;
}

input::placeholder,
textarea::placeholder {
    color: var(--text-muted);
}

textarea {
    resize: vertical;
    min-height: 80px;
}

input[type="number"] {
    max-width: 160px;
}

/* ================================================================
   RADIO & CHECKBOX CHOICES
   ================================================================ */

.choice-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.choice-group-inline {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 12px;
}

.choice-option {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #ded7ea;
    border-radius: 12px;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
    box-sizing: border-box;
    user-select: none;
    margin-bottom: 0;
    font-weight: 400;
    font-size: 0.92rem;
    line-height: 1.4;
}

.choice-group-inline .choice-option {
    width: auto;
    flex: 1 1 auto;
    min-width: 140px;
}

.choice-option:hover {
    border-color: #8b5cf6;
    background: #faf7ff;
}

.choice-option input[type="radio"],
.choice-option input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    pointer-events: none;
}

.choice-control {
    width: 18px;
    height: 18px;
    min-width: 18px;
    border: 2px solid #c9bddc;
    background: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.choice-option input[type="radio"] + .choice-control {
    border-radius: 50%;
}

.choice-option input[type="checkbox"] + .choice-control {
    border-radius: 5px;
}

.choice-option input[type="radio"]:checked + .choice-control {
    border-color: #6d3fb3;
}

.choice-option input[type="radio"]:checked + .choice-control::after {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #6d3fb3;
}

.choice-option input[type="checkbox"]:checked + .choice-control {
    border-color: #6d3fb3;
    background: #6d3fb3;
}

.choice-option input[type="checkbox"]:checked + .choice-control::after {
    content: "✓";
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
}

.choice-option:has(input:checked),
.choice-option.is-selected {
    border-color: #6d3fb3;
    background: #f5efff;
    box-shadow: 0 6px 18px rgba(109, 63, 179, 0.12);
}

.choice-label {
    color: #272238;
    font-size: 15px;
    line-height: 1.4;
    flex: 1;
}

/* ================================================================
   HTT GRID
   ================================================================ */

.htt-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.htt-item {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
    transition: border-color var(--transition);
}

.htt-item:hover {
    border-color: var(--primary-light);
}

.htt-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 10px;
}

.htt-item .choice-group {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
}

.htt-item .choice-option {
    flex: 0 1 auto;
    width: auto;
    min-width: 0;
    padding: 10px 12px;
    font-size: 0.84rem;
}

.htt-item .choice-label {
    font-size: 0.84rem;
}

/* ================================================================
   SCALE LEGEND & INFO
   ================================================================ */

.scale-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    padding: 12px 16px;
    background: var(--primary-bg);
    border-radius: var(--radius-sm);
    margin-bottom: 24px;
    font-size: 0.8rem;
    color: var(--primary);
    font-weight: 500;
}

.scale-info {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.6;
}

/* ================================================================
   LIKERT SCALE ITEMS
   ================================================================ */

.likert-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 28px;
}

.likert-row {
    padding: 16px;
    border: 1px solid #e2dced;
    border-radius: 12px;
    background: #fbf9ff;
    margin-bottom: 0;
    transition: border-color var(--transition), background var(--transition);
}

.likert-row:hover {
    border-color: #d8cfe8;
}

.likert-row.has-error {
    border-color: var(--error);
    background: var(--error-bg);
}

.likert-question-text {
    font-size: 15px;
    font-weight: 500;
    color: #252033;
    margin-bottom: 12px;
    line-height: 1.45;
}

.likert-options {
    display: grid;
    grid-template-columns: repeat(5, minmax(44px, 1fr));
    gap: 8px;
}

.likert-options-labels {
    grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
}

.likert-cols-4 { grid-template-columns: repeat(4, minmax(44px, 1fr)); }
.likert-cols-3 { grid-template-columns: repeat(3, minmax(44px, 1fr)); }
.likert-cols-2 { grid-template-columns: repeat(2, minmax(44px, 1fr)); }
.likert-cols-6 { grid-template-columns: repeat(6, minmax(40px, 1fr)); }
.likert-cols-7 { grid-template-columns: repeat(7, minmax(36px, 1fr)); }

.likert-option {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border: 1px solid #d8cfe8;
    border-radius: 10px;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
    color: #4b2c78;
    text-align: center;
    user-select: none;
    padding: 6px 4px;
    box-sizing: border-box;
}

.likert-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    pointer-events: none;
}

.likert-option-label {
    font-size: 0.72rem;
    font-weight: 500;
    line-height: 1.25;
    padding: 2px 4px;
}

.likert-option:hover {
    border-color: #7c4dcc;
    background: #f6efff;
}

.likert-option:has(input[type="radio"]:checked),
.likert-option.is-selected {
    border-color: #6f3fb5;
    background: #6f3fb5;
    color: #ffffff;
    box-shadow: 0 6px 16px rgba(111, 63, 181, 0.22);
}

.likert-option:has(input[type="radio"]:checked) .likert-option-label,
.likert-option.is-selected .likert-option-label {
    color: #ffffff;
}

@media (max-width: 640px) {
    .likert-options {
        grid-template-columns: repeat(5, 1fr);
    }

    .likert-options-labels {
        grid-template-columns: repeat(2, 1fr);
    }

    .likert-option {
        min-height: 40px;
        font-size: 14px;
    }

    .likert-option-label {
        font-size: 0.68rem;
    }
}

/* ================================================================
   CONDITIONAL FIELDS
   ================================================================ */

.conditional {
    display: none;
    padding-left: 16px;
    border-left: 3px solid var(--accent);
    margin-top: -12px;
    margin-bottom: 24px;
    animation: fadeSlideIn 0.3s ease;
}

.conditional.visible {
    display: block;
}

/* ================================================================
   CONSENT FINAL
   ================================================================ */

.consent-final {
    background: var(--primary-bg);
    border: 2px solid var(--primary);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 28px;
}

.choice-option.checkbox-consent {
    border: none;
    padding: 0;
    background: transparent;
    box-shadow: none;
    font-size: 0.92rem;
    line-height: 1.5;
    width: 100%;
}

.choice-option.checkbox-consent:hover,
.choice-option.checkbox-consent.is-selected {
    border: none;
    background: transparent;
    box-shadow: none;
}

/* ================================================================
   BUTTONS
   ================================================================ */

.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 12px 28px;
    font-family: var(--font);
    font-size: 0.92rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    user-select: none;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(108, 63, 160, 0.25);
}

.btn-primary:hover {
    background: var(--primary-light);
    box-shadow: 0 4px 16px rgba(108, 63, 160, 0.35);
    transform: translateY(-1px);
}

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

.btn-secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 1.5px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg);
    border-color: var(--text-muted);
    color: var(--text);
}

.btn-submit {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
    padding: 14px 36px;
    font-size: 1rem;
    box-shadow: 0 4px 20px rgba(108, 63, 160, 0.3);
}

.btn-submit:hover {
    box-shadow: 0 6px 28px rgba(108, 63, 160, 0.45);
    transform: translateY(-2px);
}

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

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

.btn-arrow {
    transition: transform var(--transition);
}

.btn-primary:hover .btn-arrow {
    transform: translateX(3px);
}

/* ================================================================
   VALIDATION ERRORS
   ================================================================ */

.form-group.has-error > label,
.form-group.has-error legend {
    color: var(--error);
}

.form-group.has-error input:not([type="radio"]):not([type="checkbox"]),
.form-group.has-error textarea,
.form-group.has-error select {
    border-color: var(--error);
}

.form-group.has-error .choice-option {
    border-color: var(--error);
}

.consent-final.has-error .choice-option {
    border-color: var(--error);
}

.error-message {
    display: block;
    font-size: 0.82rem;
    color: var(--error);
    margin-top: 6px;
    font-weight: 500;
}

.likert-row.has-error .likert-question-text {
    color: var(--error);
}

/* ================================================================
   SUCCESS SCREEN
   ================================================================ */

.success-screen {
    text-align: center;
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 60px 32px;
    box-shadow: var(--shadow-md);
    animation: fadeSlideIn 0.5s ease;
}

.success-icon {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--success-bg);
    color: var(--success);
    border-radius: 50%;
    font-size: 2.2rem;
    font-weight: 700;
    margin: 0 auto 24px;
}

.success-screen h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--success);
    margin-bottom: 12px;
}

.success-screen p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    line-height: 1.6;
}

.success-note {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 16px;
}

/* ================================================================
   FOOTER
   ================================================================ */

.site-footer {
    text-align: center;
    padding: 24px 20px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ================================================================
   RESPONSIVE FINE-TUNING
   ================================================================ */

@media (max-width: 480px) {
    .section-header h1 {
        font-size: 1.25rem;
    }

    .section-title {
        font-size: 1.15rem;
    }

    .form-section {
        padding: 24px 16px;
        border-radius: var(--radius);
    }

    .consent-box {
        padding: 16px;
    }

    .btn {
        padding: 10px 20px;
        font-size: 0.88rem;
    }

    .btn-submit {
        padding: 12px 24px;
    }

    .form-actions {
        flex-direction: column-reverse;
    }

    .form-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .htt-item .choice-group {
        flex-direction: column;
    }

    .choice-group-inline {
        flex-direction: column;
    }

    .choice-group-inline .choice-option {
        width: 100%;
        min-width: 0;
    }

    .scale-legend {
        flex-direction: column;
        gap: 4px;
    }
}

@media (min-width: 768px) {
    .htt-item .choice-group {
        flex-direction: row;
    }

    .likert-options {
        gap: 12px;
    }
}

/* ================================================================
   SMOOTH SCROLL TO TOP ON STEP CHANGE
   ================================================================ */

html {
    scroll-padding-top: 20px;
}

/* ================================================================
   LOADING ANIMATION
   ================================================================ */

.btn-submit.loading {
    pointer-events: none;
    position: relative;
}

.btn-submit.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    right: 14px;
    top: 50%;
    margin-top: -10px;
}

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

/* ================================================================
   PRINT STYLES
   ================================================================ */

@media print {
    .progress-bar-container,
    .form-actions,
    .site-footer {
        display: none;
    }

    .form-section {
        display: block !important;
        box-shadow: none;
        page-break-inside: avoid;
        break-inside: avoid;
        margin-bottom: 24px;
    }

    body {
        background: #fff;
    }
}
