/**
 * Podlyft Customer Verification Frontend CSS
 * Professional styling for checkout verification process
 */

/* Reset and base styles for verification section */
#podlyft-verification-section * {
    box-sizing: border-box;
}

#podlyft-verification-section {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    margin: 20px 0;
    padding: 25px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 12px;
    border: 2px solid #e9ecef;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

#podlyft-verification-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px 12px 0 0;
}

#podlyft-verification-section:hover {
    border-color: #667eea;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15);
}

/* Section header */
#podlyft-verification-section h3 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

#podlyft-verification-section h3 span {
    font-size: 20px;
}

#podlyft-verification-section p {
    margin: 0 0 20px 0;
    color: #666;
    line-height: 1.5;
    font-size: 14px;
}

/* Verification steps */
.verification-step {
    animation: fadeInStep 0.4s ease-out;
}

@keyframes fadeInStep {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Form layouts */
.verification-step > div[style*="display: flex"] {
    display: flex !important;
    gap: 12px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.verification-step > div[style*="display: flex"] > div:first-child {
    flex: 1;
    min-width: 250px;
}

/* Input fields */
#verification-email,
#verification-code {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    background: #ffffff;
    transition: all 0.3s ease;
    outline: none;
}

#verification-email:focus,
#verification-code:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background: #fafbfc;
}

#verification-email:invalid {
    border-color: #dc3545;
}

#verification-email:valid {
    border-color: #28a745;
}

/* Verification code specific styling */
#verification-code {
    text-align: center;
    letter-spacing: 4px;
    font-size: 18px;
    font-weight: 700;
    color: #667eea;
}

#verification-code::placeholder {
    letter-spacing: 2px;
    font-weight: 500;
    color: #999;
}

/* Buttons */
.verification-step .button,
#send-verification-btn,
#verify-code-btn {
    padding: 14px 24px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    min-height: 48px;
}

#send-verification-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

#verify-code-btn {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.verification-step .button:hover,
#send-verification-btn:hover,
#verify-code-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.verification-step .button:active,
#send-verification-btn:active,
#verify-code-btn:active {
    transform: translateY(0);
}

.verification-step .button:disabled,
#send-verification-btn:disabled,
#verify-code-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Resend button */
#resend-code-btn {
    background: none;
    border: none;
    color: #667eea;
    text-decoration: underline;
    cursor: pointer;
    font-size: 13px;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

#resend-code-btn:hover {
    background: rgba(102, 126, 234, 0.1);
    text-decoration: none;
}

#resend-code-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Timer styling */
#resend-timer {
    margin-left: 8px;
    color: #999;
    font-size: 12px;
    font-weight: 500;
}

/* Validation messages */
#email-validation-message,
#code-validation-message {
    margin-top: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    display: none;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
        max-height: 0;
    }
    to {
        opacity: 1;
        transform: translateY(0);
        max-height: 100px;
    }
}

/* Success step styling */
#verification-step-3 {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border: 2px solid #28a745;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    animation: successPulse 0.6s ease;
}

@keyframes successPulse {
    0% {
        transform: scale(0.95);
        opacity: 0;
    }
    50% {
        transform: scale(1.02);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

#verification-step-3 p {
    margin: 0;
    color: #155724;
    font-weight: 600;
    font-size: 16px;
}

/* Step separators */
#verification-step-2 {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
    position: relative;
}

#verification-step-2::before {
    content: '2';
    position: absolute;
    top: -12px;
    left: 20px;
    width: 24px;
    height: 24px;
    background: #667eea;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

/* Status indicators */
.verification-status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

.status-sent {
    background: #d1ecf1;
    color: #0c5460;
}

.status-verified {
    background: #d4edda;
    color: #155724;
}

.status-failed {
    background: #f8d7da;
    color: #721c24;
}

/* Loading states */
.verification-loading {
    position: relative;
    pointer-events: none;
}

.verification-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    z-index: 1;
}

/* Security badge */
.security-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-top: 15px;
}

/* Mobile responsive */
@media (max-width: 768px) {
    #podlyft-verification-section {
        margin: 15px 0;
        padding: 20px;
    }
    
    .verification-step > div[style*="display: flex"] {
        flex-direction: column;
        gap: 15px;
    }
    
    .verification-step > div[style*="display: flex"] > div {
        flex: none !important;
        min-width: auto !important;
        width: 100%;
    }
    
    #verification-email,
    #verification-code {
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .verification-step .button,
    #send-verification-btn,
    #verify-code-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    #podlyft-verification-section {
        padding: 15px;
        margin: 10px 0;
    }
    
    #podlyft-verification-section h3 {
        font-size: 16px;
    }
    
    #verification-code {
        letter-spacing: 2px;
        font-size: 16px;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    #podlyft-verification-section {
        border: 3px solid #000;
    }
    
    #verification-email,
    #verification-code {
        border: 2px solid #000;
    }
    
    .verification-step .button,
    #send-verification-btn,
    #verify-code-btn {
        border: 2px solid #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    #podlyft-verification-section,
    .verification-step,
    #verification-email,
    #verification-code,
    .verification-step .button,
    #send-verification-btn,
    #verify-code-btn {
        animation: none;
        transition: none;
    }
}

/* Dark mode support (if theme supports it) */
@media (prefers-color-scheme: dark) {
    #podlyft-verification-section {
        background: linear-gradient(135deg, #2c2c2c 0%, #1e1e1e 100%);
        border-color: #555;
        color: #e0e0e0;
    }
    
    #podlyft-verification-section h3 {
        color: #ffffff;
    }
    
    #podlyft-verification-section p {
        color: #cccccc;
    }
    
    #verification-email,
    #verification-code {
        background: #3c3c3c;
        border-color: #555;
        color: #e0e0e0;
    }
    
    #verification-email::placeholder,
    #verification-code::placeholder {
        color: #999;
    }
    
    #verification-email:focus,
    #verification-code:focus {
        background: #4a4a4a;
        border-color: #667eea;
    }
    
    #verification-step-2 {
        border-top-color: #555;
    }
    
    #resend-code-btn:hover {
        background: rgba(102, 126, 234, 0.2);
    }
}

/* Print styles */
@media print {
    #podlyft-verification-section {
        display: none !important;
    }
}

/* Focus management for accessibility */
#verification-email:focus,
#verification-code:focus,
#send-verification-btn:focus,
#verify-code-btn:focus,
#resend-code-btn:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Screen reader support */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Notification styles (for JavaScript notifications) */
#podlyft-notification {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    border-radius: 8px;
    font-weight: 500;
    line-height: 1.4;
    word-wrap: break-word;
}

/* Success notification animation */
.verification-success-animation {
    animation: successBounce 0.6s ease;
}

@keyframes successBounce {
    0%, 20%, 60%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    80% {
        transform: translateY(-5px);
    }
}

/* Error shake animation */
.verification-error-shake {
    animation: errorShake 0.5s ease;
}

@keyframes errorShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    75% { transform: translateX(8px); }
}

/* Code input special effects */
#verification-code.code-complete {
    border-color: #28a745;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1);
    animation: codeComplete 0.3s ease;
}

@keyframes codeComplete {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
    100% {
        transform: scale(1);
    }
}

/* Step progress indicator */
.verification-progress {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    gap: 10px;
}

.progress-step {
    width: 30px;
    height: 4px;
    background: #e9ecef;
    border-radius: 2px;
    transition: background 0.3s ease;
}

.progress-step.active {
    background: #667eea;
}

.progress-step.completed {
    background: #28a745;
}

/* Tooltip styles for help text */
.verification-tooltip {
    position: relative;
    cursor: help;
}

.verification-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

.verification-tooltip:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-5px);
}

/* Custom scrollbar for any overflow areas */
.verification-scroll::-webkit-scrollbar {
    width: 6px;
}

.verification-scroll::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.verification-scroll::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 3px;
}

.verification-scroll::-webkit-scrollbar-thumb:hover {
    background: #5a67d8;
}