/* ============================================
   BSERI Contact Page Styles
   ============================================ */

/* Skip Link Accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--color-primary);
    color: var(--color-text-inverse);
    padding: 8px;
    text-decoration: none;
    z-index: 10000;
    border-radius: 0 0 6px 6px;
    font-weight: 500;
}

.skip-link:focus {
    top: 0;
}

/* Contact page — nav-over-hero (see nav-over-hero.css + about-premium.css) */
body.contact-page.nav-over-hero main#main-content > .contact-page-hero:first-child {
    margin-top: 0;
}

body.contact-page .contact-page-hero .about-hero-lead {
    max-width: 36rem;
}

/* Contact form section — solid background, no glass overlap tricks */
.contact-form-section {
    background: var(--color-bg-muted, #f1f5f9);
}

/* Quick links band — solid navy, no backdrop-filter */
.quick-links-section {
    background: linear-gradient(
        160deg,
        var(--color-about-navy, #1a2952) 0%,
        var(--color-about-navy-deep, #0f172a) 100%
    );
}

.contact-page .quick-link-card {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.contact-page .quick-link-card:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.28);
    transform: translateY(-3px);
}

.contact-page .quick-link-icon {
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.contact-stats-card {
    background: var(--color-bg, #fff);
    border-radius: 8px;
    padding: 2rem;
    border: 1px solid var(--color-border, #dde3f0);
    box-shadow: 0 12px 32px -8px rgba(15, 23, 42, 0.12);
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.stat-item {
    padding: 1rem 0;
}

.stat-number {
    font-size: 1.5rem;
    line-height: 1.2;
}

.stat-label {
    opacity: 0.9;
}

/* Contact Matrix Cards */
.contact-card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: 2px solid transparent;
    background: white;
    border-radius: 16px;
    position: relative;
    overflow: hidden;
}

.contact-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border-color: var(--bs-primary);
}

.contact-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.contact-card:hover::before {
    opacity: 1;
}

.card-icon {
    transition: all 0.3s ease;
}

.contact-card:hover .card-icon {
    transform: scale(1.1);
}

/* Copy to Clipboard Button */
.copy-btn {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.copy-btn:hover {
    transform: scale(1.05);
}

.copy-btn.copied {
    background-color: #10B981 !important;
    border-color: #10B981 !important;
    color: var(--color-text-inverse) !important;
}

.copy-btn.copied::after {
    content: 'Copied!';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--color-success-dark);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    animation: copyFeedback 2s ease forwards;
}

@keyframes copyFeedback {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    20% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    80% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
}

/* Legal Assurances Cards */
.assurance-card {
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}

.assurance-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
    border-left-color: var(--bs-primary);
}

/* Certificate Verification Widget */
.verification-widget {
    background: white;
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    position: relative;
    overflow: hidden;
}

.verification-widget::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(transparent, rgba(29, 78, 216, 0.03), transparent 30%);
    animation: rotate 20s linear infinite;
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.verification-widget > * {
    position: relative;
    z-index: 2;
}

.widget-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(29, 78, 216, 0.4); }
    50% { box-shadow: 0 0 0 20px rgba(29, 78, 216, 0); }
}

.widget-icon i {
    font-size: 2rem;
    color: var(--color-text-inverse);
}

.verification-form .form-control {
    border: 2px solid var(--color-border);
    border-radius: 12px;
    padding: 1rem;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.verification-form .form-control:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 0.2rem rgba(29, 78, 216, 0.25);
}

.verification-result {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 12px;
    padding: 1.5rem;
    animation: slideIn 0.5s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Contact Form Styling */
.contact-form-card {
    background: white;
    border-radius: 0;
    padding: 1.75rem;
    box-shadow: 0 12px 32px -8px rgba(15, 23, 42, 0.18);
    border: 1px solid var(--color-border);
}

.modern-form .form-control,
.modern-form .form-select {
    border: 1px solid var(--color-border);
    border-radius: 0;
    padding: 0.5rem 0.65rem;
    font-size: 0.875rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    background-color: var(--color-bg, #fff);
}

.modern-form .form-control:focus,
.modern-form .form-select:focus {
    border-color: var(--color-primary);
    background-color: var(--color-text-inverse);
    box-shadow: 0 0 0 0.2rem rgba(29, 78, 216, 0.25);
}

.modern-form .form-floating > label {
    font-weight: 500;
    color: #6b7280;
}

.modern-form .form-control:focus ~ label,
.modern-form .form-control:not(:placeholder-shown) ~ label,
.modern-form .form-select:focus ~ label,
.modern-form .form-select:not([value=""]) ~ label {
    color: var(--color-primary);
}

/* Form validation states */
.form-control.is-valid {
    border-color: #10B981;
}

.form-control.is-invalid {
    border-color: #EF4444;
}

.valid-feedback {
    color: var(--color-success-dark);
    font-size: 0.875rem;
}

.invalid-feedback {
    color: #DC2626;
    font-size: 0.875rem;
}

/* Office Info Card */
.office-info-card {
    background: linear-gradient(135deg, var(--color-bg-muted) 0%, var(--color-border) 100%);
    border-radius: 20px;
    padding: 2rem;
    height: fit-content;
    position: sticky;
    top: 100px;
}

.office-location {
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 1rem;
}

.office-location:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
}

/* Quick Links */
.quick-links .btn {
    transition: all 0.3s ease;
}

.quick-links .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Responsive Design */
@media (max-width: 768px) {
    body.contact-page .contact-page-hero.about-hero-compact {
        padding-bottom: 2.5rem;
    }
    
    .contact-stats-card {
        padding: 1.5rem;
        margin-top: 2rem;
    }
    
    .stat-number {
        font-size: 1.25rem;
    }
    
    .contact-card {
        margin-bottom: 1rem;
    }
    
    .verification-widget {
        padding: 1.5rem;
    }
    
    .contact-form-card {
        padding: 1.5rem;
    }
    
    .office-info-card {
        position: static;
        margin-top: 2rem;
    }
}

@media (max-width: 576px) {
    body.contact-page .contact-page-hero h1 {
        font-size: 2rem;
    }
    
    body.contact-page .contact-page-hero .about-hero-lead {
        font-size: 1rem;
    }
    
    .widget-icon {
        width: 60px;
        height: 60px;
    }
    
    .widget-icon i {
        font-size: 1.5rem;
    }
    
    .modern-form .form-control,
    .modern-form .form-select {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* Print Styles */
@media print {
    .contact-page-hero,
    .contact-form-card,
    .verification-widget {
        background: white !important;
        box-shadow: none !important;
    }
    
    .btn,
    .copy-btn {
        display: none !important;
    }
    
    .contact-card:hover::before {
        opacity: 0 !important;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .contact-card {
        border: 2px solid #000;
    }
    
    .contact-card:hover {
        border-color: #0066cc;
    }
    
    .verification-widget {
        border: 2px solid #000;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .contact-card:hover {
        transform: none;
    }
    
    .copy-btn:hover {
        transform: none;
    }
}

/* Focus Management */
.contact-card:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.copy-btn:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* Toast Notifications */
.toast-container {
    z-index: 1070;
}

.toast {
    border-left: 4px solid #10B981;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.toast-body {
    font-weight: 500;
}

/* Loading States */
.btn.loading {
    position: relative;
    color: transparent !important;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Error States */
.alert.shake {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Success States */
.form-success {
    background: #f0fdf4;
    border: 2px solid #bbf7d0;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    animation: slideInUp 0.5s ease;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-success i {
    font-size: 3rem;
    color: var(--color-success-dark);
    margin-bottom: 1rem;
}

/* Dark Mode Support (if implemented) */
@media (prefers-color-scheme: dark) {
    .contact-card {
        background: #1f2937;
        border-color: #374151;
        color: #f9fafb;
    }
    
    .verification-widget {
        background: #1f2937;
        color: #f9fafb;
    }
    
    .contact-form-card {
        background: #1f2937;
        color: #f9fafb;
    }
    
    .office-info-card {
        background: #1f2937;
        color: #f9fafb;
    }
}
