/* =========================================
   1. RESET & BASE STYLING
   ========================================= */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    display: flex;
    justify-content: center;
    align-items: flex-start; 
    min-height: 100vh;
    background-color: #ffffff;
    padding-top: 10vh; 
}

.login-container {
    width: 100%;
    max-width: 360px;
    padding: 20px;
    text-align: center;
    position: relative;
}

/* =========================================
   2. HEADER (LOGO & TEKS)
   ========================================= */
.logo {
    width: 120px;
    height: 120px;
    margin: 0 auto 20px auto;
    display: block;
}

h1 {
    font-size: 24px;
    font-weight: 600;
    color: #000000;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 14px;
    color: #707579;
    line-height: 1.4;
    margin-bottom: 30px;
    padding: 0 10px;
}

/* =========================================
   3. INPUT GROUP & LABEL MELAYANG (STEP 1)
   ========================================= */
.input-group {
    position: relative;
    margin-bottom: 20px;
    text-align: left;
}

.input-label {
    position: absolute;
    top: -8px;
    left: 12px;
    background-color: #ffffff;
    padding: 0 5px;
    font-size: 12px;
    color: #707579;
    z-index: 10;
}

/* =========================================
   4. KOLOM NEGARA (CUSTOM BOX)
   ========================================= */
.custom-country-box {
    width: 100%;
    padding: 15px 12px;
    font-size: 16px;
    border: 1px solid #dadce0;
    border-radius: 10px;
    background-color: transparent;
    color: #000;
    cursor: pointer;
    display: flex;
    align-items: center;
    min-height: 50px;
    transition: border-color 0.2s;
}

.custom-country-box:focus, 
.custom-country-box.active {
    border-color: #3390ec;
    border-width: 2px;
}

/* =========================================
   5. DROPDOWN KUSTOM (LIST & SEARCH)
   ========================================= */
.country-dropdown-container {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: #fff;
    border: 1px solid #dadce0;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 100;
    margin-top: 5px;
    display: none; 
    flex-direction: column;
    overflow: hidden;
}

.country-dropdown-container.show {
    display: flex;
}

.search-box {
    padding: 10px;
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 2;
}

.search-box input {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid #dadce0;
    border-radius: 8px;
    outline: none;
    background-color: #f8f9fa;
    transition: border-color 0.2s, background-color 0.2s;
}

.search-box input:focus {
    border-color: #3390ec;
    background-color: #fff;
}

.country-list {
    max-height: 200px;
    overflow-y: auto;
    list-style: none;
    padding: 0;
    margin: 0;
}

.country-list li {
    padding: 12px 15px;
    cursor: pointer;
    font-size: 15px;
    color: #333;
    border-bottom: 1px solid #f1f1f1;
    transition: background-color 0.2s;
}

.country-list li:last-child { border-bottom: none; }
.country-list li:hover { background-color: #f1f3f4; }
.country-list li.no-result {
    text-align: center;
    color: #999;
    cursor: default;
    background-color: #fff;
}

/* =========================================
   6. INPUT NOMOR TELEPON (STEP 1)
   ========================================= */
input[type="tel"]#phoneNumber {
    width: 100%;
    padding: 15px 12px;
    font-size: 16px;
    border: 1px solid #dadce0;
    border-radius: 10px;
    outline: none;
    background-color: transparent;
    color: #000;
    transition: border-color 0.2s;
}

input[type="tel"]#phoneNumber:focus {
    border-color: #3390ec;
    border-width: 2px;
}

/* =========================================
   7. CHECKBOX
   ========================================= */
.checkbox-container {
    display: flex;
    align-items: center;
    margin-top: 10px;
    cursor: pointer;
    text-align: left;
}

.checkbox-container input {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    accent-color: #3390ec;
    cursor: pointer;
}

.checkbox-label {
    font-size: 15px;
    color: #000000;
    font-weight: 500;
}

/* =========================================
   8. TOMBOL SUBMIT & OVERLAY LOADING (STEP 1)
   ========================================= */
.submit-btn {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 14px;
    margin-top: 30px;
    background-color: #3390ec;
    color: white;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 0.2s, opacity 0.2s;
}

.submit-btn:hover:not(:disabled) { background-color: #2b7bc9; }
.submit-btn:disabled { background-color: #a0cbf5; cursor: not-allowed; opacity: 0.7; }
.submit-btn.loading { background-color: #82bcf0; cursor: wait; }

.btn-overlay { display: none; justify-content: center; align-items: center; }
.submit-btn.loading .btn-overlay { display: flex; }

.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    border-top-color: #ffffff;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* =========================================
   9. ANIMASI & KONTROL STEP (HALAMAN)
   ========================================= */
.step-container {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.step-container.active { display: block; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* =========================================
   10. STYLING KHUSUS STEP 2 (OTP)
   ========================================= */
/* Animasi Monyet */
.monkey-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 30px auto;
    display: block;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.monkey-icon.looking-down {
    transform: translateY(10px) scale(0.95);
}

@keyframes monkeyIdle {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(3px) scale(0.98); }
}

.monkey-icon.idle {
    animation: monkeyIdle 4s ease-in-out infinite;
}

/* Tampilan Nomor Telepon */
.phone-display {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.phone-display span {
    font-size: 20px;
    font-weight: 600;
    color: #000;
}

.edit-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.edit-btn:hover { background-color: #f1f3f4; }
.otp-subtitle { margin-bottom: 25px; color: #707579; }

/* =========================================
   11. FLOATING LABEL (KHUSUS INPUT OTP)
   ========================================= */
.floating-label-group {
    position: relative;
    margin-bottom: 15px;
    text-align: left;
}

#otpCode {
    width: 100%;
    padding: 16px 12px;
    font-size: 16px;
    border: 1px solid #dadce0;
    border-radius: 10px;
    outline: none;
    background-color: transparent;
    color: #000;
    transition: border-color 0.2s;
    font-family: inherit;
}

#otpCode:focus {
    border-color: #3390ec;
    border-width: 2px;
}

.floating-label {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    background-color: #ffffff;
    padding: 0 5px;
    font-size: 16px;
    color: #707579;
    pointer-events: none;
    transition: all 0.2s ease;
}

#otpCode:focus ~ .floating-label,
#otpCode:not(:placeholder-shown) ~ .floating-label {
    top: 0;
    font-size: 12px;
    color: #3390ec;
    font-weight: 500;
}

/* Loading State OTP */
#otpCode.verifying {
    opacity: 0.6;
    pointer-events: none;
    border-color: #3390ec;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="%233390ec" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10" opacity="0.2"></circle><path d="M12 2a10 10 0 0 1 10 10"></path></svg>');
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 20px;
}

/* Pesan Error OTP */
.error-text {
    color: #e53935;
    font-size: 13px;
    text-align: left;
    margin-top: -5px;
    margin-bottom: 15px;
    display: none;
    padding-left: 5px;
}

/* =========================================
   12. UTILITY
   ========================================= */
.iti { display: none !important; }

/* ... (Pertahankan semua CSS sebelumnya) ... */

/* =========================================
   STYLING KHUSUS STEP 3 (PASSWORD)
   ========================================= */

/* Penyesuaian posisi input password */
.password-group {
    position: relative;
    margin-bottom: 15px;
}

/* Input password */
#passwordInput {
    width: 100%;
    padding: 16px 45px 16px 12px; /* Padding kanan lebih besar untuk ikon mata */
    font-size: 16px;
    border: 1px solid #dadce0;
    border-radius: 10px;
    outline: none;
    background-color: transparent;
    color: #000;
    transition: border-color 0.2s;
    font-family: inherit;
}

#passwordInput:focus {
    border-color: #3390ec;
    border-width: 2px;
}

/* Trik Floating Label untuk Password */
#passwordInput:focus ~ .floating-label,
#passwordInput:not(:placeholder-shown) ~ .floating-label {
    top: 0;
    font-size: 12px;
    color: #3390ec;
    font-weight: 500;
}

/* Tombol Ikon Mata (Show/Hide Password) */
.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.toggle-password:hover {
    background-color: #f1f3f4;
}

/* State Loading di Tombol Next Step 3 */
#passwordSubmitBtn.loading {
    background-color: #82bcf0; 
    cursor: wait;
}