/* Error Message Styling */
.error {
    color: red;
    margin-top: 10px;
    display: none;
}

/* OTP Container */
.otp-container {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 15px; /* Add spacing below OTP inputs */
}

@media (max-width: 420px) {
    #otp-text {
        font-size: 110% !important;
    }
    .otp-container {
        gap: 4px;
    }
}
/* OTP Input Fields */
.otp-input {
    width: 50px;
    height: 55px;
    text-align: center;
    font-size: 22px;
    font-weight: bold;
    border: 2px solid #ddd;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
    background: #fffcf5; /* Match the popup background */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    direction: ltr; /* Ensure numbers are left-to-right */
}

.otp-input:focus {
    border-color: rgba(110, 85, 73, 0.73);
    box-shadow: 0 0 8px rgba(110, 85, 73, 0.5);
}

/* Placeholder Styling */
.otp-popup input::placeholder {
    text-align: right;
    direction: rtl;
}

/* OTP Popup */
#otp-popup {
    display: none;
    position: fixed;
    bottom: -40%; /* Start from below the screen */
    left: 50%;
    transform: translate(-50%, 0);
    width: 90%;
    max-width: 400px;
    max-height: 86vh;
    padding: 20px;
    background: #fffcf5;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    z-index: 1000;
    transition: bottom 0.8s ease-in-out,
                height 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                max-width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

#otp-popup.show {
    bottom: 40%; /* Adjusted visibility */
}

/* Popup morphed into the payment step.
   bottom and height must share duration/easing so the top edge moves
   in one smooth motion instead of overshooting and settling back. */
#otp-popup.expanded {
    max-width: 460px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transition: bottom 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                height 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                max-width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Steps inside the popup cross-fade during the morph */
.popup-step {
    transition: opacity 0.3s ease;
}

.popup-step.step-hidden {
    opacity: 0;
}

#otp-popup h2 {
    font-size: 18px;
    margin-bottom: 15px;
}

/* OTP Input Fields */
.otp-input {
    width: 50px;
    height: 55px;
    text-align: center;
    font-size: 22px;
    font-weight: bold;
    border: 2px solid #ddd;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
    background: #fffcf5; /* Match the popup background */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    direction: ltr; /* Ensure numbers are left-to-right */
}

.otp-input:focus {
    border-color: rgba(110, 85, 73, 0.73);
    box-shadow: 0 0 8px rgba(110, 85, 73, 0.5);
}

/* Button Styling */
#otp-popup button,
.transfer-section button {
    width: 100%;
    padding: 10px;
    background: rgba(110, 85, 73, 0.73);
    border: none;
    color: #fff;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.4s ease-in-out, opacity 0.4s;
}

#otp-popup button:hover,
.transfer-section button:hover {
    background: #6e5549;
    opacity: 0.9;
}

/* OTP Overlay */
#otp-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

/* OTP Timer */
#otp-timer.clickable {
    cursor: pointer;
    color: black;
}

/* Transfer Section (payment step inside #otp-popup) */
.transfer-section {
    display: none;
    direction: rtl;
}

/* Input Fields in Transfer Section */
.transfer-section h2,
.transfer-section p {
    width: 100%;
    margin-bottom: 10px;
}

/* Slide-in Animation */
.slide-in-up {
    opacity: 0;
    transform: translateY(100%);
    animation: slideInUp 1.2s forwards;
}

@keyframes slideInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
