/* ============================================================
 * TheWriter.id — Contact Page (FTTH dark) v1.6.0
 * ============================================================ */

body.ftth-contact-page {
    font-family: 'Manrope', 'Inter', sans-serif;
    background: #050714;
    color: #e6e9f5;
    overflow-x: hidden;
}

body.ftth-contact-page .ftth-display { font-family: 'Instrument Serif', serif; font-weight:400; letter-spacing:-0.02em; line-height:0.95; }
body.ftth-contact-page .ftth-mono    { font-family: 'JetBrains Mono', monospace; letter-spacing:0.04em; }

/* Header on contact: transparent dark → solid on scroll */
body.ftth-contact-page #main-header { background: transparent !important; border-bottom: 1px solid transparent !important; }
body.ftth-contact-page #main-header.ftth-scrolled {
    background: rgba(5, 7, 20, 0.78) !important;
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    border-bottom: 1px solid rgba(120, 144, 220, 0.15) !important;
}
body.ftth-contact-page #main-header nav a,
body.ftth-contact-page #main-header a span:first-of-type { color: #e6e9f5 !important; }
body.ftth-contact-page #main-header nav a:hover { color: #67e8f9 !important; }
body.ftth-contact-page #main-header .text-red-600 { color: #fda4af !important; }
body.ftth-contact-page #main-header [class*="bg-brand-600"] {
    background: linear-gradient(135deg, #22d3ee 0%, #818cf8 100%) !important;
    color: #050714 !important;
    box-shadow: 0 8px 30px rgba(34, 211, 238, 0.35) !important;
}

/* Hero header strip with three.js fiber canvas */
body.ftth-contact-page .ftth-contact-hero {
    position: relative;
    min-height: 70vh;
    padding: 12rem 0 4rem;
    overflow: hidden;
    background: radial-gradient(ellipse at 50% 30%, #0f1840 0%, #050714 65%);
}
body.ftth-contact-page .ftth-contact-canvas {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    z-index: 0;
}
body.ftth-contact-page .ftth-contact-grain {
    position: absolute; inset: 0; z-index: 1;
    background-image:
        radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
        radial-gradient(rgba(34, 211, 238, 0.04) 1px, transparent 1px);
    background-size: 28px 28px, 22px 22px;
    background-position: 0 0, 11px 11px;
    pointer-events: none;
    opacity: 0.7;
}

/* Form vault container */
body.ftth-contact-page .ftth-form-wrap {
    position: relative;
    padding: 6rem 0 8rem;
    background: linear-gradient(180deg, #050714 0%, #0a0f24 50%, #050714 100%);
}

body.ftth-contact-page .ftth-form-card {
    position: relative;
    background: linear-gradient(160deg, rgba(13, 19, 48, 0.6) 0%, rgba(7, 9, 28, 0.85) 100%);
    border: 1px solid rgba(120, 144, 220, 0.18);
    border-radius: 28px;
    padding: 3.2rem;
    backdrop-filter: blur(20px);
    overflow: hidden;
}
body.ftth-contact-page .ftth-form-card::before {
    content: '';
    position: absolute;
    top: -40%; right: -20%;
    width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(34, 211, 238, 0.16), transparent 60%);
    pointer-events: none;
}

/* Floating-label fields */
body.ftth-contact-page .ftth-field {
    position: relative;
    margin-bottom: 1.6rem;
}
body.ftth-contact-page .ftth-field input,
body.ftth-contact-page .ftth-field textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(120, 144, 220, 0.22);
    border-radius: 14px;
    padding: 1.45rem 1.2rem 0.6rem;
    color: #e6e9f5;
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.4;
    transition: border-color 0.3s, background 0.3s, box-shadow 0.3s;
    outline: none;
}
body.ftth-contact-page .ftth-field textarea {
    min-height: 150px;
    padding-top: 1.6rem;
    resize: vertical;
}
body.ftth-contact-page .ftth-field label {
    position: absolute;
    left: 1.2rem;
    top: 1.2rem;
    color: #8b93b8;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    pointer-events: none;
    transition: all 0.28s cubic-bezier(.2,.8,.2,1);
}
body.ftth-contact-page .ftth-field input:focus,
body.ftth-contact-page .ftth-field textarea:focus {
    border-color: #22d3ee;
    background: rgba(34, 211, 238, 0.04);
    box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.12), 0 0 30px rgba(34, 211, 238, 0.18);
}
body.ftth-contact-page .ftth-field input:focus + label,
body.ftth-contact-page .ftth-field textarea:focus + label,
body.ftth-contact-page .ftth-field input:not(:placeholder-shown) + label,
body.ftth-contact-page .ftth-field textarea:not(:placeholder-shown) + label {
    top: 0.5rem;
    left: 1.2rem;
    font-size: 0.6rem;
    color: #67e8f9;
}

/* Field signal indicator (animated cyan line below input) */
body.ftth-contact-page .ftth-field-signal {
    position: absolute;
    left: 1.2rem; right: 1.2rem;
    bottom: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #22d3ee, transparent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.5s cubic-bezier(.2,.8,.2,1);
    pointer-events: none;
}
body.ftth-contact-page .ftth-field input:focus ~ .ftth-field-signal,
body.ftth-contact-page .ftth-field textarea:focus ~ .ftth-field-signal {
    transform: scaleX(1);
}

/* Submit button — fiber pulse */
body.ftth-contact-page .ftth-submit {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.15rem 2.2rem;
    background: linear-gradient(135deg, #22d3ee 0%, #818cf8 100%);
    color: #050714;
    border: none;
    border-radius: 999px;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.98rem;
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.35s cubic-bezier(.3,1.3,.4,1), box-shadow 0.35s ease;
    box-shadow: 0 18px 50px rgba(34, 211, 238, 0.35), inset 0 1px 0 rgba(255,255,255,0.4);
}
body.ftth-contact-page .ftth-submit:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 26px 65px rgba(34, 211, 238, 0.55), inset 0 1px 0 rgba(255,255,255,0.5);
}
body.ftth-contact-page .ftth-submit:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}
body.ftth-contact-page .ftth-submit svg { transition: transform 0.4s ease; }
body.ftth-contact-page .ftth-submit:hover svg { transform: translateX(5px); }

/* Submit photon pulse on click */
body.ftth-contact-page .ftth-submit-pulse {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: radial-gradient(circle at center, rgba(255,255,255,0.6), transparent 60%);
    opacity: 0;
    pointer-events: none;
}
body.ftth-contact-page .ftth-submit-pulse.is-firing {
    animation: ftthSubmitPulse 0.7s ease-out;
}
@keyframes ftthSubmitPulse {
    0%   { opacity: 0; transform: scale(0.7); }
    50%  { opacity: 0.9; }
    100% { opacity: 0; transform: scale(1.6); }
}

/* Side panel: WhatsApp & social links */
body.ftth-contact-page .ftth-side-card {
    background: rgba(13, 19, 48, 0.6);
    border: 1px solid rgba(120, 144, 220, 0.18);
    border-radius: 20px;
    padding: 1.6rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    text-decoration: none;
    color: inherit;
    transition: all 0.4s cubic-bezier(.2,1,.3,1);
    position: relative;
    overflow: hidden;
}
body.ftth-contact-page .ftth-side-card:hover {
    transform: translateY(-3px);
    border-color: rgba(34, 211, 238, 0.45);
    background: rgba(34, 211, 238, 0.05);
}
body.ftth-contact-page .ftth-side-icon {
    width: 44px; height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(34, 211, 238, 0.15), rgba(232, 121, 249, 0.1));
    border: 1px solid rgba(34, 211, 238, 0.3);
    display: flex; align-items: center; justify-content: center;
    color: #67e8f9;
    flex-shrink: 0;
}

/* Trust meta strip */
body.ftth-contact-page .ftth-trust-bar {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: rgba(120, 144, 220, 0.15);
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid rgba(120, 144, 220, 0.18);
    margin-top: 2rem;
}
body.ftth-contact-page .ftth-trust-bar > div {
    background: #07091c;
    padding: 1.2rem 1rem;
    text-align: center;
}
body.ftth-contact-page .ftth-trust-bar strong {
    display: block;
    font-family: 'Instrument Serif', serif;
    font-size: 1.7rem;
    color: #67e8f9;
    line-height: 1;
    margin-bottom: 0.3rem;
}
body.ftth-contact-page .ftth-trust-bar span {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.6rem;
    letter-spacing: 0.2em;
    color: #8b93b8;
    text-transform: uppercase;
}

/* Form messages */
body.ftth-contact-page .ftth-form-msg {
    padding: 1.1rem 1.3rem;
    border-radius: 14px;
    margin-bottom: 1.5rem;
    font-size: 0.94rem;
    line-height: 1.5;
    display: none;
}
body.ftth-contact-page .ftth-form-msg.is-visible { display: block; animation: ftthFadeIn 0.5s ease-out; }
@keyframes ftthFadeIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

body.ftth-contact-page .ftth-form-msg.ok {
    background: rgba(163, 230, 53, 0.08);
    border: 1px solid rgba(163, 230, 53, 0.35);
    color: #d9f99d;
}
body.ftth-contact-page .ftth-form-msg.err {
    background: rgba(248, 113, 113, 0.08);
    border: 1px solid rgba(248, 113, 113, 0.35);
    color: #fecaca;
}

/* Reveal */
body.ftth-contact-page [data-reveal] {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.9s cubic-bezier(.2,.8,.2,1), transform 0.9s cubic-bezier(.2,.8,.2,1);
    will-change: transform, opacity;
}
body.ftth-contact-page [data-reveal].is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Helpers */
body.ftth-contact-page .ftth-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: #67e8f9;
}
body.ftth-contact-page .ftth-eyebrow::before {
    content: '';
    width: 28px; height: 1px;
    background: #22d3ee;
    display: inline-block;
}
body.ftth-contact-page .ftth-gradient-text {
    background: linear-gradient(120deg, #67e8f9 0%, #e879f9 60%, #fbbf24 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

@media (max-width: 768px) {
    body.ftth-contact-page .ftth-form-card { padding: 1.8rem; }
    body.ftth-contact-page .ftth-contact-hero { min-height: 55vh; padding: 9rem 0 3rem; }
}

@media (prefers-reduced-motion: reduce) {
    body.ftth-contact-page *,
    body.ftth-contact-page *::before,
    body.ftth-contact-page *::after {
        animation-duration: 0.001ms !important;
        transition-duration: 0.001ms !important;
    }
    body.ftth-contact-page [data-reveal] { opacity: 1 !important; transform: none !important; }
}
