/* ========================================
   SOLARIS — Questionnaires (/q/<slug> + homepage modal)
   Builds on apply.css (form fields, radio/checkbox chips).
   ======================================== */

.q-page { min-height: 70vh; }

.q-desc {
    white-space: pre-line;
}

.q-meta {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px 18px;
    margin-top: 14px !important;
    font-size: 0.85rem !important;
    color: var(--text-secondary);
}

.q-meta i { color: var(--primary-light); margin-right: 4px; }

.q-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    margin-bottom: 24px;
    border-radius: var(--border-radius-sm);
    border: 2px solid rgba(245, 158, 11, 0.35);
    background: rgba(245, 158, 11, 0.08);
    color: var(--text-primary);
    font-size: 0.88rem;
    font-weight: 600;
}

.q-banner i { color: var(--accent-warm); }

.q-wrap {
    background: var(--bg-card);
    border: var(--border-width) solid var(--border-color);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-card);
    padding: 36px 36px 28px;
}

/* ── Question blocks ─────────────────────────────────────────────────────── */

.q-field {
    padding-bottom: 22px;
    border-bottom: 1px solid var(--border-color);
}

.q-field:last-of-type { border-bottom: none; }

.q-label {
    display: block;
    font-weight: 800;
    font-size: 1rem;
    margin-bottom: 10px;
    color: var(--text-heading);
    line-height: 1.4;
}

.q-field .apply-field-hint { margin-top: -6px; }

.q-options {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.q-options label.apply-radio,
.q-options label.apply-checkbox,
.q-field .apply-radio-group label.apply-radio {
    margin-bottom: 0;
}

.q-note {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 8px;
}

.q-number { max-width: 220px; }

/* Dropdown — matches the apply.css text inputs */
.q-select { position: relative; max-width: 420px; }

.q-select select {
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 12px 42px 12px 16px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.92rem;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.q-select select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(50, 90, 211, 0.15);
}

.q-select select option { background: var(--bg-secondary); color: var(--text-primary); }

.q-select i {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.75rem;
    color: var(--text-secondary);
    pointer-events: none;
}

/* Rating scale — a row of chunky number tiles */
.q-scale {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    max-width: 420px;
}

.q-scale-10 {
    grid-template-columns: repeat(10, minmax(0, 1fr));
    max-width: none;
}

.q-scale-opt { position: relative; cursor: pointer; }

.q-scale-opt input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.q-scale-opt span {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 46px;
    border-radius: 12px;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    font-weight: 800;
    font-size: 1rem;
    color: var(--text-secondary);
    transition: border-color 0.2s, background 0.2s, color 0.2s, transform 0.15s, box-shadow 0.2s;
    user-select: none;
}

.q-scale-opt:hover span {
    border-color: var(--primary);
    color: var(--text-primary);
    transform: translateY(-2px);
}

.q-scale-opt input:checked + span {
    background: var(--primary);
    border-color: var(--primary-dark);
    color: #ffffff;
    box-shadow: var(--shadow-glow-blue);
}

.q-scale-opt input:focus-visible + span {
    box-shadow: 0 0 0 3px rgba(50, 90, 211, 0.35);
}

.q-scale-labels {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 8px;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.q-scale-5 + .q-scale-labels { max-width: 420px; }

/* ── Errors ─────────────────────────────────────────────────────────────── */

.q-error,
.q-form-error {
    margin-top: 8px;
    font-size: 0.82rem;
    font-weight: 700;
    color: #ff6b6b;
}

.q-form-error {
    padding: 12px 16px;
    border-radius: var(--border-radius-sm);
    background: rgba(255, 107, 107, 0.08);
    border: 2px solid rgba(255, 107, 107, 0.3);
}

.q-field.has-error input[type="text"],
.q-field.has-error input[type="email"],
.q-field.has-error input[type="number"],
.q-field.has-error textarea,
.q-field.has-error select {
    border-color: #ff6b6b;
}

.q-field.has-error .q-scale-opt span,
.q-field.has-error label.apply-radio,
.q-field.has-error label.apply-checkbox {
    border-color: rgba(255, 107, 107, 0.55);
}

/* Honeypot: off-screen, never focusable for humans */
.q-hp {
    position: absolute !important;
    left: -10000px !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.q-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
    margin-top: 24px;
    padding-top: 22px;
    border-top: 1px solid var(--border-color);
}

.q-actions .q-note { margin: 0 auto 0 0; }

.q-actions .btn[disabled] { opacity: 0.6; cursor: wait; transform: none; }

/* ── States (thanks / closed / sign in / not found) ─────────────────────── */

.q-state {
    text-align: center;
    padding: 12px 0 6px;
}

.q-state-page {
    padding-top: 40px;
}

.q-state-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 18px;
    border-radius: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: var(--primary-light);
    background: rgba(50, 90, 211, 0.12);
    border: 2px solid rgba(50, 90, 211, 0.3);
}

.q-state-icon-done {
    color: var(--accent-green);
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.35);
    animation: qPop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.q-state h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); margin-bottom: 12px; }
.q-state h2 { font-size: 1.6rem; margin-bottom: 10px; }

.q-state p {
    color: var(--text-secondary);
    max-width: 460px;
    margin: 0 auto;
    line-height: 1.7;
    white-space: pre-line;
}

.q-state-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}

@keyframes qPop {
    from { transform: scale(0.6); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* ── Homepage modal ─────────────────────────────────────────────────────── */

.q-modal { align-items: flex-start; overflow-y: auto; }

.q-modal-card {
    max-width: 640px;
    margin: auto;
    text-align: left;
    padding: 40px 36px 28px;
}

.q-modal-card h3 { font-size: 1.7rem; padding-right: 32px; }
.q-modal-card .apply-eyebrow { margin-bottom: 8px; }
.q-modal-card .modal-desc { margin-bottom: 18px; }

/* Inside the modal the card itself is the surface */
.q-modal-card .q-wrap {
    background: none;
    border: none;
    box-shadow: none;
    padding: 0;
}

.q-modal-link {
    margin-top: 14px;
    text-align: center;
    font-size: 0.82rem;
}

.q-modal-link a { color: var(--text-secondary); }
.q-modal-link a:hover { color: var(--primary-light); }

@media (max-width: 640px) {
    .q-wrap { padding: 24px 18px 20px; border-radius: var(--border-radius); }
    .q-modal-card { padding: 34px 18px 22px; }
    .q-scale-10 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
    .q-actions { flex-direction: column-reverse; align-items: stretch; }
    .q-actions .q-note { margin: 0; text-align: center; }
}
