/* Apple-Style Contact Page CSS */

/* Contact Hero Section */
.contact-hero {
    background: linear-gradient(135deg, #1d1d1f 0%, #2d2d30 100%);
    padding: 120px 0 80px;
    position: relative;
    overflow: hidden;
}

.contact-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse 80% 50% at 50% -20%, rgba(120, 119, 198, 0.3), transparent 50%);
    pointer-events: none;
}

.contact-hero h1 {
    font-size: 3.5rem;
    font-weight: 700;
    color: #f5f5f7;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
}

.contact-hero .lead {
    font-size: 1.25rem;
    color: #a1a1a6;
    font-weight: 400;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Contact Section */
.contact-section {
    background: #000;
    padding: 80px 0;
}

.section-padding {
    padding: 60px 0;
}

/* AJAX Form Messages */
#contact-success,
#contact-error {
    border-radius: 12px;
    border: none;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    backdrop-filter: blur(20px);
    animation: slideInFromTop 0.4s ease-out;
}

#contact-success {
    background: rgba(52, 199, 89, 0.1);
    border: 1px solid rgba(52, 199, 89, 0.3);
    color: #34c759;
}

#contact-error {
    background: rgba(255, 69, 58, 0.1);
    border: 1px solid rgba(255, 69, 58, 0.3);
    color: #ff453a;
}

/* Legacy Turnstile Container - Use turnstile-wrapper instead */
.turnstile-container {
    min-height: 65px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Only show background when Turnstile is loaded - DEPRECATED */
.turnstile-container:has(iframe) {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1rem;
    backdrop-filter: blur(20px);
}

#contact-turnstile-loading {
    color: #a1a1a6;
}

#contact-turnstile-loading .spinner-border {
    width: 1.5rem;
    height: 1.5rem;
}

/* Button Loading State */
.btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn .fa-spinner {
    animation: spin 1s linear infinite;
}

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

@keyframes slideInFromTop {
    0% {
        opacity: 0;
        transform: translateY(-20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Contact Info Cards */
.contact-info {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.contact-info-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 2rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.contact-info-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.02) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.contact-info-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.contact-info-card:hover::before {
    opacity: 1;
}

.contact-info-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #007aff 0%, #0051d0 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    transition: transform 0.3s ease;
}

.contact-info-card:hover .contact-info-icon {
    transform: scale(1.1);
}

.contact-info-icon i {
    color: white;
    font-size: 1.5rem;
}

.contact-info-card h4 {
    color: #f5f5f7;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    letter-spacing: -0.01em;
}

.contact-info-card p {
    color: #a1a1a6;
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.contact-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.contact-link {
    color: #007aff;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    font-size: 1.1rem;
}

.contact-link:hover {
    color: #409cff;
    text-decoration: none;
}

.contact-location {
    color: #f5f5f7;
    font-weight: 500;
    display: block;
    margin-bottom: 0.25rem;
}

/* Contact Form Card */
.contact-form-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 3rem;
    position: relative;
    overflow: hidden;
}

.contact-form-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.02) 100%);
    pointer-events: none;
}

.contact-form-card h3 {
    color: #f5f5f7;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    letter-spacing: -0.02em;
}

.form-description {
    color: #a1a1a6;
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 2rem;
}

/* Apple Form Inputs */
.apple-input-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.apple-input-label {
    display: block;
    color: #f5f5f7;
    font-weight: 500;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    letter-spacing: -0.01em;
}

.apple-form-input {
    width: 100%;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    color: #f5f5f7;
    font-size: 1rem;
    font-weight: 400;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.apple-form-input::placeholder {
    color: #a1a1a6;
}

.apple-form-input:focus {
    outline: none;
    border-color: #007aff;
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.2);
}

.apple-form-input.error {
    border-color: #ff453a;
    background: rgba(255, 69, 58, 0.1);
}

.apple-form-input.error:focus {
    box-shadow: 0 0 0 3px rgba(255, 69, 58, 0.2);
}

textarea.apple-form-input {
    resize: vertical;
    min-height: 120px;
    font-family: inherit;
}

/* Submit Button */
.btn-primary {
    background: linear-gradient(135deg, #007aff 0%, #0051d0 100%);
    border: none;
    border-radius: 12px;
    padding: 16px 32px;
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    text-transform: none;
    letter-spacing: -0.01em;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(0, 122, 255, 0.3);
    background: linear-gradient(135deg, #409cff 0%, #007aff 100%);
}

.btn-primary:hover::before {
    opacity: 1;
}

.btn-primary:active {
    transform: translateY(0);
}

/* Error Alert */
.alert-danger {
    background: rgba(255, 69, 58, 0.1);
    border: 1px solid rgba(255, 69, 58, 0.3);
    border-radius: 12px;
    color: #ff6b6b;
    padding: 1rem 1.5rem;
}

.alert-content {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.alert-content ul {
    margin: 0;
    padding-left: 1rem;
}

.alert-content li {
    margin-bottom: 0.25rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .contact-hero {
        padding: 100px 0 60px;
    }
    
    .contact-hero h1 {
        font-size: 2.5rem;
    }
    
    .contact-hero .lead {
        font-size: 1.1rem;
    }
    
    .contact-section {
        padding: 60px 0;
    }
    
    .contact-form-card {
        padding: 2rem;
        margin-top: 2rem;
    }
    
    .contact-form-card h3 {
        font-size: 1.75rem;
    }
    
    .contact-info {
        gap: 1.5rem;
    }
    
    .contact-info-card {
        padding: 1.5rem;
    }
}

@media (max-width: 576px) {
    .contact-hero h1 {
        font-size: 2rem;
    }
    
    .contact-hero .lead {
        font-size: 1rem;
    }
    
    .contact-form-card {
        padding: 1.5rem;
    }
    
    .contact-info-card {
        padding: 1.25rem;
    }
    
    .apple-form-input {
        padding: 14px 16px;
    }
    
    .btn-primary {
        padding: 14px 28px;
        font-size: 1rem;
    }
}

/* Animation for page load */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.contact-hero,
.contact-info-card,
.contact-form-card {
    animation: fadeInUp 0.8s ease-out;
}

.contact-info-card:nth-child(2) {
    animation-delay: 0.1s;
}

/* Individual Field Error Messages */
.input-error-message {
    color: #ff453a;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    animation: fadeInUp 0.3s ease;
}

.input-error-message i {
    font-size: 0.75rem;
    opacity: 0.8;
}

/* Success and Error Alert Improvements */
.alert-success {
    background: rgba(52, 199, 89, 0.1);
    border: 1px solid rgba(52, 199, 89, 0.3);
    border-radius: 12px;
    color: #34c759;
    padding: 1rem 1.5rem;
}

.alert-success .alert-content,
.alert-danger .alert-content {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

/* Turnstile Container Styling */
.turnstile-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 65px;
    margin: 1rem 0;
    contain: layout style paint; /* Optimize rendering performance */
    will-change: transform; /* Hint browser for optimization */
}

/* Optimize Turnstile widget performance */
.turnstile-container iframe {
    max-width: 100%;
    contain: strict; /* Strict containment for better performance */
}

#contact-turnstile-loading {
    color: #a1a1a6;
}

#contact-turnstile-loading .spinner-border {
    width: 1rem;
    height: 1rem;
}

/* Form Submit Button States */
.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.btn-primary:disabled:hover {
    transform: none !important;
    box-shadow: none !important;
}

.contact-info-card:nth-child(3) {
    animation-delay: 0.2s;
}

.contact-form-card {
    animation-delay: 0.3s;
}
