/* =============================================================================
   pages/contact.css
   ----
   Full bespoke design system for /contact (cp-* prefix). Dark theme.
   Sections:
     1. Hero decorations + kicker
     2. Layout grid (form + info)
     3. Form card (cp-form, cp-field, validation states)
     4. Info card (cp-info)
     5. Quick action cards (cp-quick)
     6. Social grid (cp-social)
     7. Map embed (cp-map)
     8. Alert banners (cp-alert)
   ========================================================================== */

/* =============================================================================
   1. HERO DECORATIONS  +  KICKER BADGE
   ========================================================================== */

/* envelope, chat bubble, headset — three icons of communication */
.contact-deco {
    position: absolute;
    pointer-events: none;
    user-select: none;
    z-index: 1;
    display: grid; place-items: center;
    border-radius: var(--r-md);
}
@media (max-width: 980px) { .contact-deco { display: none; } }

.contact-deco--envelope {
    top: -28px; left: 36px;
    width: 102px; height: 102px;
    font-size: 2.4rem;
    transform: rotate(-10deg);
    background: linear-gradient(135deg, rgba(255, 211, 74, .14), rgba(255, 194, 24, .06));
    border: 1px solid var(--gold-line);
    color: var(--gold-300);
    box-shadow: 0 14px 36px rgba(0, 0, 0, .35);
    opacity: .92;
}
.contact-deco--chat {
    top: 78px; left: 152px;
    width: 80px; height: 80px;
    font-size: 1.8rem;
    transform: rotate(8deg);
    background: linear-gradient(135deg, rgba(65, 84, 173, .25), rgba(54, 71, 130, .12));
    border: 1px solid rgba(138, 150, 209, .22);
    color: var(--navy-200);
    border-radius: 22px;
    opacity: .82;
}
.contact-deco--headset {
    top: 158px; left: 50px;
    width: 60px; height: 60px;
    font-size: 1.4rem;
    transform: rotate(-6deg);
    background: rgba(255, 194, 24, .04);
    border: 1px dashed rgba(255, 194, 24, .55);
    color: var(--gold-400);
    border-radius: 16px;
    opacity: .85;
}

.cp-kicker {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 6px 14px;
    border-radius: var(--r-pill);
    background: rgba(255, 194, 24, .10);
    border: 1px solid var(--gold-line);
    color: var(--gold-300);
    font-size: .78rem;
    font-weight: 800;
    margin-bottom: 14px;
    backdrop-filter: blur(8px);
}
.cp-kicker::before {
    content: ""; width: 7px; height: 7px; border-radius: 50%;
    background: var(--gold-500);
    box-shadow: 0 0 0 4px rgba(255, 194, 24, .22), 0 0 14px rgba(255, 194, 24, .55);
}

/* =============================================================================
   2. LAYOUT  —  form on right, info on left
   ========================================================================== */
.cp-wrap {
    /* uses .container — no extra width tweaks needed */
}

.cp-grid {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 24px;
    align-items: start;
    margin-bottom: 28px;
}
@media (max-width: 980px) {
    .cp-grid { grid-template-columns: 1fr; gap: 18px; }
}

/* =============================================================================
   3. FORM CARD
   ========================================================================== */
.cp-card {
    padding: 28px 28px 24px;
    border-radius: var(--r-lg);
    background: var(--surface-1);
    border: 1px solid var(--line);
    backdrop-filter: blur(6px);
    box-shadow: var(--shadow-sm);
}
@media (max-width: 640px) {
    .cp-card { padding: 22px 18px 20px; border-radius: var(--r-md); }
}

.cp-card__head {
    display: flex; align-items: center; gap: 14px;
    margin-bottom: 22px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line);
}
.cp-card__icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    display: grid; place-items: center;
    background: linear-gradient(135deg, var(--gold-300), var(--gold-500));
    color: var(--navy-900);
    font-size: 1.2rem;
    box-shadow: var(--shadow-gold);
    flex-shrink: 0;
}
.cp-card__title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--ink-white);
}
.cp-card__subtitle {
    margin: 2px 0 0;
    font-size: .85rem;
    color: var(--ink-muted);
}

/* — Form layout — */
.cp-form { display: flex; flex-direction: column; gap: 16px; }
.cp-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
@media (max-width: 560px) {
    .cp-row { grid-template-columns: 1fr; }
}

/* — Field block — */
.cp-field {
    display: flex; flex-direction: column; gap: 6px;
    position: relative;
}
.cp-field__label {
    display: inline-flex; align-items: center; gap: 6px;
    color: var(--ink-soft);
    font-size: .9rem;
    font-weight: 700;
}
.cp-field__label i { color: var(--gold-400); }
.cp-req {
    color: var(--gold-500);
    font-weight: 900;
}

/* — Inputs (Django will render <input>/<textarea>; we style them generically) — */
.cp-field input,
.cp-field textarea,
.cp-field select {
    width: 100%;
    padding: 12px 16px;
    background: var(--surface-1);
    color: var(--ink-white);
    border: 1.5px solid var(--line-strong);
    border-radius: var(--r);
    font-family: inherit;
    font-size: .95rem;
    transition: border-color var(--t-fast), background var(--t-fast),
                box-shadow var(--t-fast);
    -webkit-appearance: none;
    appearance: none;
}
.cp-field textarea {
    min-height: 140px;
    resize: vertical;
    line-height: 1.85;
}
.cp-field input:hover,
.cp-field textarea:hover,
.cp-field select:hover {
    border-color: var(--line-strong);
    background: var(--surface-2);
}
.cp-field input:focus,
.cp-field textarea:focus,
.cp-field select:focus {
    outline: none;
    border-color: var(--gold-500);
    background: var(--surface-2);
    box-shadow: 0 0 0 4px rgba(255, 194, 24, .12);
}
.cp-field input::placeholder,
.cp-field textarea::placeholder {
    color: var(--ink-faint);
}

/* — Hints & errors — */
.cp-field__hint {
    margin: 0;
    font-size: .78rem;
    color: var(--ink-muted);
    display: inline-flex; align-items: center; gap: 5px;
}
.cp-field__hint i { color: var(--gold-400); font-size: .9em; }
.cp-field--error input,
.cp-field--error textarea,
.cp-field--error select {
    border-color: rgba(239, 68, 68, .6);
    background: rgba(239, 68, 68, .04);
}
.cp-field--error input:focus,
.cp-field--error textarea:focus {
    border-color: rgba(239, 68, 68, .85);
    box-shadow: 0 0 0 4px rgba(239, 68, 68, .14);
}
.cp-field--error .cp-field__hint {
    color: #fca5a5;
}
.cp-field--error .cp-field__hint i { color: #f87171; }

/* — Character counter — */
.cp-field__counter {
    margin: 0;
    text-align: end;
    font-size: .76rem;
    color: var(--ink-faint);
    font-variant-numeric: tabular-nums;
    transition: color var(--t-fast);
}
.cp-field__counter.is-near-limit { color: var(--gold-400); }
.cp-field__counter.is-over-limit { color: #f87171; font-weight: 700; }

/* — Form footer (note + submit) — */
.cp-form-actions {
    display: flex; align-items: center; justify-content: space-between;
    gap: 14px; flex-wrap: wrap;
    margin-top: 4px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}
.cp-form-note {
    margin: 0;
    display: inline-flex; align-items: center; gap: 6px;
    font-size: .8rem;
    color: var(--ink-muted);
}
.cp-form-note i { color: var(--gold-400); }

.cp-btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 12px 26px;
    border-radius: var(--r-pill);
    border: none;
    font-family: inherit;
    font-weight: 800; font-size: .92rem;
    cursor: pointer;
    transition: transform var(--t-fast), box-shadow var(--t-fast);
}
.cp-btn:disabled { opacity: .6; cursor: not-allowed; }
.cp-btn--primary {
    background: linear-gradient(135deg, var(--gold-300), var(--gold-500), var(--gold-600));
    color: var(--navy-900);
    box-shadow: var(--shadow-gold);
    position: relative; overflow: hidden;
}
.cp-btn--primary::before {
    content: ""; position: absolute; top: 0; bottom: 0; left: -85%; width: 50%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent);
    transform: skewX(-22deg); transition: left .85s ease; pointer-events: none;
}
.cp-btn--primary:hover { transform: translateY(-2px); }
.cp-btn--primary:hover::before { left: 130%; }

/* =============================================================================
   4. INFO CARD (right sidebar in desktop)
   ========================================================================== */
.cp-info {
    padding: 24px 22px;
    border-radius: var(--r-lg);
    background: linear-gradient(180deg,
        rgba(65, 84, 173, .10) 0%,
        rgba(28, 36, 71, .35) 100%);
    border: 1px solid var(--line);
    backdrop-filter: blur(10px);
}
.cp-info__head { margin-bottom: 18px; }
.cp-info__title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--ink-white);
    display: inline-flex; align-items: center; gap: 8px;
}
.cp-info__title i { color: var(--gold-400); }
.cp-info__sub {
    margin: 6px 0 0;
    font-size: .82rem;
    color: var(--ink-muted);
}

.cp-info__list {
    list-style: none; padding: 0; margin: 0;
    display: flex; flex-direction: column; gap: 8px;
}
.cp-info__row {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 14px;
    border-radius: var(--r);
    background: var(--surface-1);
    border: 1px solid var(--line);
    color: var(--ink-soft);
    text-decoration: none;
    transition: all var(--t-fast);
}
.cp-info__row:hover {
    border-color: var(--gold-line);
    background: var(--surface-gold);
    transform: translateX(-2px);
}
.cp-info__row-icon {
    width: 38px; height: 38px;
    border-radius: 10px;
    display: grid; place-items: center;
    background: var(--surface-gold);
    color: var(--gold-300);
    font-size: 1rem;
    flex-shrink: 0;
}
.cp-info__row-body { flex: 1; min-width: 0; }
.cp-info__row-label {
    margin: 0;
    font-size: .76rem;
    color: var(--ink-muted);
    font-weight: 600;
}
.cp-info__row-value {
    margin: 1px 0 0;
    font-size: .92rem;
    font-weight: 700;
    color: var(--ink-white);
    word-break: break-word;
}

/* =============================================================================
   5. QUICK ACTION CARDS (3-up row below grid)
   ========================================================================== */
.cp-quick {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 32px;
}
@media (max-width: 880px) { .cp-quick { grid-template-columns: 1fr; } }

.cp-quick-card {
    display: flex; align-items: center; gap: 14px;
    padding: 18px 20px;
    border-radius: var(--r);
    background: var(--surface-1);
    border: 1px solid var(--line);
    color: var(--ink-soft);
    text-decoration: none;
    transition: all var(--t-fast);
}
.cp-quick-card:hover {
    border-color: var(--gold-line);
    background: var(--surface-gold);
    transform: translateY(-3px);
}
.cp-quick-card__icon {
    width: 44px; height: 44px;
    border-radius: 12px;
    display: grid; place-items: center;
    background: var(--surface-gold);
    color: var(--gold-300);
    font-size: 1.2rem;
    flex-shrink: 0;
}
.cp-quick-card--navy .cp-quick-card__icon {
    background: linear-gradient(135deg, var(--navy-500), var(--navy-700));
    color: var(--ink-white);
}
.cp-quick-card__body { flex: 1; min-width: 0; }
.cp-quick-card__label {
    margin: 0;
    font-size: .76rem;
    color: var(--ink-muted);
    font-weight: 600;
}
.cp-quick-card__value {
    margin: 2px 0 0;
    font-size: .92rem;
    font-weight: 800;
    color: var(--ink-white);
    direction: ltr;
    word-break: break-word;
}
.cp-quick-card--navy .cp-quick-card__value { direction: rtl; }

/* =============================================================================
   6. SOCIAL GRID
   ========================================================================== */
.cp-social {
    margin-bottom: 32px;
    padding: 26px;
    border-radius: var(--r-lg);
    background: var(--surface-1);
    border: 1px solid var(--line);
}
.cp-social__head { margin-bottom: 18px; }
.cp-social__title {
    margin: 0;
    font-size: 1.05rem; font-weight: 800;
    color: var(--ink-white);
    display: inline-flex; align-items: center;
}
.cp-social__sub {
    margin: 4px 0 0;
    font-size: .82rem; color: var(--ink-muted);
}

.cp-social__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}
@media (max-width: 720px) { .cp-social__grid { grid-template-columns: repeat(2, 1fr); } }

.cp-social__tile {
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    padding: 18px 12px;
    border-radius: var(--r);
    background: var(--surface-2);
    border: 1px solid var(--line-strong);
    color: var(--ink-soft);
    text-decoration: none;
    transition: all var(--t-fast);
}
.cp-social__tile:hover {
    transform: translateY(-3px);
    background: var(--surface-3);
}
.cp-social__tile-icon {
    width: 44px; height: 44px;
    border-radius: 12px;
    display: grid; place-items: center;
    font-size: 1.4rem;
    background: var(--surface-gold);
    color: var(--gold-300);
    transition: all var(--t-fast);
}
.cp-social__tile-label {
    margin: 0;
    font-size: .85rem;
    font-weight: 700;
    color: var(--ink-white);
}

/* Brand-tinted tiles on hover (faithful brand colors but in a dark-friendly way) */
.cp-social__tile--telegram:hover {
    border-color: rgba(34, 158, 217, .50);
    background: rgba(34, 158, 217, .10);
}
.cp-social__tile--telegram:hover .cp-social__tile-icon {
    background: rgba(34, 158, 217, .25); color: #5dd0f5;
}
.cp-social__tile--whatsapp:hover {
    border-color: rgba(37, 211, 102, .50);
    background: rgba(37, 211, 102, .10);
}
.cp-social__tile--whatsapp:hover .cp-social__tile-icon {
    background: rgba(37, 211, 102, .25); color: #5fec98;
}
.cp-social__tile--instagram:hover {
    border-color: rgba(225, 48, 108, .50);
    background: rgba(225, 48, 108, .10);
}
.cp-social__tile--instagram:hover .cp-social__tile-icon {
    background: rgba(225, 48, 108, .25); color: #ff7aa9;
}
.cp-social__tile--linkedin:hover {
    border-color: rgba(10, 102, 194, .50);
    background: rgba(10, 102, 194, .10);
}
.cp-social__tile--linkedin:hover .cp-social__tile-icon {
    background: rgba(10, 102, 194, .25); color: #4d9cdb;
}

/* =============================================================================
   7. MAP
   ========================================================================== */
.cp-map {
    margin-bottom: 40px;
    padding: 26px;
    border-radius: var(--r-lg);
    background: var(--surface-1);
    border: 1px solid var(--line);
}
.cp-map__head {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 12px;
    margin-bottom: 16px;
}
.cp-map__title {
    margin: 0;
    font-size: 1.05rem; font-weight: 800;
    color: var(--ink-white);
    display: inline-flex; align-items: center; gap: 8px;
}
.cp-map__title i { color: var(--gold-400); }
.cp-map__directions {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 14px;
    border-radius: var(--r-pill);
    background: var(--surface-2);
    border: 1px solid var(--line-strong);
    color: var(--ink-soft);
    font-size: .82rem;
    font-weight: 700;
    text-decoration: none;
    transition: all var(--t-fast);
}
.cp-map__directions:hover {
    border-color: var(--gold-line);
    color: var(--gold-300);
    background: var(--surface-gold);
}

.cp-map__frame {
    aspect-ratio: 16 / 7;
    border-radius: var(--r);
    overflow: hidden;
    background: var(--navy-900);
    border: 1px solid var(--line);
    position: relative;
}
.cp-map__frame iframe {
    width: 100%; height: 100%;
    border: none;
    /* Subtle blend so the map doesn't pop bright on dark */
    filter: invert(.92) hue-rotate(180deg) saturate(.7) brightness(.95);
}
.cp-map__placeholder {
    position: absolute; inset: 0;
    display: grid; place-items: center; gap: 6px;
    color: var(--ink-muted);
    text-align: center;
    padding: 30px;
}
.cp-map__placeholder i {
    font-size: 2.4rem;
    color: var(--gold-400);
    opacity: .7;
}
.cp-map__placeholder strong { color: var(--ink-white); font-weight: 800; }

/* =============================================================================
   8. ALERT BANNERS
   ========================================================================== */
.cp-alerts {
    display: flex; flex-direction: column; gap: 8px;
    margin-bottom: 16px;
}
.cp-alert {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 16px;
    border-radius: var(--r);
    border: 1px solid var(--line);
    font-size: .9rem;
    font-weight: 600;
}
.cp-alert i { font-size: 1.1rem; flex-shrink: 0; }
.cp-alert--success {
    background: rgba(16, 185, 129, .08);
    border-color: rgba(16, 185, 129, .35);
    color: #6ee7b7;
}
.cp-alert--success i { color: #34d399; }
.cp-alert--error,
.cp-alert--danger {
    background: rgba(239, 68, 68, .08);
    border-color: rgba(239, 68, 68, .35);
    color: #fca5a5;
}
.cp-alert--error i,
.cp-alert--danger i { color: #f87171; }
.cp-alert--info {
    background: rgba(255, 194, 24, .08);
    border-color: var(--gold-line);
    color: var(--gold-300);
}
.cp-alert--info i { color: var(--gold-400); }

/* =============================================================================
   9. LIGHT-MODE OVERRIDES
   ========================================================================== */
[data-theme="light"] .cp-info {
    background: linear-gradient(180deg, rgba(255, 255, 255, .85), rgba(247, 249, 252, .9));
}
[data-theme="light"] .cp-info__title i,
[data-theme="light"] .cp-map__title i { color: var(--gold-700); }
[data-theme="light"] .cp-info__row-icon,
[data-theme="light"] .cp-quick-card__icon { color: var(--gold-700); }
[data-theme="light"] .cp-info__row-value { color: var(--navy-900); }
[data-theme="light"] .cp-quick-card__value { color: var(--navy-900); }
[data-theme="light"] .cp-quick-card--navy .cp-quick-card__icon { color: #ffffff; }
[data-theme="light"] .cp-quick-card--navy .cp-quick-card__value { color: #ffffff; }
[data-theme="light"] .cp-social__tile-icon { color: var(--gold-700); }
[data-theme="light"] .cp-social__tile-label { color: var(--navy-900); }
[data-theme="light"] .cp-kicker { color: var(--gold-700); }
[data-theme="light"] .cp-form-note i { color: var(--gold-700); }
[data-theme="light"] .cp-field__label i { color: var(--gold-700); }

/* CRITICAL: remove the dark-mode invert filter on the map iframe in light mode */
[data-theme="light"] .cp-map__frame iframe { filter: none; }
[data-theme="light"] .cp-map__placeholder i { color: var(--gold-700); }

/* Alert colors stay readable on light bg */
[data-theme="light"] .cp-alert--success { color: #065f46; background: rgba(16, 185, 129, .10); }
[data-theme="light"] .cp-alert--success i { color: #059669; }
[data-theme="light"] .cp-alert--error,
[data-theme="light"] .cp-alert--danger { color: #991b1b; background: rgba(239, 68, 68, .10); }
[data-theme="light"] .cp-alert--error i,
[data-theme="light"] .cp-alert--danger i { color: #dc2626; }
[data-theme="light"] .cp-alert--info { color: var(--gold-700); }
[data-theme="light"] .cp-field--error .cp-field__hint { color: #991b1b; }
[data-theme="light"] .cp-field--error .cp-field__hint i { color: #dc2626; }
