/* Modal Backdrop Overlay */
.dapt-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.dapt-modal-overlay.dapt-modal-open {
    opacity: 1;
    visibility: visible;
}

/* Modal Content Box */
.dapt-modal-container {
    background: #ffffff;
    width: 90%;
    max-width: 420px;
    border-radius: 16px;
    padding: 30px 24px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.dapt-modal-open .dapt-modal-container {
    transform: translateY(0);
}

/* Close Button */
.dapt-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 28px;
    color: #888;
    cursor: pointer;
}

/* Typography & Headings */
.dapt-modal-header h2 {
    font-size: 22px;
    margin: 0 0 8px 0;
    color: #222;
    text-align: center;
}

.dapt-modal-header p {
    font-size: 14px;
    color: #666;
    text-align: center;
    margin-bottom: 24px;
}

/* Form Visibility Toggle */
.dapt-form-step {
    display: none;
}

.dapt-form-step.active {
    display: block;
}

/* Inputs & Form Groups */
.dapt-input-group {
    display: flex;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
    transition: border-color 0.2s;
}

.dapt-input-group:focus-within {
    border-color: #ff6b00; /* KhaoChatpata Accent */
}

.dapt-country-prefix {
    background: #f4f4f4;
    padding: 12px 14px;
    font-size: 15px;
    font-weight: 600;
    color: #444;
    border-right: 1px solid #ddd;
}

.dapt-input-group input {
    border: none !important;
    outline: none !important;
    padding: 12px;
    width: 100%;
    font-size: 16px;
    box-shadow: none !important;
}

/* 6-Digit OTP Box Grid */
.dapt-otp-inputs {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 20px;
}

.dapt-otp-box {
    width: 48px;
    height: 52px;
    text-align: center;
    font-size: 20px;
    font-weight: bold;
    border: 1.5px solid #ccc;
    border-radius: 8px;
    outline: none;
}

.dapt-otp-box:focus {
    border-color: #ff6b00;
    box-shadow: 0 0 0 2px rgba(255, 107, 0, 0.2);
}

/* Action Buttons */
.dapt-btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.dapt-btn-primary {
    background: #ff6b00;
    color: #ffffff;
}

.dapt-btn-primary:hover {
    background: #e05e00;
}

.dapt-btn-link {
    background: none;
    border: none;
    color: #0073aa;
    font-size: 13px;
    cursor: pointer;
    text-decoration: underline;
    display: block;
    margin: 0 auto;
}

.dapt-mt-10 { margin-top: 10px; }

/* Feedback Messages */
.dapt-feedback-msg {
    margin-top: 15px;
    font-size: 13px;
    text-align: center;
}

.dapt-feedback-msg.error { color: #d9534f; }
.dapt-feedback-msg.success { color: #5cb85c; }

/* Loading Spinner */
.dapt-spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: dapt-spin 0.8s linear infinite;
    margin-left: 10px;
}

.dapt-btn.loading .dapt-spinner { display: inline-block; }
.dapt-btn.loading span { opacity: 0.7; }

@keyframes dapt-spin {
    to { transform: rotate(360deg); }
}

/* Responsive Overrides */
@media (max-width: 480px) {
    .dapt-modal-container {
        padding: 24px 18px;
    }
    .dapt-otp-box {
        width: 40px;
        height: 46px;
        font-size: 18px;
    }
}