/**
 * Fluentkidz Lead Engine - Stylesheet
 * 
 * Desain presisi sesuai UI Fluentkidz Trial Class (Rounded Card 24px, Orange CTA, Segmented Buttons, Clean Trust Badge).
 * 
 * @package FluentkidzLeadEngine
 */

/* 1. Reset & Container Scoping */
.fk-form-scope,
.fk-form-scope *,
.fk-form-scope *::before,
.fk-form-scope *::after,
.fk-modal-root,
.fk-modal-root * {
    box-sizing: border-box;
    font-family: var(--fk-font-family);
    -webkit-font-smoothing: antialiased;
}

/* 2. Standalone Form Card (Bisa 1 Kolom atau di Kolom Kanan 2 Kolom) */
.fk-pure-form-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 8px 0;
}

.fk-form-card {
    width: 100%;
    max-width: 470px;
    margin: 0 auto;
    background: var(--fk-card-bg);
    border: 1px solid var(--fk-card-border);
    border-radius: var(--fk-card-radius);
    box-shadow: var(--fk-card-shadow);
    padding: var(--fk-card-padding);
    position: relative;
    box-sizing: border-box;
}

/* 3. Header Formulir (Logo, Judul & Subjudul) */
.fk-form-header {
    text-align: center;
    margin-bottom: 20px;
}

.fk-form-logo-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 12px;
}

.fk-form-logo-img {
    max-width: 140px;
    max-height: 42px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

.fk-form-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--fk-text-title);
    letter-spacing: -0.02em;
    margin: 0 0 6px 0;
    line-height: 1.3;
}

.fk-form-subtitle {
    font-size: 13.5px;
    font-weight: 450;
    color: var(--fk-text-subtitle);
    line-height: 1.5;
    margin: 0;
}

/* 4. Input Groups & Labels */
.fk-input-group {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    text-align: left;
}

.fk-field-label {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--fk-text-label);
    margin-bottom: 6px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    line-height: 1.35;
}

.fk-mark-req {
    color: var(--fk-text-required);
    font-weight: 700;
}

/* 5. Form Controls (Input & Select) */
.fk-field-control {
    width: 100%;
    height: var(--fk-input-height);
    background-color: var(--fk-input-bg);
    border: 1.5px solid var(--fk-input-border);
    border-radius: var(--fk-input-radius);
    padding: 0 16px;
    font-size: 14px;
    color: var(--fk-input-text);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
    line-height: normal;
}

.fk-field-control::placeholder {
    color: var(--fk-input-placeholder);
    opacity: 1;
}

.fk-field-control:hover:not(:focus):not([disabled]) {
    border-color: var(--fk-input-border-hover);
}

.fk-field-control:focus {
    border-color: var(--fk-input-focus-border);
    box-shadow: 0 0 0 3.5px var(--fk-input-focus-ring);
    background-color: #FFFFFF;
}

select.fk-field-control {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 16px;
    padding-right: 42px;
}

/* 5b. CUSTOM STYLED DROPDOWN (Usia Anak) */
.fk-custom-select-wrapper {
    position: relative;
    width: 100%;
}

.fk-hidden-native-select {
    position: absolute !important;
    opacity: 0 !important;
    pointer-events: none !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    clip: rect(0, 0, 0, 0) !important;
}

.fk-form-scope .fk-custom-select-trigger,
.fk-modal-root .fk-custom-select-trigger,
.fk-custom-select-trigger {
    width: 100% !important;
    height: var(--fk-input-height) !important;
    background-color: #FFFFFF !important;
    background: #FFFFFF !important;
    border: 1.5px solid var(--fk-input-border) !important;
    border-radius: var(--fk-input-radius) !important;
    padding: 0 16px !important;
    font-size: 14px !important;
    color: var(--fk-input-text) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    cursor: pointer !important;
    outline: none !important;
    box-sizing: border-box !important;
    font-family: var(--fk-font-family) !important;
    box-shadow: none !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease !important;
    text-align: left !important;
}

.fk-form-scope .fk-custom-select-trigger:hover,
.fk-modal-root .fk-custom-select-trigger:hover,
.fk-custom-select-trigger:hover,
.fk-form-scope .fk-custom-select-trigger:focus,
.fk-modal-root .fk-custom-select-trigger:focus,
.fk-custom-select-trigger:focus {
    background-color: #FFFFFF !important;
    background: #FFFFFF !important;
    color: var(--fk-input-text) !important;
    border-color: var(--fk-input-border-hover) !important;
}

.fk-form-scope .fk-custom-select-wrapper.is-open .fk-custom-select-trigger,
.fk-modal-root .fk-custom-select-wrapper.is-open .fk-custom-select-trigger,
.fk-custom-select-wrapper.is-open .fk-custom-select-trigger {
    background-color: #FFFFFF !important;
    background: #FFFFFF !important;
    color: var(--fk-input-text) !important;
    border-color: var(--fk-input-focus-border) !important;
    box-shadow: 0 0 0 3.5px var(--fk-input-focus-ring) !important;
}

.fk-custom-select-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-right: 8px;
    color: var(--fk-input-text);
    font-weight: 500;
}

.fk-custom-select-label.fk-placeholder {
    color: var(--fk-input-placeholder);
    font-weight: 400;
}

.fk-custom-select-arrow {
    flex-shrink: 0;
    color: #475569;
    transition: transform 0.22s ease, color 0.2s ease;
}

.fk-custom-select-wrapper.is-open .fk-custom-select-arrow {
    transform: rotate(180deg);
    color: var(--fk-color-primary);
}

/* Dropdown Menu Container */
.fk-custom-select-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 9999;
    background: #FFFFFF;
    border: 1.5px solid #ECEEF5;
    border-radius: 14px;
    box-shadow: 0 16px 36px -4px rgba(123, 43, 190, 0.14), 0 6px 16px -2px rgba(15, 23, 42, 0.06);
    padding: 6px;
    max-height: 250px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.98);
    transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    scrollbar-width: thin;
    scrollbar-color: #E2E8F0 transparent;
}

.fk-custom-select-dropdown::-webkit-scrollbar {
    width: 5px;
}
.fk-custom-select-dropdown::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 10px;
}

.fk-custom-select-wrapper.is-open .fk-custom-select-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Dropdown Option Items */
.fk-custom-select-option {
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 500;
    color: #334155;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background-color 0.15s ease, color 0.15s ease;
    user-select: none;
}

.fk-custom-select-option:hover {
    background: #F4EBFC; /* Soft Fluentkidz Lavender */
    color: #7B2BBE; /* Fluentkidz Purple */
    font-weight: 600;
}

.fk-custom-select-option.is-selected {
    background: #F4EBFC;
    color: #7B2BBE;
    font-weight: 700;
}

.fk-option-check {
    opacity: 0;
    transform: scale(0.7);
    transition: opacity 0.15s ease, transform 0.15s ease;
    flex-shrink: 0;
    margin-left: 8px;
}

.fk-custom-select-option.is-selected .fk-option-check {
    opacity: 1;
    transform: scale(1);
}

/* 6. SEGMENTED RADIO BUTTONS (Sudah | Belum) */
.fk-btn-segmented-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    width: 100%;
}

.fk-btn-segment {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 8px 14px;
    background: var(--fk-btn-choice-bg);
    border: 1.5px solid var(--fk-btn-choice-border);
    border-radius: var(--fk-input-radius);
    color: var(--fk-btn-choice-color);
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    text-align: center;
}

.fk-btn-segment input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 0;
    height: 0;
    margin: 0;
}

.fk-btn-segment:hover {
    background: var(--fk-btn-choice-hover-bg);
    border-color: var(--fk-btn-choice-hover-border);
}

.fk-btn-segment.is-selected {
    background: var(--fk-btn-choice-active-bg);
    border-color: var(--fk-btn-choice-active-border);
    color: var(--fk-btn-choice-active-color);
    box-shadow: var(--fk-btn-choice-active-shadow);
}

/* 7. TOMBOL CTA SUBMIT (Vibrant Orange Fluentkidz) */
.fk-submit-wrap {
    margin-top: 18px;
    width: 100%;
}

.fk-submit-btn {
    width: 100%;
    height: 50px;
    padding: 0 24px;
    font-size: 15.5px;
    font-weight: 700;
    letter-spacing: 0.015em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    border-radius: 14px;
    background: var(--fk-color-cta);
    color: var(--fk-color-cta-text);
    box-shadow: 0 8px 22px var(--fk-color-cta-shadow);
    cursor: pointer;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
}

.fk-submit-btn:hover {
    background: var(--fk-color-cta-hover);
    box-shadow: 0 10px 26px rgba(255, 122, 0, 0.45);
}

.fk-submit-btn:active {
    background: var(--fk-color-cta-hover);
    box-shadow: 0 3px 10px var(--fk-color-cta-shadow);
}

.fk-submit-btn svg,
.fk-btn-icon-wa {
    width: 20px;
    height: 20px;
    fill: currentColor;
    flex-shrink: 0;
    margin-right: 2px;
}

.fk-submit-btn.is-submitting {
    opacity: 0.85;
    cursor: wait;
}

/* 8. TRUST BADGE BAWAH FORMULIR (Dihapus/Nonaktif) */
.fk-trust-badge {
    display: none !important;
}

/* 9. UNIVERSAL MODAL POPUP SYSTEM */
.fk-modal-root {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.22s ease, visibility 0.22s ease;
    overflow: hidden !important;
}

.fk-modal-root.is-active {
    opacity: 1;
    visibility: visible;
}

.fk-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.fk-modal-dialog {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 480px;
    margin: auto;
    overflow: hidden !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
    transform: scale(0.97) translateY(6px);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.fk-modal-root.is-active .fk-modal-dialog {
    transform: scale(1) translateY(0);
}

.fk-modal-card {
    background: var(--fk-card-bg);
    border: 1px solid var(--fk-card-border);
    border-radius: var(--fk-card-radius);
    box-shadow: 0 20px 45px -10px rgba(123, 43, 190, 0.25);
    padding: 30px 32px 28px 32px;
    position: relative;
    overflow: hidden !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}

/* Tutup Seluruh Scrollbar */
.fk-modal-dialog::-webkit-scrollbar,
.fk-modal-card::-webkit-scrollbar,
.fk-modal-root::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

/* Tombol Tutup (X Murni Saja - Tanpa Lingkaran - Hover Warna Saja) */
.fk-btn-close {
    position: absolute;
    top: 14px;
    right: 18px;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    font-size: 24px;
    font-weight: 300;
    line-height: 1;
    color: #94A3B8;
    cursor: pointer;
    transition: color 0.18s ease;
    z-index: 20;
    outline: none;
}

.fk-btn-close:hover {
    background: transparent !important;
    color: #0F172A;
    transform: none !important;
}

/* Responsivitas Mobile (< 520px) */
@media (max-width: 520px) {
    .fk-form-card,
    .fk-modal-card {
        padding: 24px 20px 22px 20px;
        border-radius: 20px;
    }

    .fk-form-title {
        font-size: 19px;
    }

    .fk-modal-dialog {
        max-height: 92vh;
        overflow-y: auto !important; /* Swipe touch pada layar sangat kecil */
    }
}
