/* ============================================================================
   WP-2FA-Email OTP Styles - Modern & Beautiful Design
   Version: 1.9.4
   ============================================================================ */

/* ============================================================================
   1. GLOBAL & RESET
   ============================================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body.otp-page {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: block;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* ============================================================================
   2. MAIN CONTAINER
   ============================================================================ */
.otp-form-container {
    width: 100%;
    max-width: 480px;
    animation: slideInUp 0.5s ease-out;
margin-left: 30%;
}

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

.otp-form {
    background: #ffffff;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

/* Decorative gradient overlay */
.otp-form::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #667eea, #764ba2, #f093fb, #667eea);
    background-size: 300% 100%;
    animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* ============================================================================
   3. HEADER
   ============================================================================ */
.otp-form h1 {
    font-size: 28px;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 10px;
    text-align: center;
    line-height: 1.3;
}

.otp-form h2 {
    font-size: 24px;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 20px;
    text-align: center;
}

/* ============================================================================
   4. IP INFO BOX
   ============================================================================ */
.ip-info-box {
    background: linear-gradient(135deg, #f0f7ff 0%, #e7f3ff 100%);
    border-left: 4px solid #3182ce;
    padding: 16px;
    border-radius: 12px;
    margin: 20px 0;
    font-size: 14px;
    line-height: 1.8;
    box-shadow: 0 4px 12px rgba(49, 130, 206, 0.1);
}

.ip-info-box strong {
    color: #2c5282;
    font-weight: 600;
}

.ip-type-badge {
    display: inline-block;
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(72, 187, 120, 0.3);
}

/* ============================================================================
   5. EMAIL NOTICE
   ============================================================================ */
.email-sent-notice {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border-left: 4px solid #28a745;
    padding: 16px;
    border-radius: 12px;
    margin: 20px 0;
    font-size: 15px;
    color: #155724;
    text-align: center;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.1);
}

.email-sent-notice strong {
    font-weight: 600;
    color: #0f4124;
}

/* ============================================================================
   6. COUNTDOWN TIMER
   ============================================================================ */
.countdown-timer {
    text-align: center;
    font-size: 15px;
    color: #4a5568;
    margin: 15px 0 10px 0;
    font-weight: 500;
}

#countdown-seconds {
    font-weight: 700;
    color: #667eea;
    font-size: 18px;
    display: inline-block;
    min-width: 30px;
    text-align: center;
}

/* ============================================================================
   7. PROGRESS BAR
   ============================================================================ */
.progress-bar-container {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    margin: 15px 0 25px 0;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-size: 200% 100%;
    border-radius: 10px;
    transition: width 1s linear;
    animation: progressShine 2s ease infinite;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
}

@keyframes progressShine {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ============================================================================
   8. RATE LIMIT WARNING
   ============================================================================ */
.rate-limit-warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffe8a1 100%);
    border-left: 4px solid #ffc107;
    padding: 14px;
    border-radius: 12px;
    margin: 15px 0;
    font-size: 14px;
    color: #856404;
    text-align: center;
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.15);
}

.rate-limit-warning strong {
    font-weight: 700;
    color: #6c4f00;
}

/* ============================================================================
   9. OTP INPUT FIELD
   ============================================================================ */
.otp-form input[type="text"],
.otp-form input[name="otp_input"] {
    width: 100%;
    padding: 18px 20px;
    font-size: 24px;
    font-weight: 600;
    text-align: center;
    border: 3px solid #e2e8f0;
    border-radius: 14px;
    margin: 20px 0;
    letter-spacing: 8px;
    font-family: 'Courier New', monospace;
    transition: all 0.3s ease;
    background: #f7fafc;
    color: #2d3748;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.otp-form input[type="text"]:focus,
.otp-form input[name="otp_input"]:focus {
    outline: none;
    border-color: #667eea;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1), 0 8px 20px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.otp-form input[type="text"]::placeholder,
.otp-form input[name="otp_input"]::placeholder {
    color: #a0aec0;
    letter-spacing: 2px;
    font-size: 18px;
}

/* ============================================================================
   10. TRUST DEVICE CHECKBOX
   ============================================================================ */
.trust-device-checkbox {
    background: #f7fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    margin: 20px 0;
    transition: all 0.3s ease;
}

.trust-device-checkbox:hover {
    background: #edf2f7;
    border-color: #cbd5e0;
}

.trust-device-checkbox label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 15px;
    color: #2d3748;
    font-weight: 500;
}

.trust-device-checkbox input[type="checkbox"] {
    width: 22px;
    height: 22px;
    margin-right: 12px;
    cursor: pointer;
    accent-color: #667eea;
    border-radius: 6px;
}

.trust-device-checkbox span {
    flex: 1;
}

.trust-device-info {
    margin-top: 10px;
    padding-left: 34px;
    font-size: 13px;
    color: #718096;
    line-height: 1.6;
}

/* ============================================================================
   11. SUBMIT BUTTON
   ============================================================================ */
.otp-form input[type="submit"],
.otp-form button[type="submit"] {
    width: 100%;
    padding: 18px;
    font-size: 17px;
    font-weight: 700;
    color: white;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}

.otp-form input[type="submit"]::before,
.otp-form button[type="submit"]::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.otp-form input[type="submit"]:hover,
.otp-form button[type="submit"]:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(102, 126, 234, 0.4);
}

.otp-form input[type="submit"]:hover::before,
.otp-form button[type="submit"]:hover::before {
    left: 100%;
}

.otp-form input[type="submit"]:active,
.otp-form button[type="submit"]:active {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

/* ============================================================================
   12. BACK TO HOME LINK
   ============================================================================ */
.back-to-home {
    display: block;
    text-align: center;
    margin-top: 25px;
    color: #667eea;
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.3s ease;
    padding: 12px;
    border-radius: 10px;
}

.back-to-home:hover {
    background: #f7fafc;
    color: #764ba2;
    transform: translateY(-2px);
}

.back-to-home::before {
    content: '← ';
    margin-right: 5px;
}

/* ============================================================================
   13. ERROR MESSAGES
   ============================================================================ */
.otp-error {
    background: linear-gradient(135deg, #fed7d7 0%, #feb2b2 100%);
    border-left: 4px solid #f56565;
    color: #742a2a;
    padding: 16px;
    border-radius: 12px;
    margin: 20px 0;
    font-size: 15px;
    font-weight: 500;
    text-align: center;
    box-shadow: 0 4px 12px rgba(245, 101, 101, 0.15);
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* ============================================================================
   14. LOCKOUT MESSAGE
   ============================================================================ */
.otp-lockout-message {
    background: #ffffff;
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.otp-lockout-message h2 {
    color: #e53e3e;
    font-size: 26px;
    margin-bottom: 20px;
    font-weight: 700;
}

.otp-lockout-message p {
    color: #4a5568;
    font-size: 16px;
    line-height: 1.8;
    margin: 15px 0;
}

.otp-lockout-message strong {
    color: #2d3748;
    font-weight: 700;
}

.otp-lockout-message .back-to-home {
    display: inline-block;
    margin-top: 30px;
    padding: 14px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

.otp-lockout-message .back-to-home:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(102, 126, 234, 0.4);
}

/* ============================================================================
   15. LOGIN ERROR BOX (for authentication errors)
   ============================================================================ */
.wp-2fa-error-box {
    background: #ffffff;
    border-radius: 12px;
    padding: 25px;
    margin: 20px 0;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.wp-2fa-error-title {
    font-size: 20px;
    font-weight: 700;
    color: #e53e3e;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid #fed7d7;
}

.wp-2fa-error-row-value-full {
    padding: 10px 0;
    font-size: 15px;
    color: #2d3748;
    font-weight: 500;
}

.wp-2fa-error-message {
    margin-top: 15px;
    padding: 15px;
    background: #fff5f5;
    border-radius: 8px;
    color: #742a2a;
    line-height: 1.8;
    font-size: 14px;
}

/* ============================================================================
   16. RESPONSIVE DESIGN
   ============================================================================ */
@media (max-width: 600px) {
    .otp-form-container {
        padding: 0;
		margin-left: 1%;
    }
    
    .otp-form {
        padding: 30px 20px;
        border-radius: 15px;
    }
    
    .otp-form h1 {
        font-size: 24px;
    }
    
    .otp-form input[type="text"],
    .otp-form input[name="otp_input"] {
        font-size: 20px;
        padding: 16px;
        letter-spacing: 6px;
    }
    
    .otp-form input[type="submit"],
    .otp-form button[type="submit"] {
        padding: 16px;
        font-size: 16px;
    }
    
    .ip-info-box,
    .email-sent-notice {
        padding: 12px;
        font-size: 13px;
    }
    
    .trust-device-checkbox {
        padding: 12px;
    }
    
    .trust-device-checkbox label {
        font-size: 14px;
    }
}

@media (max-width: 400px) {
    body.otp-page {
        padding: 10px;
    }
    
    .otp-form {
        padding: 25px 15px;
    }
    
    .otp-form h1 {
        font-size: 20px;
    }
    
    .otp-form input[type="text"],
    .otp-form input[name="otp_input"] {
        font-size: 18px;
        letter-spacing: 4px;
    }
}

/* ============================================================================
   17. DARK MODE (Optional)
   ============================================================================ */
@media (prefers-color-scheme: dark) {
    body.otp-page {
        background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
    }
    
    .otp-form {
        background: #2d3748;
    }
    
    .otp-form h1,
    .otp-form h2 {
        color: #f7fafc;
    }
    
    .otp-form input[type="text"],
    .otp-form input[name="otp_input"] {
        background: #1a202c;
        color: #f7fafc;
        border-color: #4a5568;
    }
    
    .trust-device-checkbox {
        background: #1a202c;
        border-color: #4a5568;
    }
    
    .trust-device-checkbox label {
        color: #e2e8f0;
    }
    
    .countdown-timer {
        color: #cbd5e0;
    }
}

/* ============================================================================
   18. LOADING ANIMATION
   ============================================================================ */
.otp-form.loading {
    pointer-events: none;
    opacity: 0.7;
}

.otp-form.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 50px;
    height: 50px;
    margin: -25px 0 0 -25px;
    border: 4px solid #e2e8f0;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================================================
   19. ACCESSIBILITY
   ============================================================================ */
.otp-form input:focus,
.otp-form button:focus {
    outline: 3px solid #667eea;
    outline-offset: 2px;
}

.otp-form *:focus-visible {
    outline: 3px solid #667eea;
    outline-offset: 2px;
}

/* Screen reader only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ============================================================================
   20. PRINT STYLES
   ============================================================================ */
@media print {
    body.otp-page {
        background: white;
    }
    
    .otp-form {
        box-shadow: none;
        border: 1px solid #e2e8f0;
    }
    
    .back-to-home,
    .otp-form input[type="submit"],
    .otp-form button[type="submit"] {
        display: none;
    }
}