/**
 * Email Verification Styles for Contact Form 7
 */

/* Email Verification Container */
.wpcf7ev-container {
    margin: 15px 0;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #f9f9f9;
    position: relative;
}

.wpcf7ev-container.wpcf7ev-verified {
    border-color: #4caf50;
    background-color: #f1f8e9;
}

/* Send Code Button */
.wpcf7ev-send-code {
    background-color: #0073aa;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.wpcf7ev-send-code:hover:not(:disabled) {
    background-color: #005a87;
}

.wpcf7ev-send-code:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

/* Verification Section */
.wpcf7ev-verification {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #ddd;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Code Input */
.wpcf7ev-code-input {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 16px;
    font-family: monospace;
    letter-spacing: 2px;
    text-align: center;
    width: 120px;
    background-color: white;
}

.wpcf7ev-code-input:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

.wpcf7ev-code-input:readonly {
    background-color: #f5f5f5;
    color: #666;
}

/* Verify Button */
.wpcf7ev-verify-code {
    background-color: #4caf50;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.wpcf7ev-verify-code:hover:not(:disabled) {
    background-color: #45a049;
}

.wpcf7ev-verify-code:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

/* Messages */
.wpcf7ev-message {
    margin-top: 10px;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    display: none;
}

.wpcf7ev-message.wpcf7ev-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

.wpcf7ev-message.wpcf7ev-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

/* Disabled Submit Button */
.wpcf7-form input[type="submit"].wpcf7ev-disabled {
    background-color: #cccccc !important;
    color: #666666 !important;
    cursor: not-allowed !important;
    opacity: 0.6;
}

.wpcf7-form input[type="submit"].wpcf7ev-disabled:hover {
    background-color: #cccccc !important;
}

/* Verified State Styling */
.wpcf7ev-verified .wpcf7ev-send-code,
.wpcf7ev-verified .wpcf7ev-verify-code {
    background-color: #4caf50;
    position: relative;
}

.wpcf7ev-verified .wpcf7ev-send-code:after,
.wpcf7ev-verified .wpcf7ev-verify-code:after {
    content: "✓";
    margin-left: 5px;
}

/* Loading State */
.wpcf7ev-send-code:disabled:after {
    content: "";
    width: 12px;
    height: 12px;
    margin-left: 8px;
    border: 2px solid #ffffff;
    border-top: 2px solid transparent;
    border-radius: 50%;
    display: inline-block;
    animation: wpcf7ev-spin 1s linear infinite;
}

@keyframes wpcf7ev-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .wpcf7ev-verification {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .wpcf7ev-code-input {
        width: 100%;
        max-width: 200px;
        margin: 0 auto;
    }
    
    .wpcf7ev-send-code,
    .wpcf7ev-verify-code {
        width: 100%;
        padding: 12px;
    }
}

/* Animation for verification section */
.wpcf7ev-verification {
    animation: wpcf7ev-slideDown 0.3s ease-out;
}

@keyframes wpcf7ev-slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Icon indicators */
.wpcf7ev-container:before {
    content: "📧";
    position: absolute;
    top: -8px;
    left: 15px;
    background-color: #f9f9f9;
    padding: 0 5px;
    font-size: 16px;
}

.wpcf7ev-container.wpcf7ev-verified:before {
    content: "✅";
    background-color: #f1f8e9;
}

/* Accessibility improvements */
.wpcf7ev-container:focus-within {
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

.wpcf7ev-send-code:focus,
.wpcf7ev-verify-code:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .wpcf7ev-container {
        border-width: 2px;
    }
    
    .wpcf7ev-send-code,
    .wpcf7ev-verify-code {
        border: 2px solid transparent;
    }
    
    .wpcf7ev-send-code:focus,
    .wpcf7ev-verify-code:focus {
        border-color: #0073aa;
    }
}

/* Print styles */
@media print {
    .wpcf7ev-container {
        border: 1px solid #000;
        background: none;
    }
    
    .wpcf7ev-send-code,
    .wpcf7ev-verify-code {
        border: 1px solid #000;
        background: none;
        color: #000;
    }
}
