/**
 * SOLVA - Solar Needs Form
 * نموذج تحديد احتياجات نظام الطاقة الشمسية
 */

.sq-section { padding-top: var(--space-3xl, 4rem); }
.sq-section [hidden] { display: none !important; }

.sq-layout {
    display: grid;
    grid-template-columns: minmax(260px, 340px) 1fr;
    gap: 2rem;
    align-items: start;
}

/* ---------- Side info ---------- */
.sq-aside { position: sticky; top: calc(var(--header-height) + 1.5rem); display: grid; gap: 1.25rem; }

.sq-aside-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 24px;
    padding: 1.75rem;
    box-shadow: var(--shadow-md);
}

.sq-aside-icon {
    width: 56px; height: 56px;
    border-radius: 16px;
    display: grid; place-items: center;
    background: var(--primary);
    color: var(--white);
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.sq-aside-card h2 { font-size: 1.35rem; margin-bottom: .75rem; color: var(--primary); }
.sq-aside-card h3 { font-size: 1.1rem; margin-bottom: 1rem; color: var(--primary); }
.sq-aside-card p { color: var(--gray-600); line-height: 1.9; font-size: .97rem; margin: 0; }

.sq-points { list-style: none; padding: 0; margin: 1.25rem 0; display: grid; gap: .6rem; }
.sq-points li {
    display: flex; align-items: center; gap: .75rem;
    padding: .7rem .9rem;
    background: var(--gray-50);
    border-radius: 12px;
    font-weight: 600;
    color: var(--primary);
}
.sq-points i { width: 1.25rem; text-align: center; color: var(--accent-dark); }

.sq-note {
    display: flex; gap: .65rem; align-items: flex-start;
    padding: .9rem 1rem;
    border-radius: 12px;
    background: rgba(234, 179, 8, .1);
    color: var(--gray-700);
    font-size: .92rem; line-height: 1.8;
}
.sq-note i { color: #dc2626; margin-top: .35rem; }

.sq-tagline { margin-top: 1rem !important; font-weight: 700; color: var(--primary) !important; }
.sq-tagline i { color: #eab308; }

.sq-contact-row {
    display: flex; align-items: center; gap: .75rem;
    padding: .7rem 0;
    color: var(--gray-700);
    text-decoration: none;
    border-top: 1px solid var(--gray-200);
    font-weight: 600;
}
.sq-contact-row:first-of-type { border-top: 0; }
.sq-contact-row i { width: 1.25rem; text-align: center; color: var(--primary); }
.sq-contact-row.sq-wa, .sq-contact-row.sq-wa i { color: #16a34a; }

/* ---------- Form card ---------- */
.sq-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 28px;
    padding: 2.25rem;
    box-shadow: 0 30px 60px rgba(26, 39, 68, .08);
    min-width: 0;
}

.sq-steps {
    list-style: none; padding: 0; margin: 0 0 1rem;
    display: flex; gap: 1.5rem; flex-wrap: wrap;
}
.sq-steps li {
    display: flex; align-items: center; gap: .6rem;
    color: var(--gray-500); font-weight: 600; font-size: .95rem;
    transition: color var(--transition-normal);
}
.sq-steps li span {
    width: 32px; height: 32px; border-radius: 50%;
    display: grid; place-items: center;
    background: var(--gray-100); color: var(--gray-500);
    font-weight: 700;
    transition: all var(--transition-normal);
}
.sq-steps li.is-active, .sq-steps li.is-done { color: var(--primary); }
.sq-steps li.is-active span, .sq-steps li.is-done span { background: var(--primary); color: var(--white); }

.sq-progress { height: 6px; border-radius: 99px; background: var(--gray-100); overflow: hidden; margin-bottom: 2rem; }
.sq-progress-bar { height: 100%; width: 50%; background: var(--primary); border-radius: inherit; transition: width .45s ease; }

.sq-step { display: none; }
.sq-step.is-active { display: block; animation: sqFade .35s ease; }
@keyframes sqFade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.sq-required-hint { color: #dc2626; font-size: .9rem; margin-bottom: 1.5rem; }
.sq-req { color: #dc2626; font-weight: 700; }

/* One question per row: side-by-side questions with long labels were hard to follow */
.sq-grid-2 { display: block; }

.sq-step[data-step="1"] { counter-reset: sq-q; }
.sq-field {
    margin: 0;
    padding: 1.5rem 0;
    border: 0;
    /* box-shadow, not border-top: a <legend> cuts through a fieldset's top border */
    box-shadow: inset 0 1px 0 var(--gray-200);
    min-width: 0;
}
.sq-required-hint + .sq-grid-2 > .sq-field:first-child { box-shadow: none; padding-top: .25rem; }
/* Float the legend so it lays out like a normal label (no extra gap) */
fieldset.sq-field > legend { float: right; }
html[dir="ltr"] fieldset.sq-field > legend { float: left; }
fieldset.sq-field > legend + * { clear: both; }
.sq-field > label, .sq-field > legend {
    display: block;
    float: none;
    width: 100%;
    font-weight: 700;
    font-size: 1rem;
    line-height: 1.8;
    color: var(--primary);
    margin-bottom: .75rem;
    padding: 0;
}
.sq-step[data-step="1"] .sq-field > label::before,
.sq-step[data-step="1"] .sq-field > legend::before {
    counter-increment: sq-q;
    content: counter(sq-q);
    display: inline-grid;
    place-items: center;
    min-width: 26px; height: 26px;
    margin-inline-end: .55rem;
    border-radius: 8px;
    background: var(--primary);
    color: var(--white);
    font-size: .82rem;
    vertical-align: 2px;
}
.sq-field legend small { font-weight: 500; color: var(--gray-500); }

.sq-input {
    width: 100%;
    padding: 14px 18px;
    background: #fff;
    border: 1.5px solid #cbd5e1;
    border-radius: 12px;
    font-family: inherit;
    font-size: 1rem;
    color: #1d1d35;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, .04);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.sq-input::placeholder { color: #94a3b8; }
.sq-input:hover { border-color: #94a3b8; }
textarea.sq-input { resize: vertical; min-height: 120px; line-height: 1.8; }
.sq-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(29, 29, 53, .1); }
.sq-input[dir="ltr"] { text-align: left; }
html[dir="rtl"] .sq-input[dir="ltr"]::placeholder { text-align: right; }
.sq-other { margin-top: .75rem; }

.sq-chips { display: flex; flex-wrap: wrap; gap: .6rem; }
.sq-chip { position: relative; cursor: pointer; margin: 0; }
.sq-chip input { position: absolute; opacity: 0; pointer-events: none; }
.sq-chip span {
    display: inline-flex; align-items: center; gap: .5rem;
    padding: .7rem 1.1rem;
    border-radius: 999px;
    background: #fff;
    border: 1.5px solid #cbd5e1;
    color: #334155;
    font-weight: 600; font-size: .95rem;
    transition: all var(--transition-fast);
    user-select: none;
}
.sq-chip span::before {
    content: '';
    width: 16px; height: 16px; flex: none;
    border-radius: 50%;
    border: 2px solid var(--gray-400);
    transition: all var(--transition-fast);
}
.sq-check span::before { border-radius: 5px; }
.sq-chip:hover span { border-color: var(--primary); }
.sq-chip input:focus-visible + span { box-shadow: 0 0 0 3px var(--accent-glow); }
.sq-chip input:checked + span { background: var(--primary); border-color: var(--primary); color: var(--white); }
.sq-chip input:checked + span::before {
    border-color: var(--white);
    background: var(--white);
    box-shadow: inset 0 0 0 3px var(--primary);
}

.sq-error { color: #dc2626; font-size: .87rem; margin-top: .45rem; min-height: 0; }
.sq-error:empty { display: none; }
.sq-field.has-error .sq-input { border-color: #ef4444; background: #fff5f5; }
.sq-field.has-error .sq-chip span { border-color: #ef4444; }

.sq-hp { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Buttons ---------- */
.sq-actions { display: flex; justify-content: flex-end; gap: .75rem; margin-top: 1rem; flex-wrap: wrap; }
.sq-actions-split { justify-content: space-between; }
.sq-actions-center { justify-content: center; }

.sq-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .65rem;
    padding: 15px 28px;
    border-radius: 14px;
    font-family: inherit; font-weight: 700; font-size: 1.02rem;
    border: 2px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast), color var(--transition-fast);
}
.sq-btn:disabled { opacity: .7; cursor: wait; }
.sq-btn-primary { background: var(--primary); color: var(--white); box-shadow: 0 14px 30px rgba(29, 29, 53, .2); }
.sq-btn-primary:hover:not(:disabled) { transform: translateY(-3px); box-shadow: 0 18px 36px rgba(29, 29, 53, .28); }
.sq-btn-ghost { background: transparent; color: var(--primary); border-color: var(--gray-200); }
.sq-btn-ghost:hover { border-color: var(--primary); }
.sq-btn-wa { background: #25d366; color: #fff; }
.sq-btn-wa:hover { transform: translateY(-3px); }

/* ---------- Models gallery ---------- */
.sq-step-head { margin-bottom: 1.5rem; }
.sq-step-head h3 {
    display: inline-block;
    font-size: 1.15rem;
    color: #fff;
    background: var(--primary);
    padding: .6rem 1.1rem;
    border-radius: 10px;
    margin-bottom: .75rem;
}
body.dark-mode .sq-step-head h3 { color: #040712; }
.sq-step-head p { color: var(--gray-600); margin: 0; }

.sq-models { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.sq-model { cursor: pointer; margin: 0; display: block; }
.sq-model input { position: absolute; opacity: 0; pointer-events: none; }
.sq-model-img {
    position: relative; display: block;
    border-radius: 18px; overflow: hidden;
    aspect-ratio: 3 / 4;
    background: var(--gray-100);
    border: 3px solid transparent;
    transition: border-color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
}
.sq-model-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s ease; }
.sq-model:hover .sq-model-img img { transform: scale(1.04); }
.sq-model:hover .sq-model-img { box-shadow: var(--shadow-lg); }
.sq-model input:focus-visible + .sq-model-img { box-shadow: 0 0 0 4px var(--accent-glow); }
.sq-model input:checked + .sq-model-img { border-color: var(--primary); box-shadow: 0 16px 34px rgba(29, 29, 53, .25); }

.sq-model-check {
    position: absolute; top: 10px; inset-inline-start: 10px;
    width: 34px; height: 34px; border-radius: 50%;
    display: grid; place-items: center;
    background: var(--primary); color: var(--white);
    transform: scale(0); transition: transform var(--transition-bounce);
}
.sq-model input:checked + .sq-model-img .sq-model-check { transform: scale(1); }

.sq-zoom {
    position: absolute; bottom: 10px; inset-inline-end: 10px;
    width: 38px; height: 38px; border-radius: 50%;
    border: 0; cursor: zoom-in;
    background: rgba(255, 255, 255, .92); color: #1d1d35;
    display: grid; place-items: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .2);
    transition: transform var(--transition-fast);
}
.sq-zoom:hover { transform: scale(1.1); }

.sq-model-label { display: block; text-align: center; margin-top: .5rem; font-weight: 700; color: var(--gray-600); font-size: .92rem; }
.sq-model input:checked ~ .sq-model-label { color: var(--primary); }

/* ---------- Alerts & success ---------- */
.sq-alert { margin-top: 1.5rem; padding: 1rem 1.2rem; border-radius: 12px; font-weight: 600; background: #fee2e2; color: #991b1b; }

.sq-success { text-align: center; padding: 2rem 0 1rem; animation: sqFade .4s ease; }
.sq-success-icon {
    width: 86px; height: 86px; margin: 0 auto 1.25rem;
    border-radius: 50%;
    display: grid; place-items: center;
    background: #dcfce7; color: #16a34a; font-size: 2.4rem;
    animation: sqPop .5s cubic-bezier(.34, 1.56, .64, 1);
}
@keyframes sqPop { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
.sq-success h3 { font-size: 1.6rem; color: var(--primary); margin-bottom: .75rem; }
.sq-success p { color: var(--gray-600); max-width: 480px; margin: 0 auto 1.5rem; line-height: 1.9; }

/* ---------- Lightbox ---------- */
.sq-lightbox {
    position: fixed; inset: 0; z-index: 10000;
    background: rgba(4, 7, 18, .9);
    display: grid; place-items: center;
    padding: 1.5rem;
    animation: sqFade .25s ease;
}
.sq-lightbox[hidden] { display: none; }
.sq-lightbox img { max-width: 100%; max-height: 90vh; border-radius: 14px; box-shadow: 0 30px 80px rgba(0, 0, 0, .5); }
.sq-lightbox-close {
    position: absolute; top: 1rem; inset-inline-end: 1rem;
    width: 46px; height: 46px; border-radius: 50%;
    border: 0; background: rgba(255, 255, 255, .15); color: #fff; font-size: 1.25rem; cursor: pointer;
}

/* ---------- Dark mode ---------- */
body.dark-mode .sq-aside-card,
body.dark-mode .sq-card { background: #0b1222; border-color: rgba(255, 255, 255, .08); }
body.dark-mode .sq-input, body.dark-mode .sq-chip span { background: #0f172a; border-color: rgba(255, 255, 255, .18); color: #e2e8f0; }
body.dark-mode .sq-points li { background: #0f172a; }
body.dark-mode .sq-input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(56, 189, 248, .15); }
body.dark-mode .sq-field { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08); }
body.dark-mode .sq-field.has-error .sq-input { background: rgba(239, 68, 68, .08); }
body.dark-mode .sq-note { background: rgba(234, 179, 8, .08); }

/* ---------- Responsive ---------- */
@media (max-width: 992px) {
    .sq-layout { grid-template-columns: 1fr; }
    .sq-aside { position: static; order: 2; }
}
@media (max-width: 640px) {
    .sq-card { padding: 1.4rem; border-radius: 22px; }
    .sq-models { grid-template-columns: repeat(2, 1fr); gap: .75rem; }
    .sq-steps { gap: 1rem; font-size: .88rem; }
    .sq-actions .sq-btn { flex: 1; }
}

.sq-prefilled .sq-input { border-color: #ca8a04; background: #fffbeb; }
body.dark-mode .sq-prefilled .sq-input { background: rgba(234, 179, 8, .08); }

/* =====================================================
   Minimal direction (design-system/solva/MASTER.md):
   small radii, borders instead of shadows, no decorative icons
   ===================================================== */
.sq-section { background: #f6f7f9; }
.sq-aside-card, .sq-card { border-radius: 10px; border-color: #e3e6ec; box-shadow: none; }
.sq-card { padding: 1.75rem; }
.sq-aside-card { padding: 1.4rem; }
.sq-aside-card h2 { font-size: 1.15rem; color: #0f172a; }
.sq-aside-card p { color: #475569; }
.sq-points { list-style: disc; padding-inline-start: 1.2rem; margin: 1rem 0; gap: .2rem; }
.sq-points li { display: list-item; padding: 0; background: none; border-radius: 0; font-weight: 600; color: #0f172a; }
.sq-note { display: block; margin: 0 0 .75rem !important; padding: .1rem 0 .1rem 0; padding-inline-start: .85rem; background: none; border-inline-start: 3px solid #c9ced8; border-radius: 0; font-size: .9rem; }
.sq-tagline { font-weight: 700; color: #0f172a !important; margin: 0 0 1rem !important; }
.sq-calc-link {
    display: block; padding: .85rem 1rem; border-radius: 8px;
    border: 1px solid #e3e6ec; background: #f6f7f9; color: #0f172a; text-decoration: none;
}
.sq-calc-link:hover { border-color: #c9ced8; color: #0f172a; }
.sq-calc-link strong { display: block; font-size: .95rem; }
.sq-calc-link > span { display: block; margin-top: .15rem; font-size: .88rem; color: #475569; text-decoration: underline; text-underline-offset: 3px; }
.sq-contact-row i { color: #475569; }
.sq-contact-row.sq-wa, .sq-contact-row.sq-wa i { color: #15803d; }

.sq-steps li span { border-radius: 6px; }
.sq-progress { height: 4px; }
.sq-input, .sq-chip span { border-radius: 8px; border-width: 1px; }
.sq-chip span { border-color: #c9ced8; }
.sq-input { border-color: #c9ced8; box-shadow: none; }
.sq-input:focus { border-color: #1d1d35; box-shadow: 0 0 0 3px rgba(37, 99, 235, .15); }
.sq-step[data-step="1"] .sq-field > label::before,
.sq-step[data-step="1"] .sq-field > legend::before { border-radius: 6px; background: #eef0f4; color: #0f172a; }
.sq-btn { border-radius: 8px; height: 46px; padding: 0 1.4rem; font-size: .98rem; }
.sq-btn-primary { box-shadow: none; }
.sq-btn-primary:hover:not(:disabled) { transform: none; box-shadow: none; background: #2b2b4d; }
.sq-btn-wa:hover { transform: none; background: #188a46; }
.sq-btn-wa { background: #1fa855; }

.sq-step-head h3 { display: block; background: none; color: #0f172a; padding: 0; border-radius: 0; font-size: 1.15rem; margin-bottom: .35rem; }
.sq-model-img { border-radius: 8px; border-width: 2px; }
.sq-model:hover .sq-model-img img { transform: none; }
.sq-model:hover .sq-model-img { box-shadow: none; border-color: #c9ced8; }
.sq-model input:checked + .sq-model-img { box-shadow: none; }
.sq-model-check { border-radius: 6px; }
.sq-zoom { border-radius: 6px; box-shadow: none; }
.sq-success-icon { animation: none; border-radius: 10px; }
.sq-alert { border-radius: 8px; }

body.dark-mode .sq-section { background: #070c18; }
body.dark-mode .sq-step-head h3, body.dark-mode .sq-aside-card h2, body.dark-mode .sq-tagline, body.dark-mode .sq-points li { color: #e2e8f0 !important; }
body.dark-mode .sq-calc-link { background: #0f172a; border-color: rgba(255, 255, 255, .12); color: #e2e8f0; }
body.dark-mode .sq-calc-link > span { color: #94a3b8; }
@media (max-width: 640px) { .sq-card { padding: 1.1rem; } }

/* Completed-work photos shown after the request is sent */
.sq-success-models { margin-top: 2.5rem; padding-top: 2rem; border-top: 1px solid var(--gray-100); text-align: start; }
.sq-success-models .sq-model { cursor: default; }
.sq-success-models .sq-model-img { cursor: zoom-in; }
body.dark-mode .sq-success-models { border-top-color: rgba(255, 255, 255, .08); }
.sq-success-models .sq-step-head h3 { font-size: 1.15rem; margin-bottom: .35rem; }
.sq-success-models .sq-step-head p { max-width: none; margin: 0; }

/* Calculator shortcut at the loads question */
.sq-calc-cta {
    display: flex; align-items: center; gap: .85rem; margin: .1rem 0 .7rem; padding: .8rem 1rem;
    border: 1px dashed #b9c0cd; border-radius: 8px; background: #f6f7f9; color: #0f172a; text-decoration: none;
    transition: border-color .2s ease, background .2s ease;
}
.sq-calc-cta:hover { border-color: #1d1d35; border-style: solid; background: #fff; color: #0f172a; }
.sq-calc-cta > .fa-calculator { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 8px; background: #1d1d35; color: #fff; font-size: 1.05rem; }
.sq-calc-cta strong { display: block; font-size: .95rem; }
.sq-calc-cta small { display: block; color: #475569; font-size: .82rem; line-height: 1.6; }
.sq-calc-cta-go { margin-inline-start: auto; color: #1d1d35; transition: transform .2s ease; }
.sq-calc-cta:hover .sq-calc-cta-go { transform: translateX(-3px); }
html[dir="ltr"] .sq-calc-cta:hover .sq-calc-cta-go { transform: translateX(3px); }
.sq-prefill-note { margin: 0 0 .5rem; color: #a16207; font-size: .85rem; font-weight: 600; }
body.dark-mode .sq-calc-cta { background: #0f172a; border-color: rgba(255, 255, 255, .18); color: #e2e8f0; }
body.dark-mode .sq-calc-cta small { color: #94a3b8; }
body.dark-mode .sq-calc-cta > .fa-calculator { background: #e2e8f0; color: #0f172a; }
body.dark-mode .sq-calc-cta-go { color: #e2e8f0; }
