/* ==========================================================================
   Ear.lk SMS OTP Verification & Form Styling
   ========================================================================== */

.ear-phone-verify-group {
    position: relative;
    display: flex;
    align-items: center;
}

.ear-phone-verify-group input {
    flex: 1;
    padding-right: 110px !important;
}

.ear-otp-trigger-btn {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: #00A7F6;
    color: #ffffff;
    border: none;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.25s ease;
    z-index: 2;
    line-height: 1.2;
}

.ear-otp-trigger-btn:hover {
    background: #008cd1;
}

.ear-otp-trigger-btn.verified {
    background: #10b981 !important;
    color: #ffffff !important;
    cursor: default;
}

.ear-phone-status-msg {
    font-size: 12px;
    margin-top: 5px;
    display: none;
}

.ear-phone-status-msg.success {
    color: #10b981;
    display: block;
}

.ear-phone-status-msg.error {
    color: #ef4444;
    display: block;
}

/* ==========================================================================
   OTP Modal Popup
   ========================================================================== */

.ear-otp-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(4px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ear-otp-modal-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.ear-otp-modal-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 32px 28px;
    max-width: 440px;
    width: 90%;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    text-align: center;
    position: relative;
    transform: scale(0.92) translateY(20px);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ear-otp-modal-backdrop.active .ear-otp-modal-card {
    transform: scale(1) translateY(0);
}

.ear-otp-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    background: #f1f5f9;
    border: none;
    color: #64748b;
    font-size: 18px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.ear-otp-close-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.ear-otp-icon-bubble {
    width: 64px;
    height: 64px;
    background: #eff6ff;
    color: #00A7F6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin: 0 auto 16px auto;
    border: 2px solid #dbeafe;
}

.ear-otp-title {
    font-size: 22px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 8px;
}

.ear-otp-desc {
    font-size: 14px;
    color: #64748b;
    line-height: 1.5;
    margin-bottom: 20px;
}

.ear-otp-phone-display {
    font-weight: 700;
    color: #0c187d;
}

/* 6 OTP Input Boxes */
.ear-otp-inputs-grid {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 18px;
}

.ear-otp-digit {
    width: 48px;
    height: 54px;
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    border: 2px solid #cbd5e1;
    border-radius: 10px;
    outline: none;
    transition: all 0.2s;
    color: #0f172a;
    background: #f8fafc;
}

.ear-otp-digit:focus {
    border-color: #00A7F6;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(0, 167, 246, 0.15);
}

.ear-otp-timer-box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 13px;
    color: #64748b;
    margin-bottom: 20px;
}

.ear-otp-timer-badge {
    color: #ef4444;
    font-weight: 700;
    background: #fef2f2;
    padding: 2px 8px;
    border-radius: 12px;
}

.ear-otp-submit-btn {
    width: 100%;
    padding: 14px;
    background: #0c187d;
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.ear-otp-submit-btn:hover {
    background: #00A7F6;
}

.ear-otp-resend-row {
    margin-top: 16px;
    font-size: 13px;
    color: #64748b;
}

.ear-otp-resend-btn {
    background: none;
    border: none;
    color: #00A7F6;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
}

.ear-otp-resend-btn:disabled {
    color: #94a3b8;
    cursor: not-allowed;
    text-decoration: none;
}

.ear-otp-feedback {
    margin-top: 14px;
    font-size: 13px;
    padding: 8px 12px;
    border-radius: 8px;
    display: none;
}

.ear-otp-feedback.error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fee2e2;
    display: block;
}

.ear-otp-feedback.success {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #dcfce7;
    display: block;
}

.form-response-msg {
    margin-top: 15px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    display: none;
}

.form-response-msg.success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
    display: block;
}

.form-response-msg.error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
    display: block;
}
