/* ============================================
   WhiteMountainMedia - Contact Page Styles
   ============================================ */

/* Contact Page Layout */
.contact-page {
    background: var(--color-offwhite);
}

.contact-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
}

/* Visual Side */
.contact-visual {
    position: relative;
    overflow: hidden;
}

.contact-image-container {
    position: absolute;
    inset: 0;
}

.contact-bg-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 8s ease-out, filter 0.5s ease;
}

.contact-image-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(114, 47, 55, 0.7) 0%,
        rgba(26, 38, 52, 0.8) 100%
    );
}

.contact-visual-content {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-xl);
}

.contact-visual-content h2 {
    font-size: clamp(3rem, 6vw, 5rem);
    color: var(--color-white);
    font-weight: 400;
    line-height: 1.1;
    text-align: center;
}

.contact-visual-content h2 span {
    font-style: italic;
    color: var(--color-gold-light);
    display: block;
}

/* Form Container */
.contact-form-container {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: var(--space-md) var(--space-lg);
    padding-top: calc(var(--space-md) + 70px);
}

.contact-form-wrapper {
    width: 100%;
    max-width: 500px;
}

/* Form Header */
.form-header {
    margin-bottom: var(--space-sm);
}

.form-header h1 {
    font-size: clamp(2rem, 4vw, 3rem);
    margin-bottom: var(--space-sm);
}

.form-header p {
    font-size: 1rem;
    color: var(--color-text-light);
}

/* Progress Indicator */
.form-progress {
    position: relative;
    margin-bottom: var(--space-sm);
    padding-bottom: var(--space-sm);
}

.progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    width: 0%;
    background: var(--gradient-warm);
    border-radius: var(--radius-full);
    transition: width var(--transition-base);
}

.progress-steps {
    display: flex;
    justify-content: space-between;
}

.progress-step {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-offwhite);
    border: 2px solid var(--color-text-muted);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text-muted);
    transition: all var(--transition-base);
}

.progress-step.active {
    border-color: var(--color-bordeaux);
    color: var(--color-bordeaux);
}

.progress-step.completed {
    background: var(--color-bordeaux);
    border-color: var(--color-bordeaux);
    color: var(--color-white);
}

/* Form Groups */
.form-group {
    margin-bottom: var(--space-sm);
}

.form-group--textarea {
    margin-bottom: var(--space-sm);
}

.input-wrapper {
    position: relative;
}

/* Form Input */
.form-input {
    width: 100%;
    padding: var(--space-sm) 0;
    padding-left: 48px;
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--color-text);
    background: transparent;
    border: none;
    border-radius: 0;
    outline: none;
    transition: all var(--transition-base);
}

.form-input::placeholder {
    color: transparent;
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
    padding-top: var(--space-sm);
    padding-bottom: var(--space-xs);
}

/* Form Label */
.form-label {
    position: absolute;
    left: 48px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    color: var(--color-text-muted);
    pointer-events: none;
    transition: all var(--transition-base);
}

.form-group--textarea .form-label {
    top: var(--space-md);
    transform: translateY(0);
}

.form-input:focus ~ .form-label,
.form-input:not(:placeholder-shown) ~ .form-label {
    top: -8px;
    left: 0;
    transform: translateY(0);
    font-size: 0.75rem;
    color: var(--color-bordeaux);
    font-weight: 500;
}

.form-group--textarea .form-input:focus ~ .form-label,
.form-group--textarea .form-input:not(:placeholder-shown) ~ .form-label {
    top: -8px;
}

/* Select styling */
.form-select {
    appearance: none;
    cursor: pointer;
}

.form-label--select {
    top: -8px;
    left: 0;
    transform: translateY(0);
    font-size: 0.75rem;
    color: var(--color-text-muted);
    font-weight: 500;
}

.form-select:focus ~ .form-label--select,
.form-select:valid ~ .form-label--select {
    color: var(--color-bordeaux);
}

.input-wrapper--select::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid var(--color-text-muted);
    pointer-events: none;
    transition: transform var(--transition-base);
}

.form-select:focus ~ .input-wrapper--select::after {
    transform: translateY(-50%) rotate(180deg);
}

/* Input Line */
.input-line {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--color-text-muted);
    opacity: 0.3;
}

.input-line::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--color-bordeaux);
    transition: all var(--transition-base);
}

.form-input:focus ~ .input-line::after {
    left: 0;
    width: 100%;
}

.form-input:valid:not(:placeholder-shown) ~ .input-line::after {
    left: 0;
    width: 100%;
    background: var(--color-gold);
}

/* Input Icon */
.input-icon {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
    transition: color var(--transition-base);
}

.form-group--textarea .input-icon {
    top: var(--space-md);
    transform: translateY(0);
}

.input-icon svg {
    width: 20px;
    height: 20px;
}

.form-input:focus ~ .input-icon {
    color: var(--color-bordeaux);
}

.form-input:valid:not(:placeholder-shown) ~ .input-icon {
    color: var(--color-gold);
}

/* Character Counter */
.char-counter {
    position: absolute;
    bottom: var(--space-xs);
    right: 0;
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

#charCount {
    transition: color var(--transition-base);
}

.char-counter.warning #charCount {
    color: var(--color-orange);
}

.char-counter.limit #charCount {
    color: var(--color-bordeaux);
}

/* Submit Button */
.form-submit {
    margin-top: var(--space-md);
}

.submit-button {
    position: relative;
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    background: var(--color-bordeaux);
    color: var(--color-white);
    font-size: 1rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
}

.submit-button:hover:not(:disabled) {
    background: var(--color-bordeaux-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.submit-button:active:not(:disabled) {
    transform: translateY(0);
}

.submit-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-icon svg {
    width: 20px;
    height: 20px;
    transition: transform var(--transition-base);
}

.submit-button:hover .btn-icon svg {
    transform: translateX(4px);
}

/* Loading State */
.btn-loading {
    display: none;
    gap: 4px;
}

.submit-button.loading .btn-text,
.submit-button.loading .btn-icon {
    display: none;
}

.submit-button.loading .btn-loading {
    display: flex;
}

.loading-dot {
    width: 8px;
    height: 8px;
    background: var(--color-white);
    border-radius: var(--radius-full);
    animation: loadingPulse 1.4s ease-in-out infinite both;
}

.loading-dot:nth-child(1) { animation-delay: 0s; }
.loading-dot:nth-child(2) { animation-delay: 0.2s; }
.loading-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes loadingPulse {
    0%, 80%, 100% {
        transform: scale(0.6);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Form Error */
.form-error {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm);
    background: rgba(114, 47, 55, 0.1);
    border-left: 3px solid var(--color-bordeaux);
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-md);
    color: var(--color-bordeaux);
    font-size: 0.9rem;
}

.form-error svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.animate-shake {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-8px); }
    40%, 80% { transform: translateX(8px); }
}

/* Form Success */
.form-success {
    text-align: center;
    padding: var(--space-xl) 0;
}

.success-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--space-md);
    color: var(--color-gold);
    animation: successPop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes successPop {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.success-icon svg {
    width: 100%;
    height: 100%;
}

.form-success h2 {
    font-size: 2rem;
    margin-bottom: var(--space-sm);
    color: var(--color-anthracite);
}

.form-success p {
    font-size: 1.125rem;
    color: var(--color-text-light);
    margin-bottom: var(--space-lg);
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    color: var(--color-bordeaux);
    font-weight: 500;
    transition: all var(--transition-base);
}

.back-link svg {
    width: 20px;
    height: 20px;
    transition: transform var(--transition-base);
}

.back-link:hover {
    color: var(--color-bordeaux-dark);
}

.back-link:hover svg {
    transform: translateX(-4px);
}

/* Alternative Contact */
.contact-alternative {
    margin-top: var(--space-xl);
    padding-top: var(--space-lg);
    border-top: 1px solid rgba(45, 52, 54, 0.1);
    text-align: center;
}

.contact-alternative p {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    margin-bottom: var(--space-xs);
}

.email-link {
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--color-bordeaux);
    position: relative;
    display: inline-block;
}

.email-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-gold);
    transition: width var(--transition-base);
}

.email-link:hover::after {
    width: 100%;
}

/* ============================================
   Interactive Image Effects
   ============================================ */

/* Image transforms based on form progress */
.contact-bg-image.stage-1 {
    filter: brightness(1.05);
}

.contact-bg-image.stage-2 {
    filter: brightness(1.1) saturate(1.1);
    transform: scale(1.02);
}

.contact-bg-image.stage-3 {
    filter: brightness(1.15) saturate(1.15);
    transform: scale(1.04);
}

.contact-bg-image.stage-4 {
    filter: brightness(1.2) saturate(1.2);
    transform: scale(1.06);
}

/* Typing effect on image */
.contact-bg-image.typing {
    animation: subtlePulse 2s ease-in-out infinite;
}

@keyframes subtlePulse {
    0%, 100% {
        filter: brightness(1.1);
    }
    50% {
        filter: brightness(1.15);
    }
}

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 1024px) {
    .contact-section {
        grid-template-columns: 1fr;
    }
    
    .contact-visual {
        min-height: 40vh;
    }
    
    .contact-visual-content h2 {
        font-size: clamp(2rem, 5vw, 3rem);
    }
    
    .contact-form-container {
        padding: var(--space-lg) var(--space-md);
        padding-top: var(--space-lg);
    }
}

@media (max-width: 768px) {
    .contact-visual {
        min-height: 35vh;
    }
    
    .contact-visual-content {
        padding: var(--space-lg);
    }
    
    .contact-form-wrapper {
        max-width: 100%;
    }
    
    .form-header h1 {
        font-size: 2rem;
    }
    
    .progress-step {
        width: 28px;
        height: 28px;
        font-size: 0.7rem;
    }
    
    .submit-button {
        padding: var(--space-md);
    }
}

@media (max-width: 480px) {
    .contact-visual {
        min-height: 30vh;
    }
    
    .contact-form-container {
        padding: var(--space-md);
    }
    
    .form-progress {
        margin-bottom: var(--space-md);
    }
    
    .form-group {
        margin-bottom: var(--space-md);
    }
    
    .contact-alternative {
        margin-top: var(--space-lg);
        padding-top: var(--space-md);
    }
}

/* Focus Visible for Accessibility */
.form-input:focus-visible,
.submit-button:focus-visible {
    outline: 2px solid var(--color-gold);
    outline-offset: 2px;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .input-line {
        opacity: 1;
        background: var(--color-text);
    }
    
    .form-label {
        color: var(--color-text);
    }
    
    .progress-step {
        border-width: 3px;
    }
}
