/* ISPAE Mid-term Meeting 2026 — feedback form. Colours taken from the event banner. */
:root {
    --orange: #e3672a;
    --mustard: #e9a22c;
    --green: #5db547;
    --teal: #0bb58a;
    --purple: #8e4699;
    --brown: #6b3a36;

    --bg: #faf6f2;
    --card: #ffffff;
    --ink: #2e2220;
    --muted: #7c6c68;
    --line: #ece3dc;
    --accent: var(--purple);
    --accent-soft: #f5ecf7;
    --danger: #c9372c;
    --radius: 16px;
    --shadow: 0 1px 2px rgba(46, 34, 32, .04), 0 8px 24px rgba(46, 34, 32, .06);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.55;
    color: var(--ink);
    background:
        radial-gradient(1200px 500px at 0% 0%, rgba(233, 162, 44, .10), transparent 60%),
        radial-gradient(1000px 500px at 100% 100%, rgba(142, 70, 153, .08), transparent 60%),
        var(--bg);
    min-height: 100vh;
}

.page {
    max-width: 760px;
    margin: 0 auto;
    padding: 24px 16px 40px;
}

.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); border: 0;
}

/* ---------- Header ---------- */
.hero {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 20px;
}
.hero__banner { display: block; width: 100%; height: auto; }
.rainbow {
    height: 6px;
    background: linear-gradient(90deg, var(--orange) 0 20%, var(--mustard) 20% 40%, var(--green) 40% 60%, var(--teal) 60% 80%, var(--purple) 80% 100%);
}
.hero__text { padding: 22px 28px 26px; }
.eyebrow {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--accent);
    background: var(--accent-soft);
    padding: 4px 10px;
    border-radius: 999px;
    margin-bottom: 10px;
}
.hero h1 {
    margin: 0 0 8px;
    font-size: 21px;
    line-height: 1.35;
    font-weight: 600;
    color: var(--brown);
}
.hero p { margin: 0; color: var(--muted); }

/* ---------- Alert & progress ---------- */
.alert {
    background: #fdecea;
    color: var(--danger);
    border: 1px solid #f6c8c3;
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 16px;
    font-weight: 500;
}

.progress {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    margin-bottom: 16px;
    background: rgba(250, 246, 242, .92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 12px;
}
.progress__bar {
    flex: 1;
    height: 8px;
    background: var(--line);
    border-radius: 999px;
    overflow: hidden;
}
.progress__bar span {
    display: block;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--orange), var(--mustard), var(--green), var(--teal), var(--purple));
    background-size: 760px 100%;
    border-radius: inherit;
    transition: width .35s ease;
}
.progress__label { font-size: 13px; color: var(--muted); white-space: nowrap; }
.progress__label b { color: var(--ink); }

/* ---------- Question cards ---------- */
.card {
    border: 1px solid transparent;
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px 24px 18px;
    margin: 0 0 16px;
    min-width: 0;
    transition: border-color .2s, box-shadow .2s;
}
.card.has-error { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(201, 55, 44, .08), var(--shadow); }

.card__title {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 0;
    margin-bottom: 16px;
    font-size: 16px;
    font-weight: 600;
    color: var(--ink);
    float: left; /* lets the legend sit inside the card padding */
    width: 100%;
}
.card__title + * { clear: both; }
.num {
    flex: 0 0 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    font-size: 14px;
    color: #fff;
    background: var(--accent);
}
.num--icon { background: var(--brown); }
[data-question=q1] .num { background: var(--orange); }
[data-question=q2] .num { background: var(--mustard); }
[data-question=q3] .num { background: var(--green); }
[data-question=q4] .num { background: var(--teal); }
[data-question=q5] .num { background: var(--purple); }

/* ---------- Your details ---------- */
.fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 16px;
}
.field--full { grid-column: 1 / -1; }
.field label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 6px;
}
.field__error {
    display: none;
    margin-top: 6px;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--danger);
}
.field.is-invalid input { border-color: var(--danger); }
.field.is-invalid .field__error { display: block; }

.req { color: var(--danger); font-style: normal; }
.optional { color: var(--muted); font-weight: 400; font-size: 13px; }

.error-msg {
    display: none;
    margin: 10px 0 0;
    color: var(--danger);
    font-size: 13px;
    font-weight: 500;
}
.card.has-error .error-msg { display: block; }

/* ---------- Rating (Excellent → Poor) ---------- */
.rating {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}
.rating__item { position: relative; cursor: pointer; }
.rating__item input,
.chip input { position: absolute; opacity: 0; pointer-events: none; }

.rating__face,
.rating__label { pointer-events: none; }

.rating__item {
    --tone: var(--green);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 6px 12px;
    border: 1.5px solid var(--line);
    border-radius: 12px;
    background: #fff;
    text-align: center;
    transition: border-color .15s, background .15s, transform .15s;
}
.rating__item.r5 { --tone: var(--teal); }
.rating__item.r4 { --tone: var(--green); }
.rating__item.r3 { --tone: var(--mustard); }
.rating__item.r2 { --tone: var(--orange); }
.rating__item.r1 { --tone: var(--danger); }

.rating__face {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #f3eeea;
    position: relative;
    transition: background .15s;
}
/* simple face: two eyes + mouth whose curve changes with the score */
.rating__face::before {
    content: '';
    position: absolute;
    top: 11px; left: 10px;
    width: 4px; height: 4px;
    border-radius: 50%;
    background: var(--muted);
    box-shadow: 10px 0 0 var(--muted);
}
.rating__face::after {
    content: '';
    position: absolute;
    left: 10px; width: 14px;
    border: 2px solid var(--muted);
}
.r5 .rating__face::after { top: 17px; height: 8px; border-top: 0; border-radius: 0 0 50% 50% / 0 0 100% 100%; }
.r4 .rating__face::after { top: 19px; height: 5px; border-top: 0; border-radius: 0 0 50% 50% / 0 0 100% 100%; }
.r3 .rating__face::after { top: 21px; height: 0; border-width: 2px 0 0; }
.r2 .rating__face::after { top: 21px; height: 6px; border-bottom: 0; border-radius: 14px 14px 0 0; }
.r1 .rating__face::after { top: 20px; height: 8px; border-bottom: 0; border-radius: 14px 14px 0 0; }

.rating__label { font-size: 13px; font-weight: 500; color: var(--ink); line-height: 1.25; }

.rating__item:hover { border-color: var(--tone); transform: translateY(-1px); }
.rating__item:has(input:checked) {
    border-color: var(--tone);
    background: color-mix(in srgb, var(--tone) 10%, #fff);
}
.rating__item:has(input:checked) .rating__face { background: var(--tone); }
.rating__item:has(input:checked) .rating__face::before { background: #fff; box-shadow: 10px 0 0 #fff; }
.rating__item:has(input:checked) .rating__face::after { border-color: #fff; }
.rating__item:has(input:focus-visible) { outline: 3px solid color-mix(in srgb, var(--tone) 40%, transparent); outline-offset: 2px; }

/* ---------- Choice chips ---------- */
.chips {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}
.chip { position: relative; cursor: pointer; }
.chip span {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border: 1.5px solid var(--line);
    border-radius: 12px;
    font-weight: 500;
    font-size: 14px;
    transition: border-color .15s, background .15s;
}
.chip span::before {
    content: '';
    flex: 0 0 18px;
    height: 18px;
    border: 2px solid #cfc3bb;
    border-radius: 50%;
    transition: border .15s;
}
.chip:hover span { border-color: var(--accent); }
.chip input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.chip input:checked + span::before { border: 5px solid var(--accent); }
.chip input:focus-visible + span { outline: 3px solid rgba(142, 70, 153, .3); outline-offset: 2px; }

.other {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows .25s ease, margin .25s ease;
}
.other > * { overflow: hidden; }
.other.is-open { grid-template-rows: 1fr; margin-top: 12px; }

/* ---------- Text inputs ---------- */
input[type=text],
input[type=email],
input[type=tel],
input[type=password],
textarea {
    width: 100%;
    font: inherit;
    color: var(--ink);
    padding: 12px 14px;
    border: 1.5px solid var(--line);
    border-radius: 12px;
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; min-height: 120px; }
input[type=text]:focus,
input[type=email]:focus,
input[type=tel]:focus,
input[type=password]:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(142, 70, 153, .12);
}
.counter { text-align: right; font-size: 12px; color: var(--muted); margin-top: 6px; }

/* ---------- Submit ---------- */
.submit { text-align: center; margin-top: 24px; }
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    max-width: 380px;
    padding: 16px 28px;
    border: 0;
    border-radius: 999px;
    font: inherit;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, var(--purple), #6c2f7a);
    box-shadow: 0 8px 20px rgba(142, 70, 153, .3);
    cursor: pointer;
    transition: transform .15s, box-shadow .15s, opacity .15s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(142, 70, 153, .35); }
.btn:hover .btn__icon { transform: translateX(3px); }
.btn__icon { transition: transform .15s; }
.btn:disabled { opacity: .75; cursor: wait; transform: none; }
.btn.is-loading .btn__icon { animation: nudge .8s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateX(5px); } }

.submit__note { margin: 14px 0 0; color: var(--brown); font-weight: 500; }

.footer { text-align: center; color: var(--muted); font-size: 12px; margin-top: 32px; }

/* ---------- Mobile ---------- */
@media (max-width: 600px) {
    .page { padding: 12px 12px 32px; }
    .hero__text { padding: 18px 18px 20px; }
    .hero h1 { font-size: 18px; }
    .card { padding: 18px 16px 14px; }
    .card__title { font-size: 15px; }
    .rating { gap: 6px; }
    .rating__item { padding: 10px 2px 8px; border-radius: 10px; }
    .rating__label { font-size: 11px; }
    .chips { grid-template-columns: 1fr; }
    .fields { grid-template-columns: 1fr; }
    .progress__label { font-size: 12px; }
}
@media (min-width: 601px) and (max-width: 700px) {
    .rating__label { font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}
