@import url('./shared.css');

/* =============================================================
   Contact page — two-step request form
   ============================================================= */
.contact-page {
    position: relative;
    overflow: hidden;
}

/* Soft decorative pills bleeding off the reading-start edge */
.contact-page::before,
.contact-page::after {
    content: "";
    position: absolute;
    inset-inline-start: -120px;
    border-radius: 999px;
    background: var(--accent-soft);
    pointer-events: none;
    z-index: 0;
}

/* Kept clear of the heading block so they never sit under the lede */
.contact-page::before {
    top: 46%;
    width: 300px;
    height: 74px;
}

.contact-page::after {
    bottom: 10%;
    width: 220px;
    height: 74px;
}

.contact-page .page-wrap {
    position: relative;
    z-index: 1;
}

/* ---------- Step indicator ---------- */
.steps {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 26px;
}

.step {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
}

.step .num {
    display: grid;
    place-items: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #C9D0D8;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
}

.step.is-active {
    border-color: var(--btn-primary);
    color: var(--btn-primary);
}

.step.is-active .num,
.step.is-done .num {
    background: var(--btn-primary);
}

.steps .sep {
    color: #9AA4B2;
}

[dir="rtl"] .steps .sep {
    transform: scaleX(-1);
}

/* ---------- Card ---------- */
.contact-card {
    max-width: 760px;
    margin-inline: auto;
    padding: clamp(20px, 3vw, 32px);
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface);
}

.contact-card h2 {
    margin-bottom: 6px;
    color: var(--text);
    font-size: 18px;
    font-weight: 700;
}

.contact-card .hint {
    margin-bottom: 22px;
    color: var(--text-muted);
    font-size: 14px;
}

.step-panel[hidden] {
    display: none;
}

/* ---------- Step 1: inquiry type ---------- */
.choice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 14px;
}

.choice {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s, box-shadow 0.2s;
}

.choice:hover {
    border-color: var(--btn-primary);
}

.choice input {
    /* Sits on the reading-end side, matching the design */
    order: 2;
    margin-inline-start: auto;
    margin-block-start: 2px;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    accent-color: var(--btn-primary);
    cursor: pointer;
}

.choice .choice-text {
    order: 1;
}

.choice h3 {
    margin-bottom: 4px;
    color: var(--text);
    font-size: 15px;
    font-weight: 600;
}

.choice p {
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.6;
}

.choice:has(input:checked) {
    border-color: var(--btn-primary);
    background: var(--accent-soft);
}

/* Fallback for browsers without :has() — JS mirrors the state */
.choice.is-selected {
    border-color: var(--btn-primary);
    background: var(--accent-soft);
}

.choice:focus-within {
    box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ---------- Step 2: fields ---------- */
.field {
    margin-bottom: 16px;
}

.field label {
    display: block;
    margin-bottom: 6px;
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
}

.field input,
.field textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-size: 15px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.field input::placeholder,
.field textarea::placeholder {
    color: #9AA4B2;
}

.field input:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--btn-primary);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.field textarea {
    min-height: 112px;
    resize: vertical;
}

/* ---------- Buttons ---------- */
.form-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 26px;
}

.form-actions.end {
    justify-content: flex-end;
}

.form-actions.split {
    justify-content: space-between;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 26px;
    border: 1px solid transparent;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
}

.btn-primary {
    background: var(--btn-primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--btn-primary-hover);
}

.btn-secondary {
    border-color: var(--border);
    background: var(--surface);
    color: var(--text);
}

.btn-secondary:hover {
    border-color: var(--primary);
    background: var(--primary-soft);
}

/* Arrow follows the reading direction */
[dir="rtl"] .btn .arrow {
    transform: scaleX(-1);
}

.form-error {
    margin-top: 14px;
    color: #B42318;
    font-size: 14px;
}

.form-error[hidden] {
    display: none;
}

/* =============================================================
   Responsive
   ============================================================= */
@media (max-width: 760px) {
    .contact-page::before,
    .contact-page::after {
        display: none;
    }

    .steps {
        gap: 8px;
    }

    .step {
        padding: 7px 14px;
        font-size: 13px;
    }

    .choice-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .form-actions {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .btn {
        width: 100%;
    }
}
