/* TickVisor Tailwind polish layer
   Uses Tailwind CDN utilities for future page work, while this layer upgrades the current Twig safely.
   No layout logic or backend behaviour changed. */

:root {
    --tw-polish-blue: #3f45ff;
    --tw-polish-cyan: #0fb9e8;
    --tw-polish-violet: #8057ff;
    --tw-polish-ink: #081237;
    --tw-polish-card: rgba(255,255,255,.86);
    --tw-polish-card-strong: rgba(255,255,255,.96);
    --tw-polish-border: rgba(169, 187, 221, .58);
}

html { text-rendering: optimizeLegibility; }
body {
    background:
        radial-gradient(circle at 78% 8%, rgba(128,87,255,.14), transparent 26rem),
        radial-gradient(circle at 16% 18%, rgba(15,185,232,.12), transparent 26rem),
        linear-gradient(135deg, #ffffff 0%, #f7faff 42%, #edf4ff 100%);
}
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(63,69,255,.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(63,69,255,.035) 1px, transparent 1px);
    background-size: 64px 64px;
    mask-image: linear-gradient(to bottom, rgba(0,0,0,.45), transparent 76%);
    opacity: .45;
}

.site-header-shell {
    padding-top: 18px;
    background: linear-gradient(180deg, rgba(247,250,255,.82), rgba(247,250,255,.56) 66%, transparent);
}
.site-header {
    min-height: 76px;
    border-radius: 28px;
    padding: 12px 14px 12px 18px;
    background: rgba(255,255,255,.72);
    border: 1px solid rgba(185,199,229,.72);
    box-shadow: 0 24px 80px rgba(27,47,98,.11);
    backdrop-filter: blur(22px) saturate(1.15);
}
.brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 16px;
    color: var(--tw-polish-blue);
    background:
        radial-gradient(circle at 35% 20%, rgba(255,255,255,.96), transparent 34%),
        linear-gradient(135deg, #ffffff, #edf6ff 58%, #f6f0ff);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.7), 0 14px 34px rgba(63,69,255,.13);
}
.brand-text > span { letter-spacing: -.06em; }
.site-nav {
    min-height: 48px;
    padding: 6px;
    border-radius: 18px;
    background: rgba(239,244,253,.76);
    border: 1px solid rgba(211,222,242,.92);
}
.site-nav a {
    min-height: 36px;
    padding: 0 15px;
    border-radius: 13px;
    font-size: .875rem;
    letter-spacing: -.01em;
}
.site-nav a.active,
.site-nav a:hover {
    background: linear-gradient(180deg,#fff,#f8fbff);
    box-shadow: 0 10px 24px rgba(27,47,98,.09);
}
.account-nav { gap: 8px; }
.theme-toggle,
.account-link,
.button.account-button {
    min-height: 42px;
    border-radius: 14px;
}

.site-main { padding-top: 38px; }
.page-shell { gap: clamp(24px, 3vw, 42px); }
.hero-card,
.card,
.metric-card,
.finding-card,
.debug-panel,
.plan-card,
.history-item,
.mini-card,
.score-card,
.recommendation {
    background: linear-gradient(180deg, var(--tw-polish-card-strong), var(--tw-polish-card));
    border: 1px solid var(--tw-polish-border);
    box-shadow: 0 22px 70px rgba(27,47,98,.10);
    backdrop-filter: blur(16px) saturate(1.08);
}
.hero-card,
.card,
.plan-card,
.score-card,
.fluid-visual,
.auth-form-panel,
.auth-visual-panel,
.preview-panel {
    transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.card:hover,
.plan-card:hover,
.metric-card:hover,
.feature-card:hover,
.history-item:hover {
    transform: translateY(-2px);
    border-color: rgba(63,69,255,.28);
    box-shadow: 0 30px 92px rgba(27,47,98,.14);
}
.hero-card::after { opacity: .8; }

h1 { max-width: 980px; }
h2, h3 { text-wrap: balance; }
.lede { color: color-mix(in srgb, var(--ink-soft) 92%, #000 8%); }
.eyebrow {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(63,69,255,.08);
    border: 1px solid rgba(63,69,255,.10);
    color: var(--primary);
    margin-bottom: 16px;
}

.button,
button,
input[type="submit"] {
    min-height: 50px;
    border-radius: 14px;
    background: linear-gradient(135deg, #3f45ff 0%, #7457ff 48%, #bd36f6 100%);
    box-shadow: 0 18px 42px rgba(63,69,255,.24);
}
.button:hover,
button:hover {
    transform: translateY(-2px);
    box-shadow: 0 24px 60px rgba(63,69,255,.31);
}
.button.secondary,
button.secondary {
    background: rgba(255,255,255,.86);
    color: var(--primary);
    border: 1px solid rgba(190,205,232,.9);
    box-shadow: 0 12px 32px rgba(27,47,98,.08);
}
.badge,
.sales-kicker {
    border-radius: 999px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.65);
}
.badges { align-items: flex-end; }

/* Hero visual polish */
.fluid-visual,
.auth-visual-panel,
.preview-panel {
    background:
        radial-gradient(circle at 50% 36%, rgba(255,255,255,.76), transparent 13rem),
        radial-gradient(circle at 59% 53%, rgba(15,185,232,.24), transparent 18rem),
        linear-gradient(135deg, rgba(255,255,255,.88), rgba(237,244,255,.78));
    border: 1px solid rgba(185,199,229,.72);
    box-shadow: 0 28px 90px rgba(27,47,98,.12);
}
.fluid-cube {
    animation: tvFloat 7s ease-in-out infinite;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.32);
}
@keyframes tvFloat {
    0%, 100% { transform: rotate(-8deg) translateY(0) scale(1); }
    50% { transform: rotate(-5deg) translateY(-10px) scale(1.025); }
}
.visual-stat {
    background: rgba(255,255,255,.76);
    border-color: rgba(185,199,229,.82);
    box-shadow: 0 12px 32px rgba(27,47,98,.08);
}

/* Home: make it feel like a real sales page */
.hero-card.sales-hero {
    justify-content: center;
    padding-block: clamp(44px, 6vw, 88px);
}
.sales-kickers { margin-bottom: 24px; }
.hero-proof { margin-top: auto; padding-top: clamp(34px, 5vw, 72px); }
.proof-card {
    min-height: 118px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    border-color: rgba(185,199,229,.78);
    background: linear-gradient(180deg, rgba(255,255,255,.94), rgba(250,252,255,.82));
}
.proof-card strong { font-size: clamp(1.45rem, 2.2vw, 2rem); }
.feature-card { min-height: 310px; }
.feature-card .note { margin-top: 12px; }
.product-strip > article {
    background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(249,252,255,.86));
}
.workflow-step {
    border-color: rgba(185,199,229,.7);
    background: rgba(255,255,255,.74);
    backdrop-filter: blur(10px);
}
.step-number,
.icon-bubble {
    box-shadow: 0 14px 34px rgba(63,69,255,.15);
}

/* Pricing and billing: better cards */
.plan-card {
    position: relative;
    overflow: hidden;
}
.plan-card::before {
    content: "";
    position: absolute;
    inset: -40% -20% auto auto;
    width: 240px;
    height: 240px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(63,69,255,.10), transparent 66%);
    pointer-events: none;
}
.plan-card > * { position: relative; z-index: 1; }
.plan-card.featured {
    border-color: rgba(128,87,255,.5);
    box-shadow: 0 30px 95px rgba(63,69,255,.16);
}
.price { color: var(--ink); }
.billing-tabs {
    background: rgba(238,243,251,.76);
    backdrop-filter: blur(10px);
}

/* Tables/lists read like product UI, not admin dumps */
.history-item,
.panel-item,
.finding-card,
.faq-item {
    border-color: rgba(185,199,229,.68);
}
.history-title { letter-spacing: -.02em; }
.metric-card strong { color: var(--ink); }
.progress-track { box-shadow: inset 0 1px 2px rgba(27,47,98,.06); }
.progress-bar { background: linear-gradient(90deg, #3f45ff, #0fb9e8 65%, #13b981); }

/* Forms */
input[type="email"], input[type="password"], input[type="text"], input[type="date"], input[type="tel"], input[type="file"], select, textarea {
    background: rgba(255,255,255,.86);
    border-color: rgba(190,205,232,.9);
    transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
input:hover, select:hover, textarea:hover { border-color: rgba(63,69,255,.28); }
input:focus, select:focus, textarea:focus {
    background: #fff;
    box-shadow: 0 0 0 4px rgba(63,69,255,.10), 0 12px 32px rgba(27,47,98,.07);
}
.oauth-button:hover {
    opacity: 1;
    border-color: rgba(63,69,255,.22);
    transform: translateY(-1px);
}

/* Footer */
.site-footer {
    background: rgba(255,255,255,.78);
    backdrop-filter: blur(18px);
}
.site-footer nav a:hover { color: var(--primary); }

/* Dark mode polish */
html[data-theme="dark"] body {
    background:
        radial-gradient(circle at 76% 10%, rgba(128,87,255,.22), transparent 27rem),
        radial-gradient(circle at 16% 18%, rgba(15,185,232,.18), transparent 25rem),
        linear-gradient(135deg, #07101f 0%, #0b1328 42%, #08101e 100%);
}
html[data-theme="dark"] body::before {
    background-image:
        linear-gradient(rgba(143,166,211,.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(143,166,211,.06) 1px, transparent 1px);
    opacity: .55;
}
html[data-theme="dark"] .site-header-shell {
    background: linear-gradient(180deg, rgba(7,16,31,.88), rgba(7,16,31,.54) 70%, transparent);
}
html[data-theme="dark"] .site-header,
html[data-theme="dark"] .site-footer,
html[data-theme="dark"] .hero-card,
html[data-theme="dark"] .card,
html[data-theme="dark"] .metric-card,
html[data-theme="dark"] .finding-card,
html[data-theme="dark"] .debug-panel,
html[data-theme="dark"] .plan-card,
html[data-theme="dark"] .history-item,
html[data-theme="dark"] .mini-card,
html[data-theme="dark"] .score-card,
html[data-theme="dark"] .recommendation {
    background: linear-gradient(180deg, rgba(15,25,47,.90), rgba(9,17,33,.78));
    border-color: rgba(91,115,159,.42);
    box-shadow: 0 26px 80px rgba(0,0,0,.28);
}
html[data-theme="dark"] .site-nav,
html[data-theme="dark"] .billing-tabs {
    background: rgba(8,15,30,.72);
    border-color: rgba(91,115,159,.42);
}
html[data-theme="dark"] .site-nav a:hover,
html[data-theme="dark"] .site-nav a.active,
html[data-theme="dark"] .account-link.active {
    background: rgba(63,69,255,.16);
    color: #cbd5ff;
}
html[data-theme="dark"] .brand-mark,
html[data-theme="dark"] .account-link,
html[data-theme="dark"] .button.secondary,
html[data-theme="dark"] .theme-toggle,
html[data-theme="dark"] .proof-card,
html[data-theme="dark"] .workflow-step,
html[data-theme="dark"] .product-strip > article,
html[data-theme="dark"] .visual-stat,
html[data-theme="dark"] .faq-item,
html[data-theme="dark"] .oauth-button,
html[data-theme="dark"] .ai-callout,
html[data-theme="dark"] .upload-dropzone,
html[data-theme="dark"] .file-input,
html[data-theme="dark"] .auth-help-card > div {
    background: rgba(13,23,43,.86);
    border-color: rgba(91,115,159,.48);
    color: var(--ink);
}
html[data-theme="dark"] .fluid-visual,
html[data-theme="dark"] .auth-visual-panel,
html[data-theme="dark"] .preview-panel {
    background:
        radial-gradient(circle at 48% 38%, rgba(255,255,255,.12), transparent 14rem),
        radial-gradient(circle at 58% 54%, rgba(15,185,232,.20), transparent 19rem),
        linear-gradient(135deg, rgba(15,25,47,.90), rgba(9,17,33,.82));
    border-color: rgba(91,115,159,.48);
}
html[data-theme="dark"] input[type="email"],
html[data-theme="dark"] input[type="password"],
html[data-theme="dark"] input[type="text"],
html[data-theme="dark"] input[type="date"],
html[data-theme="dark"] input[type="tel"],
html[data-theme="dark"] input[type="file"],
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
    background: rgba(8,15,30,.76);
    border-color: rgba(91,115,159,.48);
    color: var(--ink);
}
html[data-theme="dark"] .badge {
    background: rgba(63,69,255,.10);
    border-color: rgba(91,115,159,.48);
}

@media (max-width: 900px) {
    .site-header {
        grid-template-columns: 1fr;
        align-items: stretch;
    }
    .site-nav,
    .account-nav {
        justify-self: stretch;
        justify-content: flex-start;
        overflow-x: auto;
    }
}

/* === TickVisor CSS recovery: logo/nav/footer sizing + overflow guard === */
html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

.site-header-shell,
.site-footer-shell {
    width: 100%;
}

.site-header.minimal-site-header {
    width: 100% !important;
    max-width: none !important;
    min-height: 72px !important;
    height: auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 28px !important;
    padding: 0 0 18px !important;
    border-radius: 0 !important;
    overflow: visible !important;
    background: transparent !important;
    box-shadow: none !important;
}

.site-header.minimal-site-header .header-left {
    display: flex !important;
    align-items: center !important;
    gap: clamp(24px, 4vw, 56px) !important;
    min-width: 0 !important;
    flex: 1 1 auto !important;
}

.brand.brand-logo,
.footer-brand.brand-logo {
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    height: auto !important;
    flex: 0 0 auto !important;
    overflow: visible !important;
    display: inline-flex !important;
    align-items: center !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

.brand-logo img,
.site-header .brand-logo img,
.site-footer .brand-logo img,
img.logo-light,
img.logo-dark {
    display: block !important;
    height: auto !important;
    object-fit: contain !important;
}

.site-header .brand-logo .logo-light,
.site-header .brand-logo .logo-dark,
.site-header img.logo-light,
.site-header img.logo-dark {
    width: clamp(152px, 12vw, 210px) !important;
    max-width: 210px !important;
    min-width: 152px !important;
}

.site-footer .brand-logo .logo-light,
.site-footer .brand-logo .logo-dark,
.site-footer img.logo-light,
.site-footer img.logo-dark {
    width: 148px !important;
    max-width: 148px !important;
    min-width: 0 !important;
}

.logo-dark { display: none !important; }
.logo-light { display: block !important; }
html[data-theme="dark"] .logo-light { display: none !important; }
html[data-theme="dark"] .logo-dark { display: block !important; }
html[data-theme="light"] .logo-light { display: block !important; }
html[data-theme="light"] .logo-dark { display: none !important; }

.site-header.minimal-site-header .site-nav {
    position: static !important;
    transform: none !important;
    display: flex !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.site-header.minimal-site-header .site-nav a {
    min-height: 42px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 13px !important;
    border: 1px solid transparent !important;
    border-radius: 12px !important;
    font-size: 0.92rem !important;
    font-weight: 800 !important;
    line-height: 1 !important;
}

.site-header.minimal-site-header .site-nav a:hover,
.site-header.minimal-site-header .site-nav a.active {
    color: var(--text, #f8fbff) !important;
    background: rgba(103, 232, 165, 0.09) !important;
    border-color: rgba(103, 232, 165, 0.18) !important;
}

.site-header.minimal-site-header .account-nav {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 10px !important;
    margin-left: auto !important;
    flex: 0 0 auto !important;
}

.site-header.minimal-site-header .theme-toggle,
.site-header.minimal-site-header .account-link,
.site-header.minimal-site-header .account-button {
    min-height: 42px !important;
    height: 42px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 12px !important;
    line-height: 1 !important;
    white-space: nowrap !important;
}

.site-header.minimal-site-header .theme-toggle {
    min-width: 98px !important;
    padding: 0 14px !important;
    gap: 8px !important;
}

.site-header.minimal-site-header .theme-toggle-icon {
    display: inline-grid !important;
    place-items: center !important;
    width: 22px !important;
    height: 22px !important;
    flex: 0 0 22px !important;
}

.site-header.minimal-site-header .account-button {
    padding: 0 18px !important;
}

.site-footer {
    width: 100% !important;
    max-width: none !important;
    min-height: 116px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 28px !important;
    padding: 24px 0 !important;
    overflow: visible !important;
    background: transparent !important;
    box-shadow: none !important;
}

.footer-brand.brand-logo {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
}

.footer-tagline {
    color: var(--muted, #8fa0bd) !important;
    font-size: .86rem !important;
    font-weight: 800 !important;
}

.site-footer nav {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    flex-wrap: wrap !important;
    gap: 16px !important;
}

.site-footer nav a {
    font-size: 0.92rem !important;
    font-weight: 850 !important;
}

.footer-copy {
    flex: 1 1 auto !important;
    margin: 0 !important;
}

@media (max-width: 980px) {
    .site-header.minimal-site-header {
        align-items: flex-start !important;
        flex-direction: column !important;
    }
    .site-header.minimal-site-header .header-left {
        width: 100% !important;
        justify-content: space-between !important;
        gap: 16px !important;
        flex-wrap: wrap !important;
    }
    .site-header.minimal-site-header .account-nav {
        width: 100% !important;
        justify-content: flex-start !important;
        flex-wrap: wrap !important;
    }
}

@media (max-width: 720px) {
    .site-header .brand-logo .logo-light,
    .site-header .brand-logo .logo-dark,
    .site-header img.logo-light,
    .site-header img.logo-dark {
        width: 148px !important;
        min-width: 0 !important;
    }
    .site-footer {
        align-items: flex-start !important;
        flex-direction: column !important;
    }
}
