/* ============================================================
   EMPLOYEE CLIMATE SURVEY - MAIN STYLESHEET
   ============================================================
   Version: 2.0
   Author: Training Cluster
   Copyright: 2026 Training Cluster
   ============================================================ */

/* ============================================================
   CSS VARIABLES & RESET
   ============================================================ */
:root {
    --navy:        #0f2744;
    --navy-mid:    #183e6b;
    --blue:        #1a6fc4;
    --blue-light:  #2d8cdf;
    --sky:         #e8f3fc;
    --sky-deep:    #cce5f8;
    --white:       #ffffff;
    --surface:     #f8f9fa;
    --border:      #e2e8f0;
    --text:        #1a2740;
    --muted:       #64748b;
    --light:       #94a3b8;
    --success:     #1a9e5c;
    --success-bg:  #e6f7ee;
    --warning:     #d4860a;
    --warning-bg:  #fef5e3;
    --danger:      #c0392b;
    --danger-bg:   #fcecea;
    --purple:      #6c3fc5;
    --purple-bg:   #f0ebff;
    --accent:      #2d8cdf;
    --accent-light:#a6d0fa;
    --light-blue:    #0c88ca;
    --light-blue-bg: #e3f3fb;
    --radius-sm:   6px;
    --radius-md:   10px;
    --radius-lg:   14px;
    --shadow-sm:   0 1px 4px rgba(0,0,0,.06);
    --shadow-md:   0 4px 16px rgba(0,0,0,.08);
    --shadow-lg:   0 8px 32px rgba(0,0,0,.12);
    --transition:  0.22s ease;
}

/* ============================================================
   BASE RESET
   ============================================================ */
*, *::before, *::after { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
}

html { 
    font-size: 15px; 
    scroll-behavior: smooth; 
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, 'DM Sans', sans-serif;
    background: #ffffff;
    color: var(--text);
    line-height: 1.55;
    font-weight: 500;
    min-height: 100vh;
}

h1, h2, h3, .section-num, .progress-pct, .hero-chip, .topbar-title {
    font-family: 'Segoe UI', system-ui, 'Syne', sans-serif;
}

/* ============================================================
   TOPBAR
   ============================================================ */
.topbar {
    background: linear-gradient(100deg, var(--navy) 0%, var(--navy-mid) 50%, #1d5fa0 100%);
    padding: 0 32px;
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 64px;
    box-shadow: 0 2px 20px rgba(15,39,68,.25);
    position: sticky; 
    top: 0; 
    z-index: 100;
}

.topbar-brand { 
    display: flex; 
    align-items: center; 
    gap: 13px; 
}

.topbar-logo {
    width: 40px; 
    height: 40px;
    background: rgba(255,255,255,.13);
    border-radius: 10px;
    display: grid; 
    place-items: center;
    font-size: 1.1rem; 
    color: #fff;
    flex-shrink: 0;
}

.topbar-title { 
    font-weight: 700; 
    font-size: 1rem; 
    color: #fff; 
}

.topbar-sub { 
    font-size: .72rem; 
    color: rgba(255,255,255,.5); 
    margin-top: 1px; 
}

.topbar-spacer { 
    flex: 1; 
}

.topbar-chip {
    display: inline-flex; 
    align-items: center; 
    gap: 6px;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.14);
    color: rgba(255,255,255,.7);
    font-size: .72rem; 
    padding: 6px 12px; 
    border-radius: 20px;
}

/* ============================================================
   LAYOUT - White Background
   ============================================================ */
.page-wrap {
    max-width: 1100px;
    margin: 0 auto;
    padding: 32px 40px 60px;
    background: #ffffff;
}

/* ============================================================
   COMPLETED MESSAGE
   ============================================================ */
.completed-message {
    background: var(--white);
    border-radius: 18px;
    padding: 40px 30px;
    text-align: center;
    box-shadow: var(--shadow-md);
    border-left: 6px solid var(--success);
}

.completed-message i {
    font-size: 3.5rem;
    color: var(--success);
    margin-bottom: 16px;
}

.completed-message h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.completed-message p {
    color: var(--muted);
    max-width: 400px;
    margin: 0 auto;
}

/* ============================================================
   SURVEY HERO
   ============================================================ */
.survey-hero {
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 60%, #1d6bb5 100%);
    border-radius: 18px;
    padding: 40px 44px;
    margin-bottom: 28px;
    position: relative;
    overflow: hidden;
}

.survey-hero::before {
    content: '';
    position: absolute; 
    right: -40px; 
    top: -40px;
    width: 220px; 
    height: 220px; 
    border-radius: 50%;
    background: rgba(255,255,255,.04);
}

.survey-hero::after {
    content: '';
    position: absolute; 
    right: 70px; 
    bottom: -70px;
    width: 170px; 
    height: 170px; 
    border-radius: 50%;
    background: rgba(255,255,255,.03);
}

.hero-anon-badge {
    display: inline-flex; 
    align-items: center; 
    gap: 7px;
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.18);
    color: rgba(255,255,255,.85);
    font-size: .72rem; 
    font-weight: 600; 
    letter-spacing: .6px;
    padding: 5px 14px; 
    border-radius: 20px; 
    margin-bottom: 18px;
    text-transform: uppercase;
}

.survey-hero h1 {
    font-size: 1.85rem; 
    font-weight: 800;
    color: #fff; 
    margin-bottom: 12px; 
    letter-spacing: -.3px;
}

.survey-hero p {
    color: rgba(255,255,255,.65);
    font-size: .9rem; 
    max-width: 540px; 
    line-height: 1.7;
}

.hero-chips {
    display: flex; 
    gap: 12px; 
    margin-top: 22px; 
    flex-wrap: wrap;
}

.hero-chip {
    display: flex; 
    align-items: center; 
    gap: 7px;
    background: rgba(255,255,255,.1);
    border-radius: 20px; 
    padding: 5px 14px;
    color: rgba(255,255,255,.8); 
    font-size: .75rem; 
    font-weight: 500;
}

/* ============================================================
   PROGRESS PANEL - Light Blue Background
   ============================================================ */
.progress-panel {
    background: var(--light-blue-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px 22px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

.progress-top {
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    margin-bottom: 10px;
}

.progress-label { 
    font-size: .78rem; 
    font-weight: 700; 
    text-transform: uppercase; 
    letter-spacing: .6px; 
    color: var(--muted); 
}

.progress-pct { 
    font-size: 1rem; 
    font-weight: 800; 
    color: var(--blue); 
}

.progress-track { 
    background: var(--surface); 
    border-radius: 5px; 
    height: 7px; 
    overflow: hidden; 
}

.progress-fill {
    height: 100%; 
    border-radius: 5px;
    background: linear-gradient(90deg, var(--blue), var(--blue-light));
    transition: width .4s ease; 
    width: 0%;
}

.step-dots { 
    display: flex; 
    gap: 5px; 
    margin-top: 12px; 
    flex-wrap: wrap; 
}

.step-dot { 
    width: 22px; 
    height: 4px; 
    border-radius: 2px; 
    background: var(--border); 
    transition: background .3s; 
}

.step-dot.done { 
    background: var(--blue); 
}

.step-dot.active { 
    background: var(--accent); 
}

/* ============================================================
   STEPS
   ============================================================ */
.step-container { 
    display: none; 
}

.step-container.active-step { 
    display: block; 
    animation: fadeIn 0.3s ease; 
}

@keyframes fadeIn { 
    from { opacity: 0; transform: translateY(6px); } 
    to { opacity: 1; transform: translateY(0); } 
}

/* ============================================================
   SECTION CARDS - White Background
   ============================================================ */
.section-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.section-head {
    padding: 15px 22px;
    border-bottom: 1px solid var(--border);
    display: flex; 
    align-items: center; 
    gap: 12px;
    background: var(--light-blue-bg);
}

.section-num {
    width: 32px; 
    height: 32px;
    background: var(--navy); 
    color: #fff;
    border-radius: 8px;
    display: grid; 
    place-items: center;
    font-size: .8rem; 
    font-weight: 700;
    flex-shrink: 0;
}

.section-num.accent { 
    background: var(--accent); 
}

.section-title {
    font-size: .92rem; 
    font-weight: 700; 
    color: var(--text); 
    flex: 1;
}

.section-badge {
    font-size: .65rem; 
    font-weight: 700; 
    padding: 3px 10px;
    border-radius: 10px; 
    text-transform: uppercase; 
    letter-spacing: .4px;
    white-space: nowrap;
}

.badge-single { 
    background: var(--success-bg); 
    color: var(--success); 
}

.badge-text { 
    background: var(--purple-bg); 
    color: var(--purple); 
}

.badge-scale { 
    background: var(--warning-bg); 
    color: var(--warning); 
}

.section-body { 
    padding: 20px 22px; 
}

/* ============================================================
   FORM ELEMENTS - White Background
   ============================================================ */
.demo-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.form-group { 
    display: flex; 
    flex-direction: column; 
    gap: 6px; 
}

.form-label {
    font-size: .72rem; 
    font-weight: 700;
    text-transform: uppercase; 
    letter-spacing: .7px; 
    color: var(--muted);
}

.form-select, .form-input, .form-textarea {
    border: 1.5px solid var(--border);
    border-radius: 8px;
    padding: 10px 14px;
    font-family: 'Segoe UI', 'DM Sans', sans-serif;
    font-size: .88rem;
    font-weight: 500;
    color: var(--text);
    background: var(--white);
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
    appearance: none; 
    -webkit-appearance: none;
    width: 100%;
}

.form-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23647a8b' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 13px center;
    padding-right: 34px;
}

.form-select:focus, .form-input:focus, .form-textarea:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(26,111,196,.12);
}

.form-select.invalid { 
    border-color: var(--danger); 
    box-shadow: 0 0 0 3px rgba(192,57,43,.12); 
}

.form-textarea { 
    resize: vertical; 
    min-height: 88px; 
    line-height: 1.5; 
}

.required-star { 
    color: var(--danger); 
    margin-left: 2px; 
}

/* ============================================================
   OPTIONS GRID - White Background
   ============================================================ */
.options-grid { 
    display: flex; 
    flex-direction: column; 
    gap: 9px; 
}

.opt-item {
    display: flex; 
    align-items: flex-start; 
    gap: 13px;
    padding: 12px 15px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: all .18s;
    background: var(--white);
    user-select: none;
    font-weight: 500;
}

.opt-item:hover { 
    border-color: var(--blue-light); 
    background: var(--sky); 
}

.opt-item.selected {
    border-color: var(--blue);
    background: var(--sky);
    box-shadow: 0 0 0 3px rgba(26,111,196,.1);
}

.options-grid.invalid .opt-item:not(.selected) {
    border-color: rgba(192,57,43,.35);
}

.options-grid.invalid-pulse {
    animation: shakePulse .4s ease;
}

@keyframes shakePulse {
    0%   { transform: translateX(0); }
    20%  { transform: translateX(-4px); }
    40%  { transform: translateX(4px); }
    60%  { transform: translateX(-4px); }
    80%  { transform: translateX(2px); }
    100% { transform: translateX(0); }
}

.opt-item input { 
    display: none; 
}

.opt-check-box {
    width: 20px; 
    height: 20px; 
    flex-shrink: 0; 
    margin-top: 1px;
    border: 2px solid var(--border); 
    border-radius: 50%;
    display: grid; 
    place-items: center;
    transition: all .18s; 
    background: var(--white);
}

.opt-item.selected .opt-check-box {
    background: var(--blue); 
    border-color: var(--blue);
}

.opt-check-box i { 
    color: #fff; 
    font-size: .5rem; 
    display: none; 
}

.opt-item.selected .opt-check-box i { 
    display: block; 
}

.opt-text { 
    flex: 1; 
}

.opt-main { 
    font-size: .88rem; 
    color: var(--text); 
    line-height: 1.5; 
    font-weight: 500; 
}

.opt-hint { 
    font-size: .74rem; 
    color: var(--muted); 
    margin-top: 3px; 
    line-height: 1.45; 
    font-weight: 400; 
}

.other-field {
    margin-top: 10px; 
    padding: 0 15px 14px;
    display: none;
}

.other-field.visible { 
    display: block; 
}

/* ============================================================
   REQUIRED MESSAGE
   ============================================================ */
.q-required-msg {
    display: none;
    color: var(--danger);
    font-size: .76rem;
    font-weight: 600;
    margin-top: 8px;
    padding: 6px 12px;
    background: var(--danger-bg);
    border-radius: 6px;
}

.q-required-msg.show { 
    display: flex; 
    align-items: center; 
    gap: 6px; 
}

/* ============================================================
   SCALE ROW - White Background
   ============================================================ */
.scale-row { 
    display: flex; 
    gap: 10px; 
    flex-wrap: wrap; 
}

.scale-btn {
    flex: 1; 
    min-width: 90px;
    padding: 16px 10px; 
    text-align: center;
    border: 1.5px solid var(--border); 
    border-radius: 12px;
    cursor: pointer; 
    transition: all .18s; 
    background: var(--white);
    font-weight: 600;
}

.scale-btn:hover { 
    border-color: var(--blue-light); 
    background: var(--sky); 
}

.scale-btn.selected {
    border-color: var(--blue);
    background: var(--navy); 
    color: #fff;
    box-shadow: 0 4px 14px rgba(26,111,196,.25);
}

.scale-num {
    font-size: 1.5rem; 
    font-weight: 800;
    margin-bottom: 5px; 
    line-height: 1;
}

.scale-lbl { 
    font-size: .68rem; 
    font-weight: 600; 
    text-transform: uppercase; 
    letter-spacing: .3px; 
    color: var(--muted); 
}

.scale-btn.selected .scale-lbl { 
    color: rgba(255,255,255,.65); 
}

.scale-row.invalid .scale-btn { 
    border-color: rgba(192,57,43,.35); 
}

/* ============================================================
   STEP NAVIGATION - White Background
   ============================================================ */
.step-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
    gap: 15px;
}

.btn-prev, .btn-next, .btn-submit-final {
    display: inline-flex; 
    align-items: center; 
    gap: 8px;
    border: none; 
    border-radius: 10px;
    padding: 12px 28px;
    font-family: 'Segoe UI', 'DM Sans', sans-serif;
    font-size: .88rem; 
    font-weight: 700;
    cursor: pointer; 
    transition: all .2s;
}

.btn-prev {
    background: var(--white);
    border: 1.5px solid var(--border);
    color: var(--muted);
}

.btn-prev:hover { 
    border-color: var(--blue); 
    color: var(--blue); 
    background: var(--sky); 
}

.btn-next, .btn-submit-final {
    background: linear-gradient(135deg, var(--navy) 0%, var(--blue) 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(26,111,196,.3);
}

.btn-next:hover, .btn-submit-final:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(26,111,196,.4);
}

.btn-submit-final {
    background: linear-gradient(135deg, var(--success) 0%, #22c55e 100%);
}

.btn-submit-final:disabled { 
    opacity: 0.6; 
    cursor: not-allowed; 
}

/* ============================================================
   SUCCESS SCREEN - White Background
   ============================================================ */
#success-screen {
    display: none;
    text-align: center;
    padding: 70px 24px;
    background: var(--white);
    border-radius: 18px;
    box-shadow: var(--shadow-md);
}

.success-icon-wrap {
    width: 88px; 
    height: 88px; 
    border-radius: 50%;
    background: var(--success-bg);
    display: grid; 
    place-items: center;
    margin: 0 auto 26px;
    font-size: 2.4rem; 
    color: var(--success);
    animation: pop .4s ease;
}

@keyframes pop {
    0%   { transform: scale(.4); opacity: 0; }
    80%  { transform: scale(1.1); }
    100% { transform: scale(1); }
}

#success-screen h2 {
    font-size: 1.8rem; 
    font-weight: 800; 
    color: var(--text); 
    margin-bottom: 12px;
}

#success-screen p { 
    color: var(--muted); 
    font-size: .92rem; 
    max-width: 420px; 
    margin: 0 auto 28px; 
    line-height: 1.7; 
}

.btn-another {
    display: inline-flex; 
    align-items: center; 
    gap: 8px;
    background: var(--white); 
    border: 1.5px solid var(--border);
    color: var(--text); 
    border-radius: 10px;
    padding: 12px 28px; 
    font-family: 'Segoe UI', 'DM Sans', sans-serif;
    font-size: .9rem; 
    font-weight: 600; 
    cursor: pointer;
    transition: all .2s; 
    text-decoration: none;
}

.btn-another:hover { 
    border-color: var(--blue); 
    color: var(--blue); 
    background: var(--sky); 
}

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
#toast {
    position: fixed; 
    bottom: 26px; 
    right: 26px;
    background: var(--navy); 
    color: #fff;
    padding: 13px 22px; 
    border-radius: 12px;
    font-size: .85rem; 
    font-weight: 500;
    display: flex; 
    align-items: center; 
    gap: 9px;
    opacity: 0; 
    transform: translateY(10px);
    transition: all .3s; 
    pointer-events: none; 
    z-index: 9999;
    box-shadow: 0 4px 22px rgba(15,39,68,.3);
}

#toast.show { 
    opacity: 1; 
    transform: translateY(0); 
}

/* ============================================================
   RESPONSIVE DESIGN
   ============================================================ */

/* Tablets and smaller devices */
@media (max-width: 768px) {
    .demo-grid { 
        grid-template-columns: repeat(2, 1fr); 
    }
    
    .survey-hero {
        padding: 30px 28px;
    }
    
    .survey-hero h1 {
        font-size: 1.6rem;
    }
    
    .scale-btn {
        min-width: 70px;
        padding: 14px 8px;
    }
}

/* Mobile devices */
@media (max-width: 640px) {
    .demo-grid   { 
        grid-template-columns: 1fr; 
    }
    
    .scale-row   { 
        gap: 6px; 
    }
    
    .scale-btn   { 
        min-width: 60px; 
        padding: 12px 6px; 
    }
    
    .scale-num   { 
        font-size: 1.2rem; 
    }
    
    .scale-lbl   { 
        font-size: .6rem; 
    }
    
    .survey-hero { 
        padding: 28px 22px; 
    }
    
    .survey-hero h1 { 
        font-size: 1.4rem; 
    }
    
    .page-wrap   { 
        padding: 20px 14px 50px; 
    }
    
    .topbar      { 
        padding: 0 16px; 
    }
    
    .step-nav    { 
        flex-direction: column; 
        gap: 10px; 
    }
    
    .btn-prev, .btn-next, .btn-submit-final { 
        justify-content: center; 
        width: 100%;
    }
    
    .section-body {
        padding: 16px;
    }
    
    .section-head {
        padding: 12px 16px;
        flex-wrap: wrap;
    }
    
    .section-title {
        font-size: .85rem;
    }
    
    .topbar-title {
        font-size: .85rem;
    }
    
    .topbar-chip {
        font-size: .65rem;
        padding: 4px 10px;
    }
    
    #toast {
        bottom: 16px;
        right: 16px;
        left: 16px;
        font-size: .8rem;
        padding: 12px 16px;
    }
}

/* Very small devices */
@media (max-width: 400px) {
    .survey-hero {
        padding: 20px 16px;
    }
    
    .survey-hero h1 {
        font-size: 1.2rem;
    }
    
    .hero-chips {
        gap: 8px;
    }
    
    .hero-chip {
        font-size: .65rem;
        padding: 4px 10px;
    }
    
    .opt-item {
        padding: 10px 12px;
        gap: 10px;
    }
    
    .opt-main {
        font-size: .82rem;
    }
}

/* ============================================================
   PRINT STYLES
   ============================================================ */
@media print {
    .topbar {
        position: static;
        background: var(--navy) !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .btn-prev, .btn-next, .btn-submit-final {
        display: none !important;
    }
    
    .step-container {
        display: block !important;
        page-break-inside: avoid;
    }
    
    .step-container:not(.active-step) {
        opacity: 0.7;
    }
    
    .progress-panel {
        border: 1px solid #ddd;
    }
    
    .survey-hero {
        background: var(--navy) !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    #toast {
        display: none !important;
    }
}

/* ============================================================
   ACCESSIBILITY
   ============================================================ */

/* Focus styles for keyboard navigation */
button:focus-visible,
select:focus-visible,
input:focus-visible,
textarea:focus-visible,
.opt-item:focus-visible,
.scale-btn:focus-visible {
    outline: 3px solid var(--blue);
    outline-offset: 2px;
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --border: #333;
        --muted: #444;
        --text: #000;
        --surface: #f8f8f8;
    }
    
    .opt-item {
        border-width: 2px;
    }
    
    .scale-btn {
        border-width: 2px;
    }
}

/* ============================================================
   WHITE BACKGROUND THEME
   ============================================================ */
/* Force white background regardless of system preferences */
@media (prefers-color-scheme: dark) {
    :root {
        --surface: #f8f9fa;
        --white: #ffffff;
        --border: #e2e8f0;
        --text: #1a2740;
        --muted: #64748b;
        --shadow-sm: 0 1px 4px rgba(0,0,0,.06);
        --shadow-md: 0 4px 16px rgba(0,0,0,.08);
        --shadow-lg: 0 8px 32px rgba(0,0,0,.12);
    }
    
    body {
        background: #ffffff;
    }
    
    .page-wrap {
        background: #ffffff;
    }
    
    .survey-hero {
        background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 60%, #1d6bb5 100%);
    }
    
    .topbar {
        background: linear-gradient(100deg, var(--navy) 0%, var(--navy-mid) 50%, #1d5fa0 100%);
    }
    
    .section-head {
        background: var(--light-blue-bg);
    }
    
    .form-select, .form-input, .form-textarea {
        background: #ffffff;
        color: var(--text);
        border-color: var(--border);
    }
    
    .opt-item {
        background: #ffffff;
    }
    
    .opt-item:hover {
        background: var(--sky);
    }
    
    .scale-btn {
        background: #ffffff;
    }
    
    .scale-btn:hover {
        background: var(--sky);
    }
    
    .progress-panel {
        background: var(--light-blue-bg);
    }
    
    .section-card {
        background: #ffffff;
    }
    
    .completed-message {
        background: #ffffff;
    }
    
    #success-screen {
        background: #ffffff;
    }
}