/* ==========================================================================
   TZFoundry Global Footer — Styles
   Design tokens sourced from DNA.md
   Zero inline code — this file is bundled separately.
   ========================================================================== */

/* --- Design Tokens --- */
:root {
    --tz-primary: #0F172A;
    --tz-primary-950: #020617;
    --tz-primary-800: #1E293B;
    --tz-primary-light: #1E3A5F;
    --tz-cta: #16A34A;
    --tz-cta-hover: #15803D;
    --tz-cta-light: #22C55E;
    --tz-accent: #D97706;
    --tz-accent-light: #F59E0B;
    --tz-neutral-50: #F8FAFC;
    --tz-neutral-200: #E2E8F0;
    --tz-neutral-400: #94A3B8;
    --tz-neutral-500: #64748B;
    --tz-neutral-600: #475569;
    --tz-wa-green: #25D366;
    --tz-wa-dark: #075E54;
    --tz-wa-body: #E5DDD5;
}

/* ==========================================================================
   FOOTER — Main Block
   ========================================================================== */

.tz-footer {
    background-color: var(--tz-primary);
    background-image:
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    color: #fff;
}

.tz-footer__inner {
    max-width: 80rem;
    margin: 0 auto;
    padding: 5rem 1.5rem 4rem;
}

/* --- 4-Column Grid --- */
.tz-footer__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
}
@media (min-width: 768px) {
    .tz-footer__grid {
        grid-template-columns: 1fr 1fr;
        gap: 3rem 2.5rem;
    }
}
@media (min-width: 1024px) {
    .tz-footer__grid {
        grid-template-columns: 1.4fr 1fr 1fr 1fr;
        gap: 3rem;
    }
}

/* --- Brand Column --- */
.tz-footer__logo-link {
    display: inline-block;
    margin-bottom: 1.5rem;
    transition: opacity 0.2s;
}
.tz-footer__logo-link:hover {
    opacity: 0.8;
}
.tz-footer__logo {
    height: 2.25rem;
    width: auto;
    /* Ensures visibility on dark bg — flip if logo is dark-on-transparent */
    filter: brightness(0) invert(1);
}

.tz-footer__tagline {
    color: rgba(255,255,255,0.55);
    font-size: 0.875rem;
    line-height: 1.7;
    margin: 0 0 1.75rem;
    max-width: 320px;
}

/* Contact list */
.tz-footer__contact-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}
.tz-footer__contact-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}
.tz-footer__contact-icon {
    width: 1.125rem;
    height: 1.125rem;
    color: var(--tz-accent);
    flex-shrink: 0;
    margin-top: 0.15rem;
}
.tz-footer__contact-link,
.tz-footer__contact-text {
    color: rgba(255,255,255,0.6);
    font-size: 0.875rem;
    text-decoration: none;
    transition: color 0.15s;
    line-height: 1.5;
}
.tz-footer__contact-link:hover {
    color: #fff;
}

/* --- Navigation Columns --- */
.tz-footer__col-heading {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 1.5rem;
    letter-spacing: 0.01em;
}
.tz-footer__nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.tz-footer__nav-link {
    color: rgba(255,255,255,0.6);
    font-size: 0.875rem;
    text-decoration: none;
    transition: color 0.15s;
    line-height: 1.5;
}
.tz-footer__nav-link:hover {
    color: #fff;
}
.tz-footer__nav-link--sub {
    color: rgba(255,255,255,0.45);
    font-size: 0.8125rem;
}
.tz-footer__nav-link--sub:hover {
    color: rgba(255,255,255,0.85);
}
.tz-footer__nav-divider {
    display: block;
    width: 2rem;
    height: 1px;
    background: rgba(255,255,255,0.1);
    margin: 0.875rem 0;
}

/* --- Bottom Bar --- */
.tz-footer__bottom {
    background-color: var(--tz-primary-950);
    border-top: 1px solid rgba(255,255,255,0.05);
}
.tz-footer__bottom-inner {
    max-width: 80rem;
    margin: 0 auto;
    padding: 1.5rem;
    text-align: center;
}
.tz-footer__copyright {
    color: var(--tz-neutral-500);
    font-size: 0.8125rem;
    margin: 0;
    line-height: 1.6;
}

/* ==========================================================================
   WHATSAPP CHAT PANEL — Tidio-style conversational dialog
   ========================================================================== */

.tz-wa {
    position: fixed;
    bottom: 100px;
    right: 1.5rem;
    width: 370px;
    max-width: calc(100vw - 2rem);
    border-radius: 1rem;
    box-shadow:
        0 12px 40px rgba(0,0,0,0.25),
        0 0 0 1px rgba(255,255,255,0.05);
    z-index: 9999;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    font-family: 'Inter', system-ui, sans-serif;

    /* Hidden state */
    opacity: 0;
    visibility: hidden;
    transform: translateY(16px) scale(0.96);
    transform-origin: bottom right;
    transition:
        opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        visibility 0.3s,
        transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.tz-wa.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Header */
.tz-wa__header {
    background: var(--tz-wa-dark);
    padding: 1.125rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}
.tz-wa__header-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}
.tz-wa__avatar {
    width: 2.5rem;
    height: 2.5rem;
    background: var(--tz-wa-green);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.tz-wa__avatar svg {
    width: 1.375rem;
    height: 1.375rem;
    color: #fff;
}
.tz-wa__header-text {
    display: flex;
    flex-direction: column;
    gap: 0.1875rem;
    min-width: 0;
}
.tz-wa__title {
    color: #fff;
    font-weight: 600;
    font-size: 0.9375rem;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tz-wa__subtitle {
    color: rgba(255,255,255,0.65);
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    line-height: 1.3;
}
.tz-wa__online-dot {
    width: 0.5rem;
    height: 0.5rem;
    background: var(--tz-wa-green);
    border-radius: 50%;
    flex-shrink: 0;
    animation: tz-pulse 2s ease-in-out infinite;
}
@keyframes tz-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.tz-wa__close {
    background: none;
    border: none;
    color: rgba(255,255,255,0.7);
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.25rem;
    transition: color 0.15s;
    flex-shrink: 0;
}
.tz-wa__close:hover {
    color: #fff;
}

/* Chat Body — WhatsApp-style warm bg */
.tz-wa__body {
    background-color: var(--tz-wa-body);
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 5 L35 15 L30 12 L25 15Z' fill='%23d4ccc4' opacity='0.3'/%3E%3C/svg%3E");
    padding: 1.25rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Welcome bubble */
.tz-wa__bubble {
    background: #fff;
    border-radius: 0 0.75rem 0.75rem 0.75rem;
    padding: 0.875rem 1rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
    max-width: 90%;
}
.tz-wa__bubble p {
    margin: 0;
    font-size: 0.8125rem;
    line-height: 1.6;
    color: #1a1a1a;
}

/* Lead-gating form */
.tz-wa__form {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}
.tz-wa__field input,
.tz-wa__field textarea {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.8125rem;
    font-family: inherit;
    background: #fff;
    color: #1a1a1a;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
}
.tz-wa__field input:focus,
.tz-wa__field textarea:focus {
    outline: none;
    border-color: var(--tz-wa-green);
    box-shadow: 0 0 0 3px rgba(37,211,102,0.15);
}
.tz-wa__field input::placeholder,
.tz-wa__field textarea::placeholder {
    color: #9ca3af;
}
.tz-wa__field textarea {
    resize: vertical;
    min-height: 3.5rem;
}

/* Inline validation error */
.tz-wa__field--error input,
.tz-wa__field--error textarea {
    border-color: #ef4444;
}
.tz-wa__error-msg {
    font-size: 0.6875rem;
    color: #ef4444;
    margin-top: 0.25rem;
    display: none;
}
.tz-wa__field--error .tz-wa__error-msg {
    display: block;
}

/* Submit button */
.tz-wa__submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--tz-wa-green);
    color: #fff;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background-color 0.15s, transform 0.1s;
    margin-top: 0.25rem;
}
.tz-wa__submit:hover {
    background: #20bd5a;
}
.tz-wa__submit:active {
    transform: scale(0.98);
}
.tz-wa__submit svg {
    width: 1.125rem;
    height: 1.125rem;
    flex-shrink: 0;
}

/* Panel Footer */
.tz-wa__footer {
    background: #fff;
    border-top: 1px solid #e5e7eb;
    padding: 0.625rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.6875rem;
    color: #9ca3af;
}
.tz-wa__powered-dot {
    width: 0.375rem;
    height: 0.375rem;
    background: var(--tz-wa-green);
    border-radius: 50%;
    flex-shrink: 0;
}
.tz-wa__powered-status {
    color: var(--tz-wa-green);
    font-weight: 500;
}
.tz-wa__powered-sep {
    color: #d1d5db;
}
.tz-wa__powered-by {
    color: #9ca3af;
}
.tz-wa__footer-logo {
    height: 0.6875rem;
    width: auto;
    /* Dark logo on white panel bg — no filter needed.
       If logo is white-on-transparent, use: filter: brightness(0); */
    opacity: 0.6;
    margin-left: 0.125rem;
}

/* ==========================================================================
   FLOATING ACTION BUTTONS
   ========================================================================== */

.tz-fab {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 9998;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
}

.tz-fab__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0,0,0,0.2);
    transition: transform 0.2s, box-shadow 0.2s, opacity 0.3s, visibility 0.3s;
}
.tz-fab__btn:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}
.tz-fab__btn:active {
    transform: scale(0.96);
}

/* Back to top */
.tz-fab__btn--top {
    width: 2.75rem;
    height: 2.75rem;
    background: var(--tz-primary-800);
    color: #fff;
    /* Hidden by default, shown via JS on scroll */
    opacity: 0;
    visibility: hidden;
    transform: translateY(0.5rem);
}
.tz-fab__btn--top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* WhatsApp trigger */
.tz-fab__btn--wa {
    width: 3.5rem;
    height: 3.5rem;
    background: var(--tz-wa-green);
    color: #fff;
}

.tz-fab__icon {
    width: 1.25rem;
    height: 1.25rem;
}
.tz-fab__icon--wa {
    width: 1.625rem;
    height: 1.625rem;
}

/* ==========================================================================
   RESPONSIVE ADJUSTMENTS
   ========================================================================== */

@media (max-width: 480px) {
    .tz-footer__inner {
        padding: 3rem 1.25rem 2.5rem;
    }
    .tz-wa {
        right: 0.75rem;
        bottom: 88px;
        width: calc(100vw - 1.5rem);
        max-height: calc(100vh - 120px);
        max-height: calc(100dvh - 120px);
    }
    .tz-fab {
        right: 0.75rem;
        bottom: 0.75rem;
    }
}
