/**
 * SOTA Phone Input Styling
 * Modern, accessible phone input with real-time validation
 */

.phone-input-enhanced {
    font-family: 'SF Mono', 'Monaco', 'Cascadia Code', 'Roboto Mono', monospace;
    font-size: 16px;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    background: #ffffff;
    transition: all 0.2s ease;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.phone-input-enhanced:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
    background: #fafbfc;
}

/* Validation States */
.phone-input-enhanced.phone-valid {
    border-color: #28a745;
    background: #f8fff9;
}

.phone-input-enhanced.phone-valid:focus {
    border-color: #28a745;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1);
}

.phone-input-enhanced.phone-invalid {
    border-color: #dc3545;
    background: #fff8f8;
}

.phone-input-enhanced.phone-invalid:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

.phone-input-enhanced.phone-warning {
    border-color: #ffc107;
    background: #fffdf5;
}

.phone-input-enhanced.phone-warning:focus {
    border-color: #ffc107;
    box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.1);
}

/* Feedback Messages */
.phone-feedback {
    margin-top: 6px;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    display: none;
    animation: feedbackSlide 0.2s ease;
}

@keyframes feedbackSlide {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.phone-feedback-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.phone-feedback-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.phone-feedback-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

/* Phone Input Container */
.phone-input-container {
    position: relative;
}

.phone-input-container .form-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-weight: 600;
    color: #495057;
}

.phone-input-container .form-label::before {
    content: "📱";
    font-size: 16px;
}

/* Placeholder styling */
.phone-input-enhanced::placeholder {
    color: #6c757d;
    font-style: italic;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .phone-input-enhanced {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 14px 16px; /* Larger touch target */
    }
    
    .phone-feedback {
        font-size: 12px;
        padding: 4px 8px;
    }
}

/* Integration with existing form styles */
.form-row .phone-input-enhanced,
.form-group .phone-input-enhanced {
    width: 100%;
    max-width: 300px;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .phone-input-enhanced {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .phone-input-enhanced:focus {
        background: #374151;
        border-color: #60a5fa;
    }
    
    .phone-feedback-success {
        background: #065f46;
        color: #d1fae5;
        border-color: #10b981;
    }
    
    .phone-feedback-error {
        background: #7f1d1d;
        color: #fecaca;
        border-color: #ef4444;
    }
    
    .phone-feedback-warning {
        background: #78350f;
        color: #fef3c7;
        border-color: #f59e0b;
    }
}

/* Accessibility improvements */
.phone-input-enhanced:focus-visible {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .phone-input-enhanced {
        border-width: 3px;
    }
    
    .phone-feedback {
        border-width: 2px;
        font-weight: 600;
    }
}