/**
 * KS Contact & FAQ — Frontend CSS
 *
 * All styling uses CSS custom properties (--kscf-*) set inline by shortcode.
 *
 * @package KS_Contact_FAQ
 */

/* ── Wrapper ── */
.kscf-wrapper {
    max-width: var(--kscf-max-width, 1280px);
    margin: 0 auto;
    width: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    line-height: 1.6;
    box-sizing: border-box;
}
.kscf-wrapper *, .kscf-wrapper *::before, .kscf-wrapper *::after {
    box-sizing: border-box;
}

/* ── COLUMNS LAYOUT ── */
.kscf-layout-columns {
    display: flex;
    gap: var(--kscf-gap, 28px);
    align-items: flex-start;
}
.kscf-layout-columns > .kscf-contact-box {
    flex: 0 0 var(--kscf-contact-ratio, 55%);
    max-width: var(--kscf-contact-ratio, 55%);
}
.kscf-layout-columns > .kscf-faq-box {
    flex: 1 1 auto;
    max-width: calc(100% - var(--kscf-contact-ratio, 55%) - var(--kscf-gap, 28px));
    overflow: hidden;
}

/* ── STACKED LAYOUT ── */
.kscf-layout-stacked {
    display: flex;
    flex-direction: column;
    gap: var(--kscf-gap, 28px);
}
.kscf-layout-stacked > .kscf-contact-box,
.kscf-layout-stacked > .kscf-faq-box {
    width: 100%;
}

/* ── BOX BASE ── */
.kscf-contact-box {
    background: var(--kscf-contact-bg, #ffffff);
    border-radius: var(--kscf-box-radius, 14px);
    border: var(--kscf-contact-border, 1px solid #e2e8f0);
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 16px rgba(0,0,0,0.06);
    padding: var(--kscf-contact-padding, 36px);
}
.kscf-faq-box {
    background: var(--kscf-faq-bg, #f0f5fa);
    border-radius: var(--kscf-box-radius, 14px);
    border: var(--kscf-faq-border, 1px solid #e2e8f0);
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 16px rgba(0,0,0,0.06);
    padding: var(--kscf-faq-padding, 36px);
    display: flex;
    flex-direction: column;
}

/* ── HEADINGS ── */
.kscf-box-heading {
    font-size: var(--kscf-heading-size, 22px);
    font-weight: 700;
    color: var(--kscf-heading-color, #1a2b42);
    letter-spacing: -0.01em;
    margin: 0 0 6px 0;
    padding: 0;
    line-height: 1.3;
}
.kscf-box-subheading {
    font-size: 14px;
    color: var(--kscf-text-color, #475569);
    margin: 0 0 28px 0;
    padding: 0;
    line-height: 1.5;
}

/* ── FORM ── */
.kscf-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.kscf-field-row {
    display: flex;
    gap: 16px;
}
.kscf-field-row > .kscf-field-group {
    flex: 1;
}

.kscf-field-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.kscf-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--kscf-label-color, #334155);
}
.kscf-required {
    color: #dc2626;
    margin-left: 2px;
}

.kscf-input,
.kscf-select,
.kscf-textarea {
    font-family: inherit;
    font-size: 15px;
    color: var(--kscf-heading-color, #1a2b42);
    background: var(--kscf-input-bg, #f8fafc);
    border: 1px solid var(--kscf-input-border, #cbd5e1);
    border-radius: var(--kscf-input-radius, 8px);
    padding: 12px 14px;
    width: 100%;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}
.kscf-input::placeholder,
.kscf-textarea::placeholder {
    color: #94a3b8;
}
.kscf-input:focus,
.kscf-select:focus,
.kscf-textarea:focus {
    border-color: var(--kscf-input-focus-border, #3b6fad);
    box-shadow: 0 0 0 3px rgba(59, 111, 173, 0.1);
}
.kscf-textarea {
    resize: vertical;
    min-height: 120px;
}
.kscf-select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23475569' viewBox='0 0 16 16'%3E%3Cpath d='M8 11.5l-5-5h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

/* ── Checkbox / consent ── */
.kscf-checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.kscf-checkbox {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: var(--kscf-primary, #3b6fad);
    cursor: pointer;
    flex-shrink: 0;
}
.kscf-checkbox-label {
    font-size: 13px;
    color: var(--kscf-text-color, #475569);
    line-height: 1.5;
    cursor: pointer;
}
.kscf-checkbox-label a {
    color: var(--kscf-primary, #3b6fad);
    text-decoration: underline;
}

/* ── Submit ── */
.kscf-submit-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 4px;
}
.kscf-submit-btn {
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    color: var(--kscf-btn-text, #ffffff);
    background: var(--kscf-btn-bg, #3b6fad);
    border: none;
    border-radius: var(--kscf-btn-radius, 8px);
    padding: 14px 32px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
    letter-spacing: 0.01em;
}
.kscf-submit-btn:hover {
    background: var(--kscf-btn-hover, #2d5a91);
    box-shadow: 0 4px 12px rgba(59, 111, 173, 0.25);
}
.kscf-submit-btn:active {
    transform: scale(0.98);
}
.kscf-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.kscf-submit-status {
    font-size: 13px;
    font-weight: 500;
    display: none;
    align-items: center;
    gap: 6px;
}
.kscf-submit-status.kscf-success {
    display: inline-flex;
    color: #16a34a;
}
.kscf-submit-status.kscf-error {
    display: inline-flex;
    color: #dc2626;
}

/* ── Honeypot ── */
.kscf-hp-field {
    position: absolute;
    left: -9999px;
    opacity: 0;
    height: 0;
    width: 0;
    overflow: hidden;
}

/* ══════════════════════════════════════
   FAQ
   ══════════════════════════════════════ */
.kscf-faq-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1 1 auto;
}
.kscf-faq-item {
    background: var(--kscf-faq-item-bg, #ffffff);
    border: var(--kscf-faq-item-border, 1px solid #e2e8f0);
    border-radius: 10px;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.kscf-faq-item.kscf-active {
    border: var(--kscf-faq-active-border, 1px solid #3b6fad);
    box-shadow: 0 2px 8px rgba(59, 111, 173, 0.08);
}

.kscf-faq-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    cursor: pointer;
    user-select: none;
    font-size: 15px;
    font-weight: 600;
    color: var(--kscf-heading-color, #1a2b42);
    transition: background 0.15s;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}
.kscf-faq-question:hover {
    background: rgba(59, 111, 173, 0.03);
}

.kscf-faq-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--kscf-faq-bg, #f0f5fa);
    transition: transform 0.3s, background 0.2s;
}
.kscf-faq-icon svg {
    width: 12px;
    height: 12px;
    stroke: var(--kscf-primary, #3b6fad);
    stroke-width: 2.5;
    fill: none;
}
.kscf-active .kscf-faq-icon {
    transform: rotate(180deg);
    background: var(--kscf-primary, #3b6fad);
}
.kscf-active .kscf-faq-icon svg {
    stroke: #fff;
}

.kscf-faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
}
.kscf-faq-answer-inner {
    padding: 0 18px 16px;
    font-size: 14px;
    color: var(--kscf-text-color, #475569);
    line-height: 1.65;
}

/* ── Hidden FAQ items ── */
.kscf-faq-item.kscf-hidden {
    display: none;
}

/* ── See more ── */
.kscf-see-more-wrapper {
    margin-top: 16px;
    text-align: center;
    flex-shrink: 0;
}
.kscf-see-more-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--kscf-primary, #3b6fad);
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 8px;
    background: rgba(59, 111, 173, 0.06);
    transition: background 0.2s, color 0.2s;
    cursor: pointer;
    border: none;
    font-family: inherit;
}
.kscf-see-more-link:hover {
    background: rgba(59, 111, 173, 0.12);
}
.kscf-see-more-link svg {
    width: 14px;
    height: 14px;
}

/* ══════════════════════════════════════
   HEIGHT MATCHING (columns mode)
   JS adds max-height to .kscf-faq-box
   ══════════════════════════════════════ */

/* ══════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════ */
@media (max-width: 768px) {
    .kscf-layout-columns {
        flex-direction: column;
    }
    .kscf-layout-columns > .kscf-contact-box,
    .kscf-layout-columns > .kscf-faq-box {
        flex: none;
        max-width: 100%;
    }
    .kscf-field-row {
        flex-direction: column;
    }
    .kscf-contact-box,
    .kscf-faq-box {
        padding: 24px 20px;
    }
}
