/* ==========================================================================
   TWCC — Fomu ya Tathmini ya Katibu wa Bodi
   Palette drawn from the TWCC emblem: leaf green ring, gold figures,
   blue ribbon banner.
   ========================================================================== */

:root {
    --green-deep:  #1E7A34;
    --green:       #2FA24A;
    --green-light: #EAF6EC;
    --gold:        #D6A122;
    --gold-light:  #FBF0D6;
    --blue:        #1C7DC4;
    --blue-deep:   #145A8F;
    --charcoal:    #262624;
    --gray:        #6B6B65;
    --border:      #E4E2D8;
    --bg:          #FAF9F5;
    --white:       #FFFFFF;
    --error:       #C0392B;

    --font-display: Georgia, 'Times New Roman', Times, serif;
    --font-body: 'Segoe UI', system-ui, -apple-system, Helvetica, Arial, sans-serif;

    --radius: 10px;
    --shadow: 0 4px 18px rgba(30, 60, 40, 0.08);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--charcoal);
    line-height: 1.5;
}

/* ---------------- Header ---------------- */

.site-header {
    background: var(--white);
    position: relative;
    padding-bottom: 6px;
}

.ribbon-top {
    height: 6px;
    background: linear-gradient(90deg, var(--green-deep), var(--green) 50%, var(--gold));
}

.ribbon-bottom {
    height: 4px;
    background: var(--blue);
}

.header-inner {
    max-width: 900px;
    margin: 0 auto;
    padding: 28px 20px 18px;
    display: flex;
    align-items: center;
    gap: 20px;
    text-align: left;
}

.header-inner .logo {
    height: 84px;
    width: 84px;
    object-fit: contain;
    flex-shrink: 0;
}

.header-text h1 {
    font-family: var(--font-display);
    color: var(--green-deep);
    font-size: 1.65rem;
    margin: 0 0 4px;
    letter-spacing: 0.3px;
    line-height: 1.2;
}

.header-text .tagline {
    margin: 0;
    color: var(--blue-deep);
    font-style: italic;
    font-size: 0.98rem;
    letter-spacing: 0.2px;
}

@media (max-width: 560px) {
    .header-inner { flex-direction: column; text-align: center; padding: 20px 16px 14px; gap: 10px; }
    .header-inner .logo { height: 64px; width: 64px; }
    .header-text h1 { font-size: 1.25rem; }
    .header-text .tagline { font-size: 0.85rem; }
}

/* ---------------- Layout ---------------- */

.page-main {
    max-width: 900px;
    margin: 0 auto;
    padding: 28px 20px 60px;
}

.intro {
    background: var(--green-light);
    border: 1px solid var(--border);
    border-left: 5px solid var(--green);
    border-radius: var(--radius);
    padding: 18px 22px;
    margin-bottom: 26px;
}

.intro h2 {
    font-family: var(--font-display);
    color: var(--green-deep);
    margin: 0 0 8px;
    font-size: 1.3rem;
}

.intro p {
    margin: 0;
    color: var(--charcoal);
    font-size: 0.95rem;
}

/* ---------------- Progress track (desktop) ---------------- */

.progress-track {
    display: flex;
    align-items: flex-start;
    margin-bottom: 30px;
}

.step-dot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: default;
    flex: 1;
    min-width: 0;
}

.dot-num {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--white);
    border: 2px solid var(--border);
    color: var(--gray);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    transition: all 0.25s ease;
}

.dot-label {
    font-size: 0.68rem;
    text-align: center;
    color: var(--gray);
    max-width: 90px;
    line-height: 1.15;
}

.step-dot.active .dot-num {
    background: var(--green);
    border-color: var(--green);
    color: var(--white);
    box-shadow: 0 0 0 4px var(--green-light);
}

.step-dot.active .dot-label { color: var(--green-deep); font-weight: 600; }

.step-dot.done .dot-num {
    background: var(--gold);
    border-color: var(--gold);
    color: var(--white);
}

.step-dot.done { cursor: pointer; }
.step-dot.done .dot-label { color: var(--gold); }

.step-line {
    flex: 0.6;
    height: 2px;
    background: var(--border);
    margin-top: 17px;
}

.progress-mobile { display: none; }

@media (max-width: 700px) {
    .progress-track { display: none; }
    .progress-mobile { display: block; margin-bottom: 24px; }
    .progress-bar-bg {
        height: 8px;
        border-radius: 6px;
        background: var(--border);
        overflow: hidden;
    }
    .progress-bar-fill {
        height: 100%;
        background: linear-gradient(90deg, var(--green), var(--gold));
        width: 14%;
        transition: width 0.3s ease;
    }
    .progress-mobile p {
        margin: 8px 0 0;
        font-size: 0.85rem;
        color: var(--gray);
        text-align: center;
        font-weight: 600;
    }
}

/* ---------------- Wizard steps ---------------- */

.wizard-step {
    display: none;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 26px 26px 12px;
    margin-bottom: 20px;
    animation: fadeIn 0.35s ease;
}

.wizard-step.active { display: block; }

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

.section-title {
    font-family: var(--font-display);
    color: var(--green-deep);
    border-bottom: 2px solid var(--green-light);
    padding-bottom: 10px;
    margin: 0 0 18px;
    font-size: 1.15rem;
}

/* Score legend */

.score-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    background: var(--gold-light);
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 20px;
    font-size: 0.76rem;
    color: var(--charcoal);
    font-weight: 600;
}

.score-legend span { white-space: nowrap; }

/* Score rows */

.score-row {
    padding: 14px 0;
    border-bottom: 1px dashed var(--border);
    transition: background-color 0.2s ease;
}

.score-row:last-child { border-bottom: none; }

.score-row.row-error {
    background: #FDECEA;
    border-radius: 8px;
    padding: 14px 10px;
}

.score-label {
    margin: 0 0 10px;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--charcoal);
}

.score-options {
    display: flex;
    gap: 8px;
    flex-wrap: nowrap;
}

.pill {
    position: relative;
    flex: 1;
    text-align: center;
    padding: 10px 0;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-weight: 700;
    color: var(--gray);
    cursor: pointer;
    transition: all 0.15s ease;
    background: var(--white);
}

.pill input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    top: 0; left: 0;
    margin: 0;
    cursor: pointer;
}

.pill:hover { border-color: var(--green); color: var(--green-deep); }

.pill input:checked ~ span,
.pill:has(input:checked) {
    background: var(--green);
    border-color: var(--green);
    color: var(--white);
}

@media (max-width: 480px) {
    .score-options { gap: 6px; }
    .pill { padding: 9px 0; font-size: 0.85rem; }
    .wizard-step { padding: 20px 16px 8px; }
}

/* Text / textarea fields */

.field-row { margin-bottom: 18px; }

.field-row label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--charcoal);
    font-size: 0.92rem;
}

.field-row input[type="text"],
.field-row textarea,
.text-input {
    width: 100%;
    padding: 11px 13px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--charcoal);
    background: var(--white);
    transition: border-color 0.15s ease;
}

.field-row input[type="text"]:focus,
.field-row textarea:focus {
    outline: none;
    border-color: var(--green);
    box-shadow: 0 0 0 3px var(--green-light);
}

/* ---------------- Nav buttons ---------------- */

.wizard-nav {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    margin-top: 6px;
}

.btn {
    flex: 1;
    padding: 14px 20px;
    border-radius: 8px;
    border: none;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 0.98rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: transform 0.1s ease, box-shadow 0.15s ease;
    text-decoration: none;
}

.btn:active { transform: scale(0.98); }

.btn-back {
    background: var(--white);
    border: 2px solid var(--border);
    color: var(--gray);
    flex: 0.6;
}

.btn-back:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.btn-back:not(:disabled):hover {
    border-color: var(--blue);
    color: var(--blue-deep);
}

.btn-next {
    background: var(--green);
    color: var(--white);
    box-shadow: 0 3px 10px rgba(47, 162, 74, 0.3);
}

.btn-next:hover { background: var(--green-deep); }

.btn-submit {
    background: var(--gold);
    color: var(--white);
    box-shadow: 0 3px 10px rgba(214, 161, 34, 0.35);
}

.btn-submit:hover { background: #b9861a; }

.form-alert {
    background: #FDECEA;
    color: var(--error);
    border: 1px solid var(--error);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 18px;
}

/* ---------------- Success page ---------------- */

.success-wrap {
    display: flex;
    justify-content: center;
    padding: 40px 0;
}

.success-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 40px 36px;
    text-align: center;
    max-width: 420px;
    width: 100%;
}

.success-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--green);
    color: var(--white);
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 18px;
}

.success-card h2 {
    font-family: var(--font-display);
    color: var(--green-deep);
    margin: 0 0 8px;
}

.result-box {
    margin: 22px 0;
    padding: 18px;
    background: var(--gold-light);
    border-radius: var(--radius);
}

.result-label {
    margin: 0;
    font-size: 0.8rem;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.result-score {
    margin: 4px 0;
    font-family: var(--font-display);
    font-size: 2.2rem;
    color: var(--green-deep);
    font-weight: 700;
}

.result-tag {
    margin: 0;
    font-weight: 700;
    color: var(--gold);
}

/* ---------------- Footer ---------------- */

.site-footer {
    text-align: center;
    padding: 20px;
    color: var(--gray);
    font-size: 0.8rem;
    border-top: 1px solid var(--border);
}
