/* ============================================
   CONTACT PAGE: Delight micro-interactions
   ============================================ */

/* Extend the underline-grows-from-center focus animation to the contact form
   (delight.css already does this for .auth-form only) */
.contact-form .form-group {
    position: relative;
}

.contact-form .form-group::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary-accent);
    transition: width 0.35s var(--ease-out-expo), left 0.35s var(--ease-out-expo);
}

.contact-form .form-group:focus-within::after {
    width: 100%;
    left: 0;
}

/* Textarea: no resize handle, transitions for auto-grow */
.contact-form textarea {
    resize: none;
    overflow: hidden;
    transition: height 0.15s ease;
}

/* Submit button: sending state pulse */
@keyframes btn-sending-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.submit-btn.sending {
    animation: btn-sending-pulse 1.2s ease infinite;
    pointer-events: none;
}

/* ── Success state ── */
.contact-form-wrapper {
    position: relative;
    /* min-height prevents collapse when form fades out */
    min-height: 420px;
}

.contact-form,
.contact-alt {
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.contact-form-wrapper.submitted .contact-form,
.contact-form-wrapper.submitted .contact-alt {
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
}

.contact-success-state {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: var(--spacing-sm);
    opacity: 0;
    transform: translateY(16px);
    pointer-events: none;
    transition: opacity 0.5s var(--ease-out-expo), transform 0.5s var(--ease-out-expo);
}

.contact-form-wrapper.submitted .contact-success-state {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    transition-delay: 0.3s;
}

.contact-success-name {
    font-family: var(--font-serif);
    font-size: 1.75rem;
    font-weight: 400;
    color: var(--text-dark);
    margin-top: var(--spacing-sm);
}

.contact-success-text {
    font-size: 1rem;
    color: var(--text-light);
    line-height: 1.6;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .contact-form .form-group::after {
        transition: none;
    }
    .submit-btn.sending {
        animation: none;
    }
    .contact-form,
    .contact-alt,
    .contact-success-state {
        transition: none !important;
    }
}
