/*
 * AGRICRIS Family Group — Contact (Editorial)
 * PHP: page-contact.php  |  JS: assets/js/page-contact.js
 * Design: editorial warm-cream (afg-), consistent cu front-page.php / despre-noi.
 * Self-contained: tokeni --c-* scopati pe #afg-contact (home.css nu se incarca aici).
 * Formularul pastreaza campurile asteptate de aam_handle_contact_message_email().
 * ========================================================================== */

/* ==========================================================================
   RESET ASTRA + FUNDAL CREAM (clasa pe body din template)
   ========================================================================== */
body.afg-light-page .site,
body.afg-light-page .site-content,
body.afg-light-page .ast-container,
body.afg-light-page #primary,
body.afg-light-page #content {
    padding: 0 !important;
    margin: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    background: #FAF6F1 !important;
}
body.afg-light-page .ast-container { display: block !important; }
body.afg-light-page { background: #FAF6F1 !important; }
body.afg-light-page .ast-post-title,
body.afg-light-page .entry-header { display: none !important; }

/* ==========================================================================
   TOKENI + BAZA
   ========================================================================== */
#afg-contact {
    --c-cream-50: #FDFBF7;
    --c-cream-100: #FAF6F1;
    --c-cream-200: #F1E9DC;
    --c-cream-300: #E8DCC8;
    --c-ink-900: #1F1812;
    --c-ink-700: #3D2C1F;
    --c-ink-500: #6E5A47;
    --c-ink-300: #A89684;
    --c-forest-700: #2D5016;
    --c-flame-900: #7C2D12;
    --c-flame-700: #9A3412;
    --c-flame-500: #C2410C;
    --c-amber-400: #F59E0B;

    --f-display: 'Outfit', 'Times New Roman', serif;
    --f-text: 'Outfit', system-ui, sans-serif;
    --f-mono: 'JetBrains Mono', monospace;

    --r-md: 12px;
    --r-lg: 20px;

    --shadow-sm: 0 2px 6px rgba(31, 24, 18, 0.04), 0 1px 2px rgba(31, 24, 18, 0.06);
    --shadow-md: 0 10px 30px rgba(31, 24, 18, 0.08), 0 2px 6px rgba(31, 24, 18, 0.06);
    --shadow-lg: 0 30px 60px rgba(31, 24, 18, 0.18), 0 10px 20px rgba(31, 24, 18, 0.1);

    --t-fast: 0.25s ease;
    --t-smooth: 0.5s cubic-bezier(0.4, 0, 0.2, 1);

    font-family: var(--f-text);
    color: var(--c-ink-900);
    background: var(--c-cream-100);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    display: block;
}
#afg-contact *, #afg-contact *::before, #afg-contact *::after { box-sizing: border-box; }

#afg-contact .afg-wrap { max-width: 1280px; margin: 0 auto; padding: 0 32px; width: 100%; }

/* ==========================================================================
   TIPOGRAFIE
   ========================================================================== */
#afg-contact .afg-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--f-mono);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--c-flame-700);
    padding: 8px 16px;
    border: 1px solid var(--c-cream-300);
    border-radius: 100px;
    background: var(--c-cream-50);
    margin-bottom: 28px;
}
#afg-contact .afg-eyebrow::before {
    content: '';
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--c-flame-500);
    box-shadow: 0 0 0 3px rgba(194, 65, 12, 0.15);
}
#afg-contact .afg-eyebrow--light {
    color: var(--c-amber-400);
    border-color: rgba(245, 158, 11, 0.45);
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
#afg-contact .afg-eyebrow--light::before {
    background: var(--c-amber-400);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.25), 0 0 12px rgba(245, 158, 11, 0.6);
}
#afg-contact .afg-display {
    font-family: var(--f-display);
    font-weight: 300;
    font-size: clamp(2.1rem, 4.2vw, 3.4rem);
    line-height: 1.05;
    letter-spacing: -0.025em;
    color: var(--c-ink-900);
    margin-bottom: 24px;
}
#afg-contact .afg-mark {
    color: var(--c-flame-700);
    font-weight: 400;
    position: relative;
    white-space: nowrap;
}
#afg-contact .afg-mark::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: 4px;
    height: 0.35em;
    background: rgba(217, 119, 6, 0.18);
    z-index: -1;
}

/* ==========================================================================
   BUTOANE
   ========================================================================== */
#afg-contact .afg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 28px;
    font-family: var(--f-text);
    font-weight: 500;
    font-size: 0.95rem;
    border-radius: 100px;
    text-decoration: none;
    border: 1.5px solid transparent;
    cursor: pointer;
    transition: all var(--t-smooth);
}
#afg-contact .afg-btn--solid { background: var(--c-ink-900); color: var(--c-cream-50); border-color: var(--c-ink-900); }
#afg-contact .afg-btn--solid:hover { background: var(--c-flame-700); border-color: var(--c-flame-700); transform: translateY(-2px); box-shadow: 0 12px 30px rgba(154, 52, 18, 0.25); }
#afg-contact .afg-btn--ghost { background: transparent; color: #FAF6F1; border-color: rgba(250, 246, 241, 0.4); }
#afg-contact .afg-btn--ghost:hover { background: rgba(250, 246, 241, 0.12); border-color: #FAF6F1; }
#afg-contact .afg-btn--dark-ghost { background: transparent; color: var(--c-ink-900); border-color: var(--c-ink-300); }
#afg-contact .afg-btn--dark-ghost:hover { background: var(--c-ink-900); color: var(--c-cream-50); border-color: var(--c-ink-900); transform: translateY(-2px); }

/* ==========================================================================
   REVEAL
   ========================================================================== */
#afg-contact .afg-reveal { opacity: 0; transform: translateY(30px); transition: opacity 0.9s var(--t-smooth), transform 0.9s var(--t-smooth); }
#afg-contact .afg-reveal.is-visible { opacity: 1; transform: translateY(0); }
#afg-contact .afg-reveal--delay { transition-delay: 0.15s; }
@media (prefers-reduced-motion: reduce) { #afg-contact .afg-reveal { opacity: 1; transform: none; transition: none; } }

/* ==========================================================================
   1. HERO COMPACT
   ========================================================================== */
#afg-contact .afg-ct-hero {
    position: relative;
    display: flex;
    align-items: flex-end;
    min-height: 62vh;
    overflow: hidden;
    color: #FAF6F1;
    isolation: isolate;
}
#afg-contact .afg-ct-hero__media { position: absolute; inset: 0; z-index: -1; background: linear-gradient(135deg, #2D1810, #7C2D12); }
#afg-contact .afg-ct-hero__media img { width: 100%; height: 100%; object-fit: cover; filter: saturate(1.02) contrast(1.05) brightness(0.85); animation: afgCtZoom 18s ease-out forwards; }
@keyframes afgCtZoom { from { transform: scale(1.12); } to { transform: scale(1.02); } }
#afg-contact .afg-ct-hero__overlay {
    position: absolute; inset: 0;
    background:
        linear-gradient(105deg, rgba(8,4,2,0.85) 0%, rgba(8,4,2,0.5) 45%, rgba(8,4,2,0.3) 75%, rgba(8,4,2,0.5) 100%),
        linear-gradient(180deg, rgba(8,4,2,0.5) 0%, rgba(8,4,2,0) 35%, rgba(8,4,2,0) 55%, rgba(8,4,2,0.9) 100%),
        radial-gradient(ellipse at 22% 65%, rgba(194,65,12,0.18) 0%, transparent 55%);
}
#afg-contact .afg-ct-hero__inner { position: relative; z-index: 1; padding: clamp(180px, 20vh, 240px) 32px clamp(60px, 9vh, 100px); }
#afg-contact .afg-ct-hero__title {
    font-family: var(--f-display);
    font-weight: 300;
    font-size: clamp(2.4rem, 6vw, 4.6rem);
    line-height: 1;
    letter-spacing: -0.035em;
    margin-bottom: 24px;
    max-width: 16ch;
    color: #FAF6F1;
    text-shadow: 0 2px 24px rgba(0,0,0,0.85), 0 1px 4px rgba(0,0,0,0.7);
}
#afg-contact .afg-ct-hero__title em { font-style: italic; font-weight: 300; color: var(--c-amber-400); text-shadow: 0 2px 24px rgba(0,0,0,0.85), 0 0 30px rgba(245,158,11,0.45); }
#afg-contact .afg-ct-hero__lead {
    font-size: clamp(1.02rem, 1.4vw, 1.22rem);
    line-height: 1.65;
    color: rgba(253,248,243,0.96);
    max-width: 58ch;
    text-shadow: 0 2px 16px rgba(0,0,0,0.85), 0 1px 3px rgba(0,0,0,0.6);
}

/* ==========================================================================
   2. INFO + FORMULAR
   ========================================================================== */
#afg-contact .afg-ct-main { padding: 120px 0; background: var(--c-cream-100); }
#afg-contact .afg-ct-grid {
    display: grid;
    grid-template-columns: 0.85fr 1.15fr;
    gap: 64px;
    align-items: start;
}

/* --- canale --- */
#afg-contact .afg-ct-channels { display: flex; flex-direction: column; gap: 14px; margin-top: 8px; }
#afg-contact .afg-ct-channel {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 18px 20px;
    background: var(--c-cream-50);
    border: 1px solid var(--c-cream-300);
    border-radius: var(--r-md);
    text-decoration: none;
    color: var(--c-ink-900);
    transition: all var(--t-fast);
}
#afg-contact .afg-ct-channel:hover {
    transform: translateX(6px);
    border-color: var(--c-flame-500);
    box-shadow: var(--shadow-sm);
}
#afg-contact .afg-ct-channel__icon {
    flex-shrink: 0;
    width: 48px; height: 48px;
    border-radius: 50%;
    background: var(--c-cream-200);
    display: flex; align-items: center; justify-content: center;
    color: var(--c-flame-700);
    transition: all var(--t-fast);
}
#afg-contact .afg-ct-channel__icon svg { width: 22px; height: 22px; }
#afg-contact .afg-ct-channel:hover .afg-ct-channel__icon { background: var(--c-flame-500); color: #fff; }
#afg-contact .afg-ct-channel--wa:hover .afg-ct-channel__icon { background: #25D366; }
#afg-contact .afg-ct-channel__body { display: flex; flex-direction: column; gap: 3px; }
#afg-contact .afg-ct-channel__body strong {
    font-weight: 500;
    font-size: 0.74rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--c-ink-500);
}
#afg-contact .afg-ct-channel__body em { font-style: normal; font-weight: 500; font-size: 1.04rem; color: var(--c-ink-900); }
#afg-contact .afg-ct-legal {
    margin-top: 24px;
    font-family: var(--f-mono);
    font-size: 0.76rem;
    letter-spacing: 0.04em;
    color: var(--c-ink-500);
    line-height: 1.6;
}

/* --- formular --- */
#afg-contact .afg-ct-form-card {
    background: #fff;
    border: 1px solid var(--c-cream-300);
    border-radius: var(--r-lg);
    padding: 44px 42px;
    box-shadow: var(--shadow-lg);
}
#afg-contact .afg-ct-form__title {
    font-family: var(--f-display);
    font-weight: 400;
    font-size: 2rem;
    color: var(--c-ink-900);
    margin-bottom: 8px;
}
#afg-contact .afg-ct-form__sub { color: var(--c-ink-500); font-size: 0.98rem; margin-bottom: 30px; line-height: 1.6; }
#afg-contact .afg-ct-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
#afg-contact .afg-ct-field { margin-bottom: 18px; display: flex; flex-direction: column; }
#afg-contact .afg-ct-field label {
    font-family: var(--f-mono);
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--c-ink-700);
    margin-bottom: 8px;
}
#afg-contact .afg-ct-field input,
#afg-contact .afg-ct-field textarea,
#afg-contact .afg-ct-field select {
    width: 100%;
    font-family: var(--f-text);
    font-size: 1rem;
    color: var(--c-ink-900);
    background: var(--c-cream-50);
    border: 1.5px solid var(--c-cream-300);
    border-radius: 10px;
    padding: 13px 15px;
    transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
    -webkit-appearance: none;
    appearance: none;
}
#afg-contact .afg-ct-field textarea { resize: vertical; min-height: 110px; line-height: 1.6; }
#afg-contact .afg-ct-field input::placeholder,
#afg-contact .afg-ct-field textarea::placeholder { color: var(--c-ink-300); }
#afg-contact .afg-ct-field input:focus,
#afg-contact .afg-ct-field textarea:focus,
#afg-contact .afg-ct-field select:focus {
    outline: none;
    background: #fff;
    border-color: var(--c-flame-500);
    box-shadow: 0 0 0 3px rgba(194, 65, 12, 0.12);
}
#afg-contact .afg-ct-select { position: relative; }
#afg-contact .afg-ct-select svg {
    position: absolute;
    right: 14px; top: 50%;
    transform: translateY(-50%);
    width: 18px; height: 18px;
    color: var(--c-ink-500);
    pointer-events: none;
}
#afg-contact .afg-ct-select select { padding-right: 40px; cursor: pointer; }
#afg-contact .afg-ct-submit { width: 100%; margin-top: 8px; }
#afg-contact .afg-ct-submit__icon { width: 18px; height: 18px; }
#afg-contact .afg-ct-submit.is-loading { pointer-events: none; opacity: 0.85; }
#afg-contact .afg-ct-submit.is-loading .afg-ct-submit__icon { animation: afgSpin 0.8s linear infinite; }
@keyframes afgSpin { to { transform: rotate(360deg); } }
#afg-contact .afg-ct-form__note {
    margin-top: 16px;
    text-align: center;
    font-size: 0.82rem;
    color: var(--c-ink-500);
}

/* --- success state --- */
#afg-contact .afg-ct-success {
    display: none;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px 10px;
}
#afg-contact .afg-ct-success.is-visible { display: flex; }
#afg-contact .afg-ct-success__icon {
    width: 76px; height: 76px;
    border-radius: 50%;
    background: var(--c-forest-700);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 22px;
    box-shadow: 0 10px 30px rgba(45, 80, 22, 0.3);
    animation: afgPop 0.5s var(--t-smooth) both;
}
#afg-contact .afg-ct-success__icon svg { width: 36px; height: 36px; }
@keyframes afgPop { from { transform: scale(0.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
#afg-contact .afg-ct-success .afg-ct-form__sub { max-width: 42ch; }
#afg-contact .afg-ct-success .afg-btn { margin-top: 10px; }

/* ==========================================================================
   3. HARTA
   ========================================================================== */
#afg-contact .afg-ct-map-section { padding: 0 0 120px; background: var(--c-cream-100); }
#afg-contact .afg-ct-map {
    border-radius: var(--r-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--c-cream-300);
    line-height: 0;
}
#afg-contact .afg-ct-map iframe {
    width: 100%;
    height: 460px;
    border: 0;
    display: block;
    filter: grayscale(0.2) contrast(1.05);
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 1024px) {
    #afg-contact .afg-ct-grid { grid-template-columns: 1fr; gap: 48px; }
}
@media (max-width: 768px) {
    #afg-contact .afg-wrap { padding: 0 20px; }
    #afg-contact .afg-ct-main { padding: 80px 0; }
    #afg-contact .afg-ct-map-section { padding: 0 0 80px; }
    #afg-contact .afg-ct-row { grid-template-columns: 1fr; gap: 0; }
    #afg-contact .afg-ct-form-card { padding: 32px 24px; }
    #afg-contact .afg-ct-map iframe { height: 340px; }
}
