/**
 * Mobile OTP Frontend Styles
 * 
 * @author Hotmark e-Commerce
 */

/* Mobile OTP Container */
.mobile-otp-container {
    max-width: 450px;
    margin: 0 auto;
    padding: 20px;
}

/* Form Groups */
.mobile-input-group,
.otp-input-group {
    margin-bottom: 20px;
}

.otp-input-group {
    display: none;
}

/* Mobile Input */
#mobile {
    font-size: 16px;
    padding: 12px;
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

#mobile:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 5px rgba(76, 175, 80, 0.3);
}

.mobile-hint {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
    display: block;
}

/* OTP Display */
.mobile-display-wrapper {
    background: #f5f5f5;
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 15px;
}

.mobile-display {
    font-weight: bold;
    color: #333;
}

#mobile-otp-change {
    color: #2196F3;
    text-decoration: none;
    font-size: 14px;
    margin-left: 10px;
}

#mobile-otp-change:hover {
    text-decoration: underline;
}

/* OTP Input */
#otp_code {
    font-size: 24px;
    padding: 15px;
    width: 100%;
    border: 2px solid #ddd;
    border-radius: 4px;
    text-align: center;
    letter-spacing: 8px;
    font-weight: bold;
    box-sizing: border-box;
}

#otp_code:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 8px rgba(76, 175, 80, 0.3);
}

/* OTP Info */
.otp-info {
    text-align: center;
    margin: 15px 0;
    font-size: 14px;
    color: #666;
}

#otp-expiry-countdown {
    font-weight: bold;
    color: #FF5722;
}

/* Buttons */
.mobile-otp-btn {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    font-weight: bold;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

#mobile-otp-send,
#mobile-otp-verify {
    background-color: #4CAF50;
    color: white;
}

#mobile-otp-send:hover,
#mobile-otp-verify:hover {
    background-color: #45a049;
}

#mobile-otp-send:disabled,
#mobile-otp-verify:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.mobile-otp-btn.loading {
    position: relative;
    color: transparent;
}

.mobile-otp-btn.loading:after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid #f3f3f3;
    border-radius: 50%;
    border-top-color: #4CAF50;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Resend Link */
.otp-resend-wrapper {
    text-align: center;
    margin-top: 15px;
}

#mobile-otp-resend {
    color: #2196F3;
    text-decoration: none;
    font-size: 14px;
}

#mobile-otp-resend:hover:not(.disabled) {
    text-decoration: underline;
}

#mobile-otp-resend.disabled {
    color: #999;
    cursor: not-allowed;
    text-decoration: none;
}

/* Messages */
#mobile-otp-messages {
    margin: 15px 0;
}

#mobile-otp-messages .alert {
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 10px;
}

#mobile-otp-messages .alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

#mobile-otp-messages .alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

#mobile-otp-messages .alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

/* PDPA Consent */
.pdpa-consent-wrapper {
    margin: 15px 0;
    padding: 15px;
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

.pdpa-consent-wrapper label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    font-size: 14px;
    color: #333;
}

.pdpa-consent-wrapper input[type="checkbox"] {
    margin-right: 10px;
    margin-top: 2px;
    cursor: pointer;
}

/* Toggle Links */
.auth-toggle {
    text-align: center;
    margin: 20px 0;
    padding: 15px;
    background: #f5f5f5;
    border-radius: 4px;
}

.auth-toggle a {
    color: #2196F3;
    text-decoration: none;
    font-weight: bold;
}

.auth-toggle a:hover {
    text-decoration: underline;
}

/* Mobile Login Form */
.mobile-login-form {
    display: none;
}

/* Responsive */
@media (max-width: 480px) {
    .mobile-otp-container {
        padding: 15px;
    }
    
    #otp_code {
        font-size: 20px;
        padding: 12px;
        letter-spacing: 6px;
    }
    
    .mobile-otp-btn {
        padding: 10px;
        font-size: 14px;
    }
}

/* Admin Styles */
.mobileotp-admin-panel .panel {
    margin-bottom: 20px;
}

.mobileotp-test-section {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 4px;
    margin-top: 20px;
}

.mobileotp-test-section h4 {
    margin-top: 0;
    color: #333;
}

.mobileotp-logs-table {
    width: 100%;
    margin-top: 15px;
}

.mobileotp-logs-table th,
.mobileotp-logs-table td {
    padding: 8px;
    border: 1px solid #ddd;
}

.mobileotp-logs-table th {
    background: #f5f5f5;
    font-weight: bold;
}

.mobileotp-status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
}

.mobileotp-status-badge.pending {
    background: #fff3cd;
    color: #856404;
}

.mobileotp-status-badge.verified {
    background: #d4edda;
    color: #155724;
}

.mobileotp-status-badge.expired {
    background: #e2e3e5;
    color: #383d41;
}

.mobileotp-status-badge.failed {
    background: #f8d7da;
    color: #721c24;
}

.button.button-medium {
    padding-left: 7px;
    padding-right: 7px;
}