/**
 * File: /assets/css/home.css
 * Purpose: Definitive Master Stylesheet for Tidy Kent.
 * Strategy: Mobile-first, SEO-optimised, and conversion-focused.
 */

:root {
    /* Brand Palette - Soft Pink, Soft Blue, Clean White */
    --color-primary: #e8aebb;
    --color-primary-dark: #d698a6;
    --color-secondary: #a3c4d9;
    --color-secondary-dark: #8eb2c7;
    --color-bg-light: #fcfafb;
    --color-white: #ffffff;
    --color-text-main: #333333;
    --color-text-muted: #666666;
    --color-border: #eaeaea;

    /* Typography */
    --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    
    /* Spacing */
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 2rem;
    --space-xl: 4rem;

    /* Layout */
    --container-width: 1100px;
}

/* 1. Base Reset & Defaults */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    color: var(--color-text-main);
    background-color: var(--color-white);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    /* Space for mobile sticky footer bar */
    padding-bottom: 80px; 
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--color-primary-dark);
    text-decoration: none;
    transition: all 0.2s ease;
}

a:hover {
    color: var(--color-text-main);
}

.visually-hidden {
    position: absolute;
    width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); border: 0;
}

/* 2. Layout Utilities */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--space-md);
}

.bg-light { background-color: var(--color-bg-light); }
.text-center { text-align: center; }

/* 3. Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    border-radius: 4px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.btn-primary { background-color: var(--color-primary); color: var(--color-white); }
.btn-primary:hover { background-color: var(--color-primary-dark); color: var(--color-white); }

.btn-secondary { background-color: var(--color-secondary); color: var(--color-white); }
.btn-secondary:hover { background-color: var(--color-secondary-dark); color: var(--color-white); }

.btn-outline { 
    background-color: transparent; 
    border: 2px solid var(--color-primary); 
    color: var(--color-primary-dark); 
}
.btn-outline:hover { background-color: var(--color-primary); color: var(--color-white); }

/* 4. Header & Nav */
.site-header {
    background: var(--color-white);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.brand-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary-dark);
}

.main-nav ul {
    display: none; /* Mobile Hidden */
    list-style: none;
    gap: var(--space-lg);
}

/* 5. Hero Section */
.hero-section {
    padding: var(--space-xl) 0;
    background-color: var(--color-bg-light);
}

.hero-inner {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-lg);
    align-items: center;
}

.hero-visual {
    display: flex;
    flex-direction: column;
}

.hero-surtitle {
    display: block;
    color: var(--color-secondary-dark);
    font-weight: 600;
    margin-bottom: var(--space-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.875rem;
}

.hero-content h1 {
    font-size: 2.25rem;
    line-height: 1.2;
    margin-bottom: var(--space-md);
}

.hero-lead {
    font-size: 1.125rem;
    margin-bottom: var(--space-md);
    color: var(--color-text-muted);
    max-width: 600px;
}

.trust-bullets {
    list-style: none;
    margin-bottom: var(--space-lg);
}

.trust-bullets li {
    margin-bottom: var(--space-sm);
    font-weight: 500;
}

.hero-actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.hero-image {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}

.quick-trust-panel {
    background: var(--color-white);
    padding: var(--space-md);
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    position: relative;
    margin-top: -30px;
    width: 90%;
    margin-left: auto; margin-right: auto;
    text-align: center;
    border-top: 4px solid var(--color-primary);
    min-height: 98px;
}

/* 6. Main Content & Grids */
.section-header {
    text-align: center;
    margin-bottom: var(--space-xl);
    max-width: 800px;
    margin-left: auto; margin-right: auto;
}

.section-header h2 { font-size: 2rem; margin-bottom: var(--space-md); }
.section-header p { max-width: 600px; margin: 0 auto; color: var(--color-text-muted); }

.services-section, .showcase-section, .process-section, 
.areas-section, .faq-section, .contact-section, .content-section {
    padding: var(--space-xl) 0;
}

.tk-reviews-section,
.process-section,
.areas-section,
.faq-section,
.contact-section {
    content-visibility: auto;
    contain-intrinsic-size: 1px 900px;
}

/* Service Card Fixes (Uniform & Balanced) */
.services-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg);
}

.service-card {
    background: var(--color-white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 1px solid var(--color-border);
    text-align: center;
    transition: transform 0.3s ease;
}

.service-card:hover { transform: translateY(-5px); }

.service-card img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-bottom: 1px solid var(--color-border);
}

.service-content { padding: var(--space-lg); }
.service-content h3 { margin-bottom: var(--space-sm); color: var(--color-primary-dark); }
.service-content p { font-size: 0.95rem; max-width: 260px; margin: 0 auto; color: var(--color-text-muted); }

/* Showcase Grid (CLS Protected) */
.showcase-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
}

.showcase-grid img {
    border-radius: 4px;
    object-fit: cover;
    aspect-ratio: 4/3;
    width: 100%;
}

/* 7. Process & Areas */
.process-steps {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-lg);
    text-align: center;
}

.step-number {
    display: flex;
    align-items: center; justify-content: center;
    width: 48px; height: 48px;
    background: var(--color-secondary);
    color: var(--color-white);
    font-weight: bold;
    border-radius: 50%;
    margin: 0 auto var(--space-md);
}

.areas-list {
    list-style: none;
    display: flex; flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin: 2rem 0;
}

.areas-list li {
    background: var(--color-white);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    border: 1px solid var(--color-border);
    font-weight: 500;
}

/* 8. FAQs & Contact Form Layout */
.faq-accordion { max-width: 800px; margin: 0 auto; }
.faq-item {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    margin-bottom: 1rem;
}

.faq-question { padding: 1rem; font-weight: 600; cursor: pointer; }
.faq-answer { padding: 1rem; border-top: 1px solid var(--color-border); }

.contact-inner { display: grid; grid-template-columns: 1fr; gap: var(--space-xl); align-items: start; }

.form-container {
    background: var(--color-white);
    padding: var(--space-lg);
    border-radius: 12px;
    border: 1px solid var(--color-border);
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

/* ── Floating label form fields ─────────────────────────────────────── */
.quote-form { display: flex; flex-direction: column; gap: 0.9rem; }

.form-row {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.form-row--3 { flex-direction: column; }

/* Base field wrapper */
.form-field {
    position: relative;
    flex: 1;
}

/* All inputs and textarea */
.form-field input,
.form-field textarea {
    width: 100%;
    padding: 1.45rem 0.9rem 0.5rem;
    border: 1.5px solid var(--color-border);
    border-radius: 8px;
    font-size: 1rem;
    font-family: var(--font-sans);
    background: var(--color-white);
    color: var(--color-text-main);
    transition: border-color 0.2s;
    appearance: none;
    -webkit-appearance: none;
}

.form-field textarea {
    resize: vertical;
    min-height: 90px;
    padding-top: 1.6rem;
}

.form-hint {
    display: block;
    margin-top: 0.45rem;
    font-size: 0.82rem;
    line-height: 1.45;
    color: var(--color-text-muted);
}

.form-field input:focus,
.form-field textarea:focus {
    outline: none;
    border-color: var(--color-primary);
}

/* Floating label — sits at text baseline inside the asymmetrically-padded input */
.form-field > label {
    position: absolute;
    left: 0.9rem;
    top: 0.95rem;
    transform: none;
    font-size: 1rem;
    color: #aaa;
    pointer-events: none;
    transition: top 0.18s ease, font-size 0.18s ease, color 0.18s ease;
    white-space: nowrap;
    background: transparent;
    line-height: 1;
}

/* Textarea label starts near the top instead of middle */
.form-field--textarea > label {
    top: 1rem;
    transform: none;
}

/* Float label up: when focused or when input has content (has-value covers Safari) */
.form-field input:focus + label,
.form-field input:not(:placeholder-shown) + label,
.form-field input.has-value + label,
.form-field textarea:focus + label,
.form-field textarea:not(:placeholder-shown) + label,
.form-field textarea.has-value + label {
    top: 0.35rem;
    font-size: 0.7rem;
    color: var(--color-text-muted);
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* Required asterisk */
.form-field label .required { color: var(--color-primary-dark); }

/* ── Select fields (always-visible label above) ─────────────────────── */
.form-field--select {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    flex: 1;
}

.form-field--select > label {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    position: static;
    transform: none;
    pointer-events: auto;
}

.form-field--select select {
    width: 100%;
    padding: 0.75rem 0.9rem;
    border: 1.5px solid var(--color-border);
    border-radius: 8px;
    font-size: 1rem;
    font-family: var(--font-sans);
    background: var(--color-white);
    color: var(--color-text-main);
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23aaa' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.9rem center;
    cursor: pointer;
    transition: border-color 0.2s;
}

.form-field--select select:focus {
    outline: none;
    border-color: var(--color-primary);
}

/* ── Alerts ─────────────────────────────────────────────────────────── */
.form-alert {
    padding: 0.9rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.95rem;
    text-align: center;
}
.form-alert--success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.form-alert--error   { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

/* ── Submit row ─────────────────────────────────────────────────────── */
.form-submit { display: flex; flex-direction: column; align-items: stretch; gap: 0.6rem; margin-top: 0.4rem; }
.submit-btn  { width: 100% !important; padding: 1rem !important; }
.secure-notice { font-size: 0.78rem; color: var(--color-text-muted); text-align: center; }

/* 9. Footer */
.site-footer {
    background: var(--color-text-main);
    color: var(--color-white);
    padding: 4rem 0 2rem;
}

.footer-inner { display: grid; grid-template-columns: 1fr; gap: 2rem; }
.footer-logo { font-size: 1.5rem; font-weight: 700; color: var(--color-primary); display: block; margin-bottom: 0.5rem; }
.footer-legal {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.875rem; color: #999;
}

/* 10. Desktop Breakpoints & tel: control */
@media (min-width: 768px) {
    body { padding-bottom: 0; }
    .main-nav ul { display: flex; }
    .hero-inner { grid-template-columns: 1fr 1fr; }
    .hero-actions { flex-direction: row; }
    .services-grid { grid-template-columns: repeat(4, 1fr); }
    .service-card img { height: 200px; }
    .showcase-grid { grid-template-columns: repeat(4, 1fr); }
    .process-steps { grid-template-columns: repeat(3, 1fr); }
    
    /* Center the layout visually by splitting 50/50 */
    .contact-inner { grid-template-columns: 1fr 1fr; }

    .form-row { flex-direction: row; gap: 0.9rem; }
    .form-row--3 { flex-direction: row; }
    .footer-inner { grid-template-columns: 2fr 1fr; }

    /* Only clickable on mobile devices */
    a[href^="tel:"] { pointer-events: none; cursor: text; text-decoration: none; }
}

/* 11. THE CONVERSION BAR (Fixed Sticky Button) */

/* Mobile: Bottom Sticky Bar */
.floating-cta {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    background-color: var(--color-primary) !important;
    color: var(--color-white) !important;
    padding: 1.2rem !important;
    text-align: center !important;
    font-weight: 700 !important;
    font-size: 1.1rem !important;
    z-index: 99999 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    box-shadow: 0 -4px 15px rgba(0,0,0,0.15) !important;
    text-decoration: none !important;
}

/* Desktop: Floating Pill */
@media (min-width: 768px) {
    .floating-cta {
        bottom: 2rem !important;
        right: 2rem !important;
        left: auto !important;
        width: auto !important;
        border-radius: 50px !important;
        padding: 0.8rem 2.5rem !important;
        box-shadow: 0 4px 20px rgba(0,0,0,0.2) !important;
    }
    
    .floating-cta:hover {
        background-color: var(--color-primary-dark) !important;
        transform: translateY(-3px) !important;
    }
}

/* 12. Reviews Section */
.reviews-section { padding: var(--space-xl) 0; }

.reviews-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-lg);
}

.review-card {
    background: var(--color-white);
    border-radius: 12px;
    padding: var(--space-lg);
    border: 1px solid var(--color-border);
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
}

.review-stars {
    color: var(--color-primary-dark);
    font-size: 1.1rem;
    letter-spacing: 0.1em;
    margin-bottom: var(--space-sm);
}

.review-body {
    color: var(--color-text-main);
    line-height: 1.7;
    margin-bottom: var(--space-md);
    font-style: italic;
    flex: 1;
}

.review-author {
    font-weight: 600;
    color: var(--color-text-main);
    font-size: 0.95rem;
}

.review-meta {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-top: 0.2rem;
}

@media (min-width: 768px) {
    .reviews-grid { grid-template-columns: repeat(3, 1fr); }
}

/* 13. Reviews Carousel */
.tk-reviews-section {
    padding: 64px 0;
    background: #f7f7f4;
}

.tk-reviews-carousel {
    position: relative;
}

.tk-reviews-controls {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-bottom: 16px;
    min-height: 44px;
    visibility: hidden;
}

.tk-reviews-carousel.is-enhanced .tk-reviews-controls {
    visibility: visible;
}

.tk-reviews-control {
    appearance: none;
    border: 1px solid #d0d5dd;
    background: #ffffff;
    color: #101828;
    border-radius: 999px;
    padding: 10px 16px;
    font: inherit;
    cursor: pointer;
}

.tk-reviews-control:hover,
.tk-reviews-control:focus-visible {
    border-color: #98a2b3;
    outline: none;
}

.tk-reviews-track {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(88%, 1fr);
    gap: 16px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    padding-bottom: 8px;
    scrollbar-width: thin;
}

.tk-review-card {
    scroll-snap-align: start;
    background: #ffffff;
    border: 1px solid #e4e7ec;
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 8px 24px rgba(16, 24, 40, 0.06);
    min-height: 100%;
}

.tk-review-card-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 16px;
}

.tk-reviewer-name {
    margin: 0 0 6px;
    font-size: 1rem;
}

.tk-review-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    color: #667085;
    font-size: 0.95rem;
}

.tk-review-rating {
    color: #c58a15;
    white-space: nowrap;
    font-size: 1rem;
}

.tk-review-body p {
    margin: 0;
    color: #101828;
    line-height: 1.7;
}

.tk-review-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    justify-content: space-between;
    align-items: center;
    margin-top: 18px;
    color: #667085;
    font-size: 0.92rem;
}

.tk-review-footer-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tk-review-badge,
.tk-review-source {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    background: #f2f4f7;
    color: #344054;
    padding: 6px 10px;
}

@media (min-width: 700px) {
    .tk-reviews-track {
        grid-auto-columns: minmax(calc(50% - 8px), 1fr);
    }
}

@media (min-width: 1100px) {
    .tk-reviews-track {
        grid-auto-columns: minmax(calc(33.333% - 11px), 1fr);
    }
}

@media (prefers-reduced-motion: reduce) {
    .tk-reviews-track {
        scroll-behavior: auto;
    }
}

.tk-proof-section {
    padding: 32px;
    margin: 32px 0;
    border: 1px solid #e4e7ec;
    border-radius: 20px;
    background: #f8f6f2;
}

.tk-proof-section__header {
    margin-bottom: 20px;
}

.tk-proof-section__kicker {
    margin: 0 0 8px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #8a5c2e;
}

.tk-proof-section__header h2 {
    margin: 0 0 10px;
}

.tk-proof-section__intro {
    margin: 0;
    color: #667085;
    max-width: 60ch;
}

.tk-proof-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.tk-proof-card {
    background: #ffffff;
    border: 1px solid #e4e7ec;
    border-radius: 18px;
    padding: 22px;
    box-shadow: 0 8px 24px rgba(16, 24, 40, 0.06);
}

.tk-proof-card__quote {
    margin: 0 0 18px;
}

.tk-proof-card__quote p {
    margin: 0;
    color: #101828;
    line-height: 1.7;
}

.tk-proof-card__name {
    margin: 0 0 6px;
    font-weight: 700;
    color: #101828;
}

.tk-proof-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    color: #667085;
    font-size: 0.95rem;
}

.tk-proof-card__footer {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 16px;
    justify-content: space-between;
    align-items: flex-end;
}

.tk-proof-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tk-proof-card__tag {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    background: #f2f4f7;
    color: #344054;
    padding: 6px 10px;
    font-size: 0.9rem;
}

@media (max-width: 699px) {
    .tk-proof-section {
        padding: 24px;
    }
}
