/* Base Reset */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body,
html {
    width: 100%;
    height: 100%;
    font-family: 'Poppins', sans-serif;
    background-color: transparent;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

#root {
    min-height: 100vh;
}

/* --- Latar Belakang Tetap --- */
.fixed-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    background: linear-gradient(168.78deg, #039DFC 6.97%, #5190FC 28.3%, #3B67C2 54.12%, #243E88 94.02%);
    overflow: hidden;
}

.bg-silhouette {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: bottom center;
    opacity: 0.5;
    z-index: 1;
    pointer-events: none;
}

.bg-cahaya {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: auto;
    object-fit: cover;
    mix-blend-mode: screen;
    z-index: 2;
    pointer-events: none;
}

/* --- Dekorasi Bintang --- */
.fixed-star {
    position: absolute;
    top: 140px;
    width: 71px;
    height: auto;
    z-index: 5;
}

.star-left {
    left: -25px;
    transform: translateY(-50%);
}

.star-right {
    right: -25px;
}

/* --- Container App (Mobile Responsive) --- */
.app-container {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    padding-top: 40px;
    padding-bottom: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 10;
}

/* --- Sticky Header Logo --- */
.top-sticky-header {
    top: 25px;
    z-index: 50;
    display: flex;
    justify-content: center;
    width: 100%;
}

.sticky-logo-img {
    height: 50px;
    width: auto;
    object-fit: contain;
}

/* --- Main Title Text --- */
.main-title-wrapper {
    margin-top: 20px;
    margin-bottom: 30px;
    display: flex;
    justify-content: center;
    width: 100%;
}

.main-title-img {
    width: 300px;
    height: auto;
}

/* --- Form Section --- */
.form-container {
    background-color: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 20px;
    width: 358px;
    height: auto;
    min-height: auto;
    padding: 85px 0 40px 0;
    position: relative;
    box-shadow: 0 10px 40px rgba(36, 62, 136, 0.15), inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

/* --- Paging Badge --- */
.paging-badge-wrapper {
    position: absolute;
    top: -11px;
    left: 50%;
    transform: translateX(-50%);
    width: 111.167px;
    height: 22.209px;
    background: linear-gradient(167.76deg, rgb(238, 195, 64) 6.81%, rgb(255, 250, 138) 23.92%, rgb(222, 172, 23) 39.43%, rgb(255, 255, 149) 52.12%);
    box-shadow: 0px 2.159px 2.159px rgba(0, 0, 0, 0.25);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 20;
}

.paging-badge p {
    font-family: 'Bebas Neue', sans-serif;
    color: #243e88;
    font-size: 17.269px;
    text-align: center;
    transform: skewX(-0.03deg) rotate(0.3deg);
    margin: 0;
    line-height: normal;
}

/* --- Title --- */
.form-title {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 15px;
    color: #FFFFFF;
    text-align: center;
    position: absolute;
    top: 35px;
    left: 50%;
    transform: translateX(-50%);
    width: 276px;
    text-shadow: 0px 1px 2px rgba(0, 0, 0, 0.2);
}

/* --- Form Groups --- */
#registrationForm {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.form-step {
    width: 100%;
}

.form-group {
    width: 100%;
    padding: 0 10px;
    margin-top: 30px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

/* --- Label Badge --- */
.label-badge {
    background: linear-gradient(90deg, #518dfc 0%, #243e88 52.38%, #518dfc 100%);
    box-shadow: 0px 2.735px 2.735px rgba(0, 0, 0, 0.25);
    min-width: 126px;
    height: 32px;
    padding: 0 12px 0 10px;
    display: flex;
    align-items: center;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 24px;
    color: #FFFFFF;
    text-transform: uppercase;
    z-index: 2;
    position: relative;
    margin-bottom: 0px;
}

/* --- Input Wrapper --- */
.input-wrapper {
    width: 100%;
    height: 48px;
    background: #FFFFFF;
    box-shadow: 0px 2.735px 2.735px rgba(0, 0, 0, 0.25);
    position: relative;
    z-index: 1;
}

.form-input {
    width: 100%;
    height: 100%;
    border: none;
    background: transparent;
    padding: 0 15px;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    font-size: 15px;
    color: #333333;
    outline: none;
    position: relative;
    z-index: 2;
}

/* For select */
.select-wrapper {
    overflow: hidden;
}

select.form-input {
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    background: transparent;
}

/* --- Placeholder System --- */
.custom-placeholder {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    font-size: 14px;
    color: #a3a3a3;
    z-index: 1;
    transition: opacity 0.2s ease;
    width: calc(100% - 26px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.required-asterisk {
    color: #ff2323;
}

/* Hide placeholder when focused or filled */
.form-input:focus ~ .custom-placeholder,
.form-input:valid ~ .custom-placeholder,
select.form-input[data-selected="true"] ~ .custom-placeholder,
select.form-input.has-value ~ .custom-placeholder,
textarea.form-input.has-value ~ .custom-placeholder {
    opacity: 0;
}

/* --- Dropdown Arrow Override --- */
.dropdown-icon {
    position: absolute;
    right: 0;
    top: 0;
    width: 48px;
    height: 48px;
    background: #FFA000;
    pointer-events: none;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 3;
}

.dropdown-icon::after {
    content: '';
    width: 0;
    height: 0;
    border-left: 9px solid transparent;
    border-right: 9px solid transparent;
    border-top: 12px solid #FFFFFF;
}

/* Active interaction effects */
.input-wrapper:focus-within {
    box-shadow: 0px 4px 8px rgba(36, 62, 136, 0.4);
    transform: translateY(-1px);
    transition: all 0.2s;
}

/* --- Buttons & Navigation --- */
.step-nav-wrapper {
    margin-top: 35px;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 10px;
}
.step-nav-wrapper.flex-end {
    justify-content: flex-end;
}

.btn-next {
    background: transparent;
    border-radius: 49px;
    box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25);
    width: 103px;
    height: 34px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    z-index: 2;
}

.btn-next::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #FFC300 0%, #FF9D00 100%);
    z-index: -1;
}

.btn-next:hover {
    transform: translateY(-2px);
    box-shadow: 0px 6px 8px rgba(0, 0, 0, 0.3);
}

.btn-next-text {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 16px;
    color: #FFFFFF;
    line-height: 1;
}

/* --- Multiline Label Badge --- */
.label-badge.label-badge-multiline {
    white-space: normal;
    text-align: left;
    display: flex;
    align-items: center;
    padding: 5px 12px;
}

/* --- Radio Group --- */
.radio-wrapper {
    height: auto;
    min-height: 48px;
    padding: 10px 15px;
    display: flex;
    flex-direction: column;
}
.radio-header {
    font-family: 'Poppins', sans-serif;
    font-size: 12px;
    color: #bdbdbd;
    font-weight: 700;
}
.radio-options {
    display: flex;
    justify-content: center;
    gap: 40px;
    padding-top: 20px;
    padding-bottom: 5px;
}
.radio-option {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}
.d-none {
    display: none;
}
.custom-radio {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background-color: #d9d9d9;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}
input[type="radio"]:checked + .custom-radio {
    background-color: #3b67c2;
    border: 2px solid white;
}
input[type="checkbox"]:checked + .custom-checkout {
    background-color: #3b67c2;
    border: 2px solid white !important;
}
.radio-label {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 16px;
    background: linear-gradient(174deg, #243e88 39.47%, #5190fc 82.34%, #03f4fc 123.98%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* --- Textarea --- */
.textarea-wrapper {
    height: 104px;
    padding-top: 10px;
}
textarea.form-input {
    resize: none;
    height: 100%;
    width: 100%;
}
.textarea-wrapper .custom-placeholder {
    top: 13px;
    transform: none;
    align-items: flex-start;
}

/* --- Multi-step Navigation --- */
.step-nav {
    width: 100%;
    margin-top: 35px;
}
.btn-prev {
    flex-direction: row;
    padding: 0 15px;
}

.btn-next-icon {
    width: 23px;
    height: 13px;
    object-fit: contain;
}

/* --- Footer --- */
.app-footer {
    width: 100%;
    margin-top: 40px;
    padding: 0 20px;
    text-align: center;
    position: relative;
    z-index: 10;
}

.app-footer p {
    font-family: 'Poppins', sans-serif;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.5;
    font-weight: 400;
}

/* Responsive adjust if the screen is super small */
@media screen and (max-width: 360px) {
    .form-container {
        width: 95%;
    }

    .main-title-img {
        width: 90%;
    }

    .sticky-logo-img {
        height: 50px;
    }
}

/* ===================================================
   CUSTOM DROPDOWN ENGINE
   =================================================== */
.dropdown-container {
    width: 100%;
    position: relative;
}

.custom-select-wrapper {
    cursor: pointer;
    overflow: visible !important;
    position: relative;
}

.custom-dd-display {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: #a3a3a3;
    z-index: 2;
    right: 58px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
    display: flex;
    align-items: center;
}

.custom-dd-display.has-value {
    color: #333333;
    font-size: 15px;
}

.custom-dd-value {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.custom-dd-panel {
    position: absolute;
    top: 48px;
    left: 0;
    right: 0;
    background: #FFFFFF;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    border-radius: 0 0 10px 10px;
    z-index: 500;
    max-height: 220px;
    overflow-y: auto;
    display: none;
    border-top: 2px solid #e8f0fe;
}

.custom-dd-panel.open {
    display: block;
}

/* Scrollbar custom */
.custom-dd-panel::-webkit-scrollbar { width: 5px; }
.custom-dd-panel::-webkit-scrollbar-track { background: #f1f1f1; }
.custom-dd-panel::-webkit-scrollbar-thumb { background: #3b67c2; border-radius: 3px; }

.custom-dd-item {
    padding: 11px 15px;
    font-family: 'Poppins', sans-serif;
    font-size: 13.5px;
    font-weight: 500;
    color: #333333;
    cursor: pointer;
    transition: background-color 0.12s;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.custom-dd-item:hover {
    background-color: #e8f0fe;
    color: #1a3a8c;
}

.custom-dd-item.selected {
    background-color: #dce8ff;
    color: #1a3a8c;
    font-weight: 700;
}

.custom-dd-item.dd-disabled {
    color: #aaa;
    pointer-events: none;
    font-style: italic;
    font-size: 12px;
    padding: 8px 15px;
}

/* ===================================================
   VALIDATION ERROR STYLES
   =================================================== */
.input-wrapper.field-invalid,
.custom-select-wrapper.field-invalid {
    box-shadow: 0 0 0 2px #ff2323, 0px 2.735px 2.735px rgba(255, 0, 0, 0.15) !important;
    animation: shake 0.3s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

.field-error-msg {
    display: none;
    color: #ff2323;
    font-family: 'Poppins', sans-serif;
    font-size: 11px;
    font-weight: 600;
    margin-top: 4px;
    padding-left: 4px;
}

.field-error-msg.visible {
    display: block;
}

/* ===================================================
   RESPONSIVE LAYOUT FOR LAPTOP/DESKTOP
   =================================================== */
@media screen and (min-width: 768px) {
    /* Perlebar container utama */
    .app-container {
        max-width: 800px;
    }

    /* Perlebar form */
    .form-container {
        width: 650px;
        padding: 95px 40px 50px 40px;
    }

    /* Perbesar judul header agar proporsional */
    .main-title-img {
        width: 500px;
    }

    /* Perbesar elemen dekorasi bintang */
    .fixed-star {
        width: 150px;
        top: 25%;
    }

    /* Sesuaikan posisi bintang kiri dan kanan di laptop */
    .star-left {
        left: 20px;
    }

    .star-right {
        right: 20px;
    }
}
