/* ============================================================
   Hospital Satisfaction Survey — Public CSS
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Devanagari:wght@400;500;600;700;800&family=Inter:wght@400;500;600;700&display=swap');

:root {
    --primary:      #1a56db;
    --primary-dk:   #1341b0;
    --primary-lt:   #ebf0ff;
    --primary-grd:  linear-gradient(135deg,#1a56db 0%,#0ea5e9 100%);
    --success:      #0f9b58;
    --success-lt:   #e6f7ef;
    --danger:       #e02424;
    --warning:      #d97706;
    --text:         #1e293b;
    --text-muted:   #64748b;
    --border:       #e2e8f0;
    --bg:           #f0f5fb;
    --card:         #ffffff;
    --radius:       16px;
    --radius-sm:    10px;
    --shadow:       0 4px 20px rgba(0,0,0,0.08);
    --shadow-lg:    0 12px 40px rgba(26,86,219,0.15);
    --font-marathi: 'Noto Sans Devanagari', sans-serif;
    --font-ui:      'Inter', sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-marathi);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
}

/* ---- Header ---- */
.site-header {
    background: var(--primary-grd);
    color: #fff;
    padding: 0;
    box-shadow: 0 4px 20px rgba(26,86,219,.3);
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-inner {
    max-width: 900px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
}
.header-icon {
    width: 52px; height: 52px;
    background: rgba(255,255,255,.2);
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 26px;
    flex-shrink: 0;
}
.header-text h1 { font-size: 18px; font-weight: 700; line-height: 1.3; }
.header-text p  { font-size: 13px; opacity: .8; margin-top: 2px; font-family: var(--font-ui); }

/* ---- Main container ---- */
.survey-container {
    max-width: 840px;
    margin: 36px auto;
    padding: 0 16px 60px;
}

/* ---- Progress bar ---- */
.progress-wrap {
    background: var(--card);
    border-radius: var(--radius);
    padding: 20px 28px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    margin-bottom: 24px;
}
.progress-steps {
    display: flex;
    justify-content: space-between;
    position: relative;
    margin-bottom: 10px;
}
.progress-steps::before {
    content: '';
    position: absolute;
    top: 16px; left: 16px; right: 16px;
    height: 3px;
    background: var(--border);
    z-index: 0;
}
.progress-line {
    position: absolute;
    top: 16px; left: 16px;
    height: 3px;
    background: var(--primary-grd);
    z-index: 1;
    transition: width .5s ease;
    border-radius: 3px;
}
.step-dot {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: var(--border);
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700;
    color: var(--text-muted);
    position: relative; z-index: 2;
    transition: all .3s;
    flex-shrink: 0;
    font-family: var(--font-ui);
}
.step-dot.done    { background: var(--success); color: #fff; }
.step-dot.active  { background: var(--primary); color: #fff; box-shadow: 0 0 0 5px rgba(26,86,219,.2); }
.progress-labels  { display: flex; justify-content: space-between; }
.progress-labels span {
    font-size: 11px; color: var(--text-muted); font-family: var(--font-ui);
    text-align: center; width: 34px;
}

/* ---- Form card ---- */
.form-card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    overflow: hidden;
}
.form-card-header {
    padding: 28px 32px 20px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(135deg,#f8faff 0%,#ffffff 100%);
}
.form-card-header h2 {
    font-size: 22px; font-weight: 700; color: var(--primary);
    display: flex; align-items: center; gap: 10px;
}
.form-card-header p { font-size: 14px; color: var(--text-muted); margin-top: 6px; }
.form-card-body { padding: 32px; }

/* ---- Step panels ---- */
.step-panel { display: none; }
.step-panel.active { display: block; animation: fadeIn .4s ease; }
@keyframes fadeIn { from{opacity:0;transform:translateY(10px)} to{opacity:1;transform:translateY(0)} }

/* ---- Form controls ---- */
.field-group { margin-bottom: 22px; }
.field-label {
    display: block;
    font-size: 15px; font-weight: 600;
    margin-bottom: 8px; color: var(--text);
}
.field-label .req { color: var(--danger); margin-left: 3px; }
.field-input {
    width: 100%; padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 15px; font-family: var(--font-marathi);
    color: var(--text); background: #fff;
    transition: border-color .2s, box-shadow .2s; outline: none;
}
.field-input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(26,86,219,.1); }
.field-input.error { border-color: var(--danger); }

.field-row { display: flex; gap: 16px; flex-wrap: wrap; }
.field-row .field-group { flex: 1; min-width: 140px; }

/* ---- User type selector ---- */
.type-selector { display: flex; gap: 16px; flex-wrap: wrap; }
.type-option { flex: 1; min-width: 200px; }
.type-option input[type="radio"] { display: none; }
.type-option label {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 10px; padding: 28px 20px;
    border: 2.5px solid var(--border); border-radius: var(--radius);
    cursor: pointer; transition: all .2s; text-align: center;
    font-size: 16px; font-weight: 600; color: var(--text-muted);
    background: #f8fafc;
}
.type-option label .type-icon { font-size: 40px; }
.type-option label:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-lt); }
.type-option input:checked + label {
    border-color: var(--primary); background: var(--primary-lt);
    color: var(--primary); box-shadow: 0 4px 16px rgba(26,86,219,.15);
}

/* ---- Questions ---- */
.question-item {
    background: #f8faff;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 22px 24px;
    margin-bottom: 16px;
    transition: border-color .2s, box-shadow .2s;
}
.question-item:hover { border-color: #bfcbef; box-shadow: 0 2px 12px rgba(26,86,219,.06); }
.question-item.answered { border-color: #a8c5f0; background: #f0f6ff; }
.question-item.error-q  { border-color: var(--danger); background: #fff5f5; }

.question-number {
    font-size: 11px; font-weight: 700; color: var(--primary);
    letter-spacing: .05em; text-transform: uppercase; margin-bottom: 6px;
    font-family: var(--font-ui);
}
.question-text { font-size: 16px; font-weight: 600; color: var(--text); margin-bottom: 16px; line-height: 1.5; }

/* ---- Rating buttons ---- */
.rating-group { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.rating-option { position: relative; }
.rating-option input[type="radio"] { position: absolute; opacity: 0; width: 0; height: 0; }
.rating-option label {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    width: 68px; padding: 10px 6px; border: 2px solid var(--border);
    border-radius: var(--radius-sm); cursor: pointer; transition: all .2s;
    font-size: 12px; color: var(--text-muted); gap: 4px; background: #fff;
    font-family: var(--font-ui); text-align: center; line-height: 1.2;
}
.rating-option label .r-score {
    font-size: 20px; font-weight: 800; display: block; line-height: 1;
}
.rating-option label .r-emoji { font-size: 16px; }
.rating-option label .r-label { font-size: 10px; }

/* Score colors */
.rating-option[data-score="5"] label:hover,
.rating-option[data-score="5"] input:checked + label { border-color:#0f9b58; background:#e6f7ef; color:#0f7a47; }
.rating-option[data-score="4"] label:hover,
.rating-option[data-score="4"] input:checked + label { border-color:#0ea5e9; background:#e0f2fe; color:#0369a1; }
.rating-option[data-score="3"] label:hover,
.rating-option[data-score="3"] input:checked + label { border-color:#d97706; background:#fef3c7; color:#92400e; }
.rating-option[data-score="2"] label:hover,
.rating-option[data-score="2"] input:checked + label { border-color:#f97316; background:#fff7ed; color:#c2410c; }
.rating-option[data-score="1"] label:hover,
.rating-option[data-score="1"] input:checked + label { border-color:#e02424; background:#fde8e8; color:#b91c1c; }
.rating-option[data-score="0"] label:hover,
.rating-option[data-score="0"] input:checked + label { border-color:#94a3b8; background:#f1f5f9; color:#475569; }

/* ---- Feedback textarea ---- */
.feedback-section { background: #f8faff; border-radius: var(--radius); padding: 24px; border: 1.5px solid var(--border); margin-top: 8px; }
.feedback-section h3 { font-size: 16px; font-weight: 700; margin-bottom: 8px; color: var(--text); }
.feedback-section p  { font-size: 14px; color: var(--text-muted); margin-bottom: 14px; }
textarea.field-input { min-height: 120px; resize: vertical; }

/* ---- Navigation buttons ---- */
.form-nav {
    display: flex; justify-content: space-between; align-items: center;
    margin-top: 32px; gap: 12px;
}
.btn-survey {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 14px 28px; border-radius: 10px; font-size: 16px;
    font-weight: 700; cursor: pointer; border: none; text-decoration: none;
    transition: all .2s; font-family: var(--font-marathi);
    min-width: 140px; justify-content: center;
}
.btn-prev { background: #f1f5f9; color: var(--text-muted); }
.btn-prev:hover { background: var(--border); }
.btn-next { background: var(--primary-grd); color: #fff; box-shadow: 0 4px 16px rgba(26,86,219,.3); }
.btn-next:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(26,86,219,.4); }
.btn-submit { background: linear-gradient(135deg,#0f9b58,#15803d); color: #fff; box-shadow: 0 4px 16px rgba(15,155,88,.3); }
.btn-submit:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(15,155,88,.4); }

/* ---- Welcome page ---- */
.welcome-card {
    background: var(--card); border-radius: var(--radius); padding: 48px 40px;
    box-shadow: var(--shadow); border: 1px solid var(--border); text-align: center;
}
.welcome-card .welcome-icon { font-size: 64px; margin-bottom: 20px; }
.welcome-card h2 { font-size: 26px; font-weight: 800; color: var(--text); margin-bottom: 12px; }
.welcome-card p { font-size: 16px; color: var(--text-muted); margin-bottom: 24px; line-height: 1.8; max-width: 560px; margin-left: auto; margin-right: auto; }
.welcome-points {
    display: flex; gap: 16px; flex-wrap: wrap; justify-content: center;
    margin-bottom: 36px;
}
.wp-item {
    background: var(--primary-lt); border-radius: 12px; padding: 16px 20px;
    flex: 1; min-width: 140px; max-width: 200px; text-align: center;
}
.wp-item .wp-icon { font-size: 28px; margin-bottom: 6px; }
.wp-item p { font-size: 13px; color: var(--primary); font-weight: 600; margin: 0; }

/* ---- Success page ---- */
.success-card {
    background: var(--card); border-radius: var(--radius); padding: 48px 40px;
    box-shadow: var(--shadow); border: 1px solid var(--border); text-align: center; max-width: 600px; margin: 0 auto;
}
.success-icon { font-size: 80px; margin-bottom: 20px; animation: bounce .6s ease; }
@keyframes bounce { 0%{transform:scale(0)} 70%{transform:scale(1.1)} 100%{transform:scale(1)} }
.success-card h2 { font-size: 24px; font-weight: 800; color: var(--success); margin-bottom: 14px; }
.success-card p  { font-size: 16px; color: var(--text-muted); line-height: 1.8; margin-bottom: 24px; }
.score-display {
    background: linear-gradient(135deg,#0f9b58,#15803d);
    color: #fff; border-radius: 14px; padding: 24px 32px; margin: 24px 0;
    display: inline-block; min-width: 220px;
}
.score-display .score-num { font-size: 48px; font-weight: 800; line-height: 1; }
.score-display .score-pct { font-size: 24px; font-weight: 700; opacity: .9; }
.score-display .score-lbl { font-size: 14px; opacity: .8; margin-top: 4px; }
.score-badge { display: inline-block; padding: 6px 20px; border-radius: 30px; font-size: 15px; font-weight: 700; margin-top: 12px; }

/* ---- Loading overlay ---- */
.loading-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(255,255,255,.8); backdrop-filter: blur(4px);
    z-index: 999; align-items: center; justify-content: center; flex-direction: column; gap: 16px;
}
.loading-overlay.show { display: flex; }
.spinner {
    width: 52px; height: 52px; border: 5px solid var(--primary-lt);
    border-top-color: var(--primary); border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-overlay p { font-size: 16px; color: var(--text); font-weight: 600; }

/* ---- Error messages ---- */
.error-msg { color: var(--danger); font-size: 12.5px; margin-top: 5px; display: flex; align-items: center; gap: 5px; font-family: var(--font-ui); }

/* ---- Responsive ---- */
@media(max-width:600px) {
    .form-card-header, .form-card-body { padding: 20px 18px; }
    .welcome-card { padding: 32px 20px; }
    .btn-survey { padding: 12px 20px; font-size: 15px; }
    .rating-option label { width: 56px; padding: 8px 4px; }
    .rating-option label .r-score { font-size: 17px; }
    .type-option label { padding: 20px 14px; font-size: 15px; }
}
