/* ==========================================================================
   BulkSMS Pro - Frontend Styles
   ========================================================================== */

/* OTP Forms */
.bsms-otp-login-form,
.bsms-otp-verify-form {
    max-width: 420px;
    margin: 20px auto;
    padding: 30px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.bsms-otp-login-form h3,
.bsms-otp-verify-form h3 {
    text-align: center;
    margin-top: 0;
    margin-bottom: 25px;
    font-size: 22px;
    color: #333;
}

/* Form Groups */
.bsms-form-group {
    margin-bottom: 18px;
}

.bsms-form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 14px;
    color: #444;
}

/* Inputs */
.bsms-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    outline: none;
    box-sizing: border-box;
}

.bsms-input:focus {
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.bsms-otp-input {
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 8px;
    font-family: 'Courier New', monospace;
}

/* Buttons */
.bsms-btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    width: 100%;
    margin-top: 5px;
}

.bsms-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.bsms-btn-primary {
    background: #0073aa;
    color: #fff;
}

.bsms-btn-primary:hover:not(:disabled) {
    background: #005d8c;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 115, 170, 0.3);
}

.bsms-btn-secondary {
    background: #f0f0f0;
    color: #333;
    border: 2px solid #ddd;
}

.bsms-btn-secondary:hover:not(:disabled) {
    background: #e0e0e0;
}

.bsms-btn-link {
    background: none;
    color: #0073aa;
    padding: 8px;
    font-size: 13px;
    text-decoration: underline;
    width: auto;
}

.bsms-btn-link:hover {
    color: #005d8c;
}

/* Messages */
.bsms-message {
    margin-top: 15px;
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 14px;
    display: none;
}

.bsms-message.show {
    display: block;
}

.bsms-message.success {
    background: #e6f7e9;
    color: #1e7e34;
    border: 1px solid #c3e6cb;
}

.bsms-message.error {
    background: #fce4e4;
    color: #c62828;
    border: 1px solid #f5c6cb;
}

.bsms-message.info {
    background: #e3f2fd;
    color: #1565c0;
    border: 1px solid #b3d4fc;
}

/* Timer */
.bsms-timer {
    text-align: center;
    margin-top: 10px;
    font-size: 13px;
    color: #999;
}

.bsms-timer .bsms-countdown {
    font-weight: 700;
    color: #0073aa;
}

/* Success state */
.bsms-success {
    text-align: center;
    padding: 20px;
}

.bsms-success .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    color: #46b450;
    display: block;
    margin: 0 auto 10px;
}

.bsms-success p {
    font-size: 16px;
    color: #1e7e34;
    font-weight: 600;
}

/* Loading spinner */
.bsms-loading {
    position: relative;
    pointer-events: none;
}

.bsms-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: bsms-spin 0.6s linear infinite;
}

@keyframes bsms-spin {
    to { transform: rotate(360deg); }
}

/* Inline OTP */
.bsms-inline-otp {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.bsms-inline-otp .bsms-btn {
    width: auto;
    padding: 8px 16px;
    font-size: 13px;
}

.bsms-inline-result {
    font-size: 13px;
    font-weight: 600;
}

.bsms-inline-result.success { color: #46b450; }
.bsms-inline-result.error { color: #dc3232; }

/* WooCommerce Checkout OTP */
#bsms-checkout-otp-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    border: 1px solid #e0e0e0;
}

#bsms-checkout-otp-section h3 {
    margin-top: 0;
}

#bsms-checkout-otp-message {
    margin-top: 10px;
}

/* Registration OTP */
#bsms-reg-otp-message {
    margin: 5px 0;
    font-size: 13px;
}

/* Responsive */
@media screen and (max-width: 480px) {
    .bsms-otp-login-form,
    .bsms-otp-verify-form {
        padding: 20px;
        margin: 10px;
    }

    .bsms-otp-input {
        font-size: 20px;
        letter-spacing: 5px;
    }

    .bsms-inline-otp {
        flex-direction: column;
        align-items: stretch;
    }
}
