/**
 * email-verification.css
 * Styles for email verification UI in booking form
 */

/* Email verification wrapper */
.email-verification-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
}

.email-verification-wrapper input[type="email"] {
    flex: 1;
    padding-right: 140px; /* Make room for verify button */
}

.email-verification-wrapper input[type="email"]:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
}

/* Verify email button */
.verify-email-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    z-index: 1;
}

.verify-email-btn:hover {
    background: linear-gradient(135deg, #5568d3 0%, #653a8a 100%);
    transform: translateY(-50%) scale(1.02);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.verify-email-btn:active {
    transform: translateY(-50%) scale(0.98);
}

.verify-email-btn:disabled {
    background: #cccccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.verify-email-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* Email verified checkmark */
.email-verified-check {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    display: none;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: #00ff9f;
    border-radius: 50%;
    color: #ffffff;
    font-size: 20px;
    font-weight: bold;
    z-index: 2;
    animation: checkmarkPop 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 3px 10px rgba(0, 255, 159, 0.5);
}

@keyframes checkmarkPop {
    0% {
        transform: translateY(-50%) scale(0);
        opacity: 0;
    }
    50% {
        transform: translateY(-50%) scale(1.2);
    }
    100% {
        transform: translateY(-50%) scale(1);
        opacity: 1;
    }
}

.email-verified-check svg {
    stroke-width: 3;
}

/* Verification status messages */
.verification-status {
    display: none;
    margin-top: 10px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.verification-status.success {
    background-color: rgba(0, 255, 159, 0.15);
    border: 1px solid rgba(0, 255, 159, 0.4);
    color: #00ff9f;
}

.verification-status.error {
    background-color: rgba(255, 71, 87, 0.15);
    border: 1px solid rgba(255, 71, 87, 0.4);
    color: #ff4757;
}

.verification-status.info {
    background-color: rgba(102, 126, 234, 0.15);
    border: 1px solid rgba(102, 126, 234, 0.4);
    color: #667eea;
}

/* reCAPTCHA container */
.recaptcha-container {
    margin-top: 15px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px dashed rgba(255, 255, 255, 0.2);
    display: flex;
    justify-content: center;
    animation: slideDown 0.3s ease;
}

/* Book appointment button - disabled state */
#bookAppointmentBtn:disabled {
    background: #555555 !important;
    cursor: not-allowed !important;
    opacity: 0.5;
    position: relative;
}

#bookAppointmentBtn:disabled::after {
    content: '🔒';
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .email-verification-wrapper {
        flex-direction: column;
        align-items: stretch;
    }
    
    .email-verification-wrapper input[type="email"] {
        padding-right: 50px; /* Room for checkmark only on mobile */
    }
    
    .verify-email-btn {
        position: static;
        transform: none;
        width: 100%;
        justify-content: center;
        margin-top: 8px;
    }
    
    .verify-email-btn:hover {
        transform: scale(1.02);
    }
    
    .email-verified-check {
        right: 12px;
        top: -42px; /* Position in the input field on mobile */
    }
}

@media (max-width: 480px) {
    .verify-email-btn {
        font-size: 12px;
        padding: 8px 12px;
    }
    
    .recaptcha-container {
        padding: 10px;
        overflow-x: auto;
    }
    
    .verification-status {
        font-size: 13px;
        padding: 10px 12px;
    }
}

/* Accessibility improvements */
.verify-email-btn:focus,
#bookAppointmentBtn:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Screen reader only text */
.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;
}

/* Loading state animation */
.verify-email-btn.loading {
    pointer-events: none;
}

.verify-email-btn.loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Enhance form group styling for verification */
.form-group2:has(.email-verification-wrapper) {
    margin-bottom: 20px;
}
