/* ===========================
   WaForm – Public Form Styles
   Mobile-first, wa.link inspired
   =========================== */

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

:root {
    --green:       #25D366;
    --green-dark:  #1da851;
    --green-light: rgba(37,211,102,.12);
    --text:        #111827;
    --text-muted:  #6b7280;
    --border:      #e5e7eb;
    --radius:      10px;
    --max-w:       480px;
}

html, body {
    height: 100%;
    background: #fff;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    overscroll-behavior: none;
}

/* ---- Progress bar (fixed bottom) ---- */
.progress-bar-wrap {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: #e5e7eb;
    z-index: 200;
}
.progress-bar-fill {
    height: 100%;
    background: var(--green);
    transition: width .4s ease;
    border-radius: 0 2px 2px 0;
}

/* ---- Back button ---- */
.back-btn {
    position: fixed;
    top: 14px;
    left: 14px;
    z-index: 150;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: #f3f4f6;
    color: #6b7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s, transform .1s;
}
.back-btn:hover { background: #e5e7eb; }
.back-btn:active { transform: scale(.92); }

/* ---- Screen system ---- */
.screen {
    display: none;
    min-height: 100vh;
    padding-bottom: 40px;
}
.screen.active { display: flex; align-items: flex-start; justify-content: center; }

.screen-inner {
    width: 100%;
    max-width: var(--max-w);
    padding: 28px 24px 60px;
}

/* ---- Welcome screen ---- */
.welcome-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding-top: 48px;
}
.logo-wrap {
    margin-bottom: 28px;
}
.form-logo {
    max-height: 72px;
    max-width: 220px;
    object-fit: contain;
}
.form-logo-text {
    font-size: 22px;
    font-weight: 800;
    color: var(--text);
}
.welcome-title {
    font-size: 26px;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 16px;
    color: var(--text);
}
.welcome-intro {
    font-size: 16px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 16px;
    max-width: 380px;
}
.welcome-meta {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 32px;
}

/* ---- Question screen ---- */
.question-inner {
    padding-top: 64px;
}
.q-meta {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: .03em;
    margin-bottom: 12px;
    text-transform: uppercase;
}
.q-title {
    font-size: 24px;
    font-weight: 800;
    line-height: 1.25;
    color: var(--text);
    margin-bottom: 10px;
}
.optional {
    font-size: 14px;
    font-weight: 400;
    color: var(--text-muted);
}
.q-hint {
    font-size: 15px;
    color: var(--text-muted);
    line-height: 1.55;
    margin-bottom: 24px;
}

/* ---- Inputs ---- */
.input-wrap { margin-bottom: 20px; }

.q-input {
    width: 100%;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 15px 16px;
    font-size: 16px; /* Prevents iOS zoom */
    color: var(--text);
    font-family: inherit;
    background: #fff;
    transition: border-color .2s, box-shadow .2s;
    -webkit-appearance: none;
}
.q-input:focus {
    outline: none;
    border-color: var(--green);
    box-shadow: 0 0 0 4px var(--green-light);
}
.q-textarea { resize: none; }

/* Amount £ prefix */
.input-group {
    display: flex;
    align-items: stretch;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color .2s, box-shadow .2s;
}
.input-group:focus-within {
    border-color: var(--green);
    box-shadow: 0 0 0 4px var(--green-light);
}
.input-prefix {
    display: flex;
    align-items: center;
    padding: 0 14px;
    background: #f9fafb;
    border-right: 2px solid var(--border);
    font-size: 18px;
    font-weight: 700;
    color: var(--text-muted);
    flex-shrink: 0;
}
.input-group .q-input {
    border: none;
    border-radius: 0;
    box-shadow: none;
    flex: 1;
}
.input-group .q-input:focus { box-shadow: none; }

/* ---- Yes/No buttons ---- */
.yesno-wrap {
    display: flex;
    gap: 12px;
}
.yesno-btn {
    flex: 1;
}

/* ---- Choice buttons ---- */
.choices-wrap {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.choice-option {
    width: 100%;
    text-align: left;
    justify-content: flex-start;
}

/* Shared choice button styles */
.choice-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 20px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    transition: border-color .15s, background .15s, color .15s, transform .1s;
    font-family: inherit;
}
.choice-btn:hover {
    border-color: var(--green);
    background: var(--green-light);
}
.choice-btn:active { transform: scale(.98); }
.choice-btn.selected {
    border-color: var(--green);
    background: var(--green-light);
    color: var(--green-dark);
}

/* ---- Next button ---- */
.btn-next {
    width: 100%;
    padding: 18px;
    background: var(--green);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: background .15s, transform .1s, box-shadow .15s;
    box-shadow: 0 4px 15px rgba(37,211,102,.35);
}
.btn-next:hover { background: var(--green-dark); }
.btn-next:active { transform: scale(.98); }

/* ---- Completion screen ---- */
.complete-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding-top: 60px;
}
.complete-check {
    width: 80px;
    height: 80px;
    background: var(--green);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    font-weight: 700;
    margin-bottom: 24px;
    box-shadow: 0 8px 24px rgba(37,211,102,.35);
    animation: popIn .4s cubic-bezier(.34,1.56,.64,1) both;
}
@keyframes popIn {
    from { transform: scale(0); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}
.complete-title {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 10px;
}
.complete-sub {
    font-size: 15px;
    color: var(--text-muted);
    max-width: 340px;
    margin: 0 auto 28px;
    line-height: 1.5;
}

/* ---- Answers summary ---- */
.answers-summary {
    width: 100%;
    background: #f9fafb;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 28px;
    text-align: left;
}
.summary-row {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}
.summary-row:last-child { border-bottom: none; }
.summary-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: 3px;
}
.summary-value {
    font-size: 15px;
    color: var(--text);
    font-weight: 600;
}

/* ---- WhatsApp send button ---- */
.btn-whatsapp {
    width: 100%;
    padding: 18px 24px;
    background: #25D366;
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: background .15s, transform .1s, box-shadow .15s;
    box-shadow: 0 4px 20px rgba(37,211,102,.4);
}
.btn-whatsapp:hover { background: #1da851; }
.btn-whatsapp:active { transform: scale(.98); }

/* ---- Legal links ---- */
.legal-links {
    margin-top: 24px;
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}
.legal-links a {
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: color .15s, border-color .15s;
}
.legal-links a:hover {
    color: var(--green-dark);
    border-color: var(--green-dark);
}

/* ---- Shake animation for validation ---- */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%       { transform: translateX(-8px); }
    40%       { transform: translateX(8px); }
    60%       { transform: translateX(-6px); }
    80%       { transform: translateX(6px); }
}
.shake { animation: shake .5s ease; }

/* ---- Screen transitions ---- */
.screen { animation: fadeIn .25s ease both; }
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}


/* ---- Date input ---- */
input.q-date {
    -webkit-appearance: none;
    appearance: none;
    font-size: 16px;
    color: #1a1a1a;
    cursor: pointer;
}
input.q-date::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.6;
}

/* ---- Address fields ---- */
.q-addr-extra {
    display: block;
}

/* ---- Skipped question rows in summary ---- */
.summary-skipped   { opacity: 0.5; }
.summary-skip-note { font-style: italic; color: #999; }
