/* ==========================================================================
   Aesthetix Cloud — Marketing Site Design System v2 · "Atelier Editorial"
   Supplement to Tailwind CDN. Class selectors only — never element resets
   (element-level rules would fight Tailwind's preflight on every page).
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */
:root {
    --ink: #2D2A26;
    --paper: #F1F1F2;
    --clay: #916C5C;
    --sand: #D9C3B2;
    --app-bg: #FCFBF9;

    --hairline: rgba(45, 42, 38, 0.08);
    --hairline-strong: rgba(45, 42, 38, 0.18);

    --font-display: 'Playfair Display', serif;
    --font-body: 'Inter', sans-serif;

    --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);

    /* Warm shadows — ink contact + clay ambient. Never pure black. */
    --shadow-warm-sm: 0 1px 2px rgba(45, 42, 38, 0.05), 0 6px 20px -8px rgba(145, 108, 92, 0.14);
    --shadow-warm-md: 0 2px 4px rgba(45, 42, 38, 0.05), 0 16px 40px -12px rgba(145, 108, 92, 0.18);
    --shadow-warm-lg: 0 4px 8px rgba(45, 42, 38, 0.06), 0 32px 64px -24px rgba(85, 60, 48, 0.25);
}

.shadow-warm-sm { box-shadow: var(--shadow-warm-sm); }
.shadow-warm-md { box-shadow: var(--shadow-warm-md); }
.shadow-warm-lg { box-shadow: var(--shadow-warm-lg); }

/* --------------------------------------------------------------------------
   2. Editorial typography
   -------------------------------------------------------------------------- */
.kicker {
    font-family: var(--font-body);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--clay);
}

.display-1 {
    font-family: var(--font-display);
    font-size: clamp(2.75rem, 7.5vw, 6.5rem);
    line-height: 0.98;
    letter-spacing: -0.015em;
    color: var(--ink);
}

.display-2 {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4.5vw, 3.5rem);
    line-height: 1.05;
    letter-spacing: -0.01em;
    color: var(--ink);
}

.lede {
    font-family: var(--font-body);
    font-size: clamp(1.05rem, 1.6vw, 1.25rem);
    font-weight: 300;
    line-height: 1.7;
    color: rgba(45, 42, 38, 0.65);
}

/* Ghost chapter numerals — "01", "02"… behind section headers */
.ghost-num {
    font-family: var(--font-display);
    font-style: italic;
    font-size: clamp(4.5rem, 10vw, 8.5rem);
    line-height: 1;
    color: rgba(45, 42, 38, 0.06);
    user-select: none;
    pointer-events: none;
}

.rule { height: 1px; background: var(--hairline); }

/* --------------------------------------------------------------------------
   3. Buttons
   .btn-pill carries the shape only — background comes from Tailwind classes,
   because handleFormSubmit() swaps bg-primary / bg-green-600 / bg-red-600.
   -------------------------------------------------------------------------- */
.btn-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    font-family: var(--font-body);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #fff;
    padding: 1.1rem 2.5rem;
    border-radius: 9999px;
    box-shadow: var(--shadow-warm-md);
    transition: transform 0.45s var(--ease-expo), box-shadow 0.45s var(--ease-expo), background-color 0.45s var(--ease-expo);
}

.btn-pill:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-warm-lg);
}

.btn-clay { background-color: var(--clay); }
.btn-clay:hover { background-color: var(--ink); }

/* Quiet text link — small caps, color shift on hover */
.btn-quiet {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(45, 42, 38, 0.55);
    transition: color 0.35s var(--ease-expo);
}

.btn-quiet:hover { color: var(--clay); }

/* --------------------------------------------------------------------------
   4. Navigation — transparent at top, gains paper + blur on scroll
   -------------------------------------------------------------------------- */
.site-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    padding: 1.4rem 0;
    background: transparent;
    border-bottom: 1px solid transparent;
    transition:
        background-color 0.45s var(--ease-expo),
        padding 0.45s var(--ease-expo),
        border-color 0.45s var(--ease-expo);
}

.site-nav.is-scrolled {
    background: rgba(241, 241, 242, 0.88);
    -webkit-backdrop-filter: blur(14px) saturate(1.1);
    backdrop-filter: blur(14px) saturate(1.1);
    border-bottom-color: var(--hairline);
    padding: 0.85rem 0;
}

.nav-link {
    position: relative;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(45, 42, 38, 0.6);
    transition: color 0.3s;
}

.nav-link::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -5px;
    width: 100%;
    height: 1px;
    background: var(--clay);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.35s var(--ease-expo);
}

.nav-link:hover { color: var(--ink); }
.nav-link:hover::after { transform: scaleX(1); }

/* Hamburger — two thin ink lines */
.nav-burger {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 7px;
    width: 44px;
    height: 44px;
    padding: 0 10px;
    border-radius: 9999px;
    cursor: pointer;
}

.nav-burger span {
    display: block;
    height: 1.5px;
    background: var(--ink);
    transition: transform 0.4s var(--ease-expo), opacity 0.3s;
}

/* --------------------------------------------------------------------------
   5. Mobile drawer
   z ladder: nav 50 < overlay 70 < drawer 80 < cookie banner 100
   -------------------------------------------------------------------------- */
.drawer-overlay {
    position: fixed;
    inset: 0;
    z-index: 70;
    background: rgba(45, 42, 38, 0.4);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s var(--ease-expo);
}

.drawer-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}

.drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 80;
    width: min(84vw, 360px);
    background: var(--paper);
    box-shadow: var(--shadow-warm-lg);
    transform: translateX(105%);
    transition: transform 0.5s var(--ease-expo);
    display: flex;
    flex-direction: column;
    padding: 1.5rem 2rem 2rem;
    overflow-y: auto;
}

.drawer.is-open { transform: translateX(0); }

body.drawer-locked { overflow: hidden; }

.drawer-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: var(--font-display);
    font-size: 1.55rem;
    color: var(--ink);
    padding: 1.05rem 0;
    border-bottom: 1px solid var(--hairline);
    transition: color 0.3s, padding-left 0.35s var(--ease-expo);
}

.drawer-link:hover {
    color: var(--clay);
    padding-left: 0.4rem;
}

.drawer-meta {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: rgba(45, 42, 38, 0.4);
}

/* --------------------------------------------------------------------------
   6. Mockup kit — faithful recreations of the real app UI
   App DS: bg #FCFBF9 · white cards rounded-[32px] · 10px bold uppercase
   labels · serif headings · rounded-full chips.
   -------------------------------------------------------------------------- */
.mockup-frame {
    background: #fff;
    border: 1px solid var(--hairline);
    border-radius: 24px;
    box-shadow: var(--shadow-warm-lg);
    overflow: hidden;
}

.mockup-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 40px;
    padding: 0 16px;
    background: var(--app-bg);
    border-bottom: 1px solid var(--hairline);
}

.mockup-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: rgba(45, 42, 38, 0.12);
    flex-shrink: 0;
}

.mockup-url {
    margin: 0 auto;
    font-size: 10px;
    letter-spacing: 0.06em;
    color: rgba(45, 42, 38, 0.45);
    background: #fff;
    border: 1px solid var(--hairline);
    border-radius: 9999px;
    padding: 3px 14px;
    white-space: nowrap;
}

.mockup-canvas {
    background: var(--app-bg);
    padding: 16px;
}

/* The app's card idiom (rounded-[32px] scaled for mockup density) */
.app-card {
    background: #fff;
    border: 1px solid #f3f4f6;
    border-radius: 20px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

/* The app's label idiom: text-[10px] font-bold uppercase tracking-widest */
.app-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #9ca3af;
}

/* Chips — semantic Tailwind-100/600 pairs used by the real app */
.chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 9px;
    border-radius: 9999px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    white-space: nowrap;
}

.chip-red     { background: #fee2e2; color: #dc2626; }
.chip-amber   { background: #fef3c7; color: #d97706; }
.chip-emerald { background: #d1fae5; color: #059669; }
.chip-orange  { background: #ffedd5; color: #ea580c; }
.chip-purple  { background: #f3e8ff; color: #9333ea; }
.chip-blue    { background: #dbeafe; color: #2563eb; }
.chip-gray    { background: #f3f4f6; color: #4b5563; }
.chip-pink    { background: #fce7f3; color: #db2777; }

/* Appointment status dots (AppointmentCard.tsx STATUS_COLORS) */
.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-dot.is-scheduled { background: #3B82F6; }
.status-dot.is-confirmed { background: #10B981; }
.status-dot.is-progress  { background: #F59E0B; }
.status-dot.is-completed { background: #9CA3AF; }

/* Appointment card — tint + 4px left border, set per-type via CSS vars:
   style="--appt-color:#3B82F6; --appt-bg:rgba(59,130,246,.13)" */
.appt {
    position: relative;
    background: var(--appt-bg, rgba(145, 108, 92, 0.13));
    border-left: 4px solid var(--appt-color, var(--clay));
    border-radius: 10px;
    padding: 8px 10px;
    overflow: hidden;
}

.appt-time {
    font-size: 10px;
    font-weight: 600;
    color: var(--appt-ink, #57534e);
    line-height: 1.3;
}

.appt-name {
    font-size: 12px;
    font-weight: 700;
    color: #1f2937;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.appt-type {
    font-size: 10px;
    color: #6b7280;
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* KPI card (StockDashboard.tsx) */
.kpi-card {
    background: #fff;
    border: 1px solid #f3f4f6;
    border-radius: 22px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    padding: 18px;
}

.kpi-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    margin-bottom: 12px;
}

.kpi-value {
    font-size: 1.45rem;
    font-weight: 700;
    color: #1f2937;
    line-height: 1.1;
    white-space: nowrap;
}

/* Session editor tab pills (SessionEditor.tsx) */
.tab-pill {
    padding: 8px 16px;
    border-radius: 12px;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #9ca3af;
    background: transparent;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
    white-space: nowrap;
}

.tab-pill.is-active {
    background: var(--clay);
    color: #fff;
}

/* Mockup timeline (TimelineTab / proposal Cronologia) */
.tl-dot {
    position: absolute;
    left: -5.5px;
    top: 4px;
    width: 10px;
    height: 10px;
    border-radius: 9999px;
    background: var(--clay);
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px var(--hairline);
}

/* Phone frame (propostas) */
.phone {
    width: min(100%, 340px);
    background: #1c1917;
    border-radius: 3rem;
    padding: 10px;
    box-shadow: var(--shadow-warm-lg);
}

.phone-screen {
    position: relative;
    background: #fff;
    border-radius: 2.45rem;
    overflow: hidden;
}

.phone-notch {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 110px;
    height: 22px;
    background: #1c1917;
    border-radius: 0 0 14px 14px;
    z-index: 10;
}

/* Carousel panes (agenda views, registo tabs) */
[data-pane] { display: none; }

[data-pane].is-active {
    display: block;
    animation: paneIn 0.5s var(--ease-expo);
}

/* Panes that need flex layout when active (e.g. agenda calendar columns) */
.pane-flex[data-pane].is-active { display: flex; }

@keyframes paneIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: none; }
}

.car-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(45, 42, 38, 0.15);
    cursor: pointer;
    transition: background-color 0.3s, transform 0.3s;
}

.car-dot.is-active {
    background: var(--clay);
    transform: scale(1.25);
}

/* Mobile/desktop mockup variants */
.only-m { display: block; }
.only-d { display: none; }

@media (min-width: 768px) {
    .only-m { display: none; }
    .only-d { display: block; }
}

/* --------------------------------------------------------------------------
   7. Forms — underline fields
   -------------------------------------------------------------------------- */
.field-underline {
    width: 100%;
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--hairline-strong);
    border-radius: 0;
    padding: 0.85rem 0;
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--ink);
    outline: none;
    transition: border-color 0.35s var(--ease-expo);
}

.field-underline:focus { border-bottom-color: var(--clay); }

.field-underline::placeholder {
    color: rgba(45, 42, 38, 0.3);
    font-weight: 300;
}

.field-label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: rgba(45, 42, 38, 0.4);
    margin-bottom: 0.1rem;
}

/* --------------------------------------------------------------------------
   8. Motion — reveal on scroll (single source; observer lives in script.js v2)
   -------------------------------------------------------------------------- */
.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.9s var(--ease-expo), transform 0.9s var(--ease-expo);
}

.reveal.active {
    opacity: 1;
    transform: none;
}

.reveal-stagger > * {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.8s var(--ease-expo), transform 0.8s var(--ease-expo);
}

.reveal-stagger.active > * {
    opacity: 1;
    transform: none;
}

.reveal-stagger.active > *:nth-child(1) { transition-delay: 0.05s; }
.reveal-stagger.active > *:nth-child(2) { transition-delay: 0.12s; }
.reveal-stagger.active > *:nth-child(3) { transition-delay: 0.19s; }
.reveal-stagger.active > *:nth-child(4) { transition-delay: 0.26s; }
.reveal-stagger.active > *:nth-child(5) { transition-delay: 0.33s; }
.reveal-stagger.active > *:nth-child(6) { transition-delay: 0.4s; }
.reveal-stagger.active > *:nth-child(7) { transition-delay: 0.47s; }
.reveal-stagger.active > *:nth-child(8) { transition-delay: 0.54s; }

@media (prefers-reduced-motion: reduce) {
    .reveal,
    .reveal-stagger > * {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }

    [data-pane].is-active { animation: none; }
}

/* --------------------------------------------------------------------------
   9. Helpers
   -------------------------------------------------------------------------- */
.hide-scrollbar::-webkit-scrollbar { display: none; }

.hide-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* --------------------------------------------------------------------------
   10. Language selector
   -------------------------------------------------------------------------- */
.i18n-text { display: contents; }

.language-switcher {
    position: relative;
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.language-switcher-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.language-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    width: 2.45rem;
    height: 2rem;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 0.65rem;
    background: transparent;
    color: rgba(45, 42, 38, 0.38);
    cursor: pointer;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.language-trigger:hover,
.language-switcher.is-open .language-trigger {
    color: rgba(45, 42, 38, 0.68);
    background: rgba(45, 42, 38, 0.045);
    border-color: var(--hairline);
}

.language-trigger:focus-visible,
.language-option:focus-visible {
    outline: 1.5px solid var(--clay);
    outline-offset: 2px;
}

.language-flag {
    display: inline-flex;
    width: 1.28rem;
    height: 0.86rem;
    flex-shrink: 0;
}

.language-flag svg {
    display: block;
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.15;
    stroke-linecap: round;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
}

.language-chevron {
    display: inline-flex;
    width: 0.45rem;
    height: 0.3rem;
    opacity: 0.72;
    transition: transform 0.2s ease;
}

.language-chevron svg {
    width: 100%;
    height: 100%;
}

.language-switcher.is-open .language-chevron {
    transform: rotate(180deg);
}

.language-menu {
    position: absolute;
    top: calc(100% + 0.55rem);
    right: 0;
    z-index: 120;
    min-width: 10.5rem;
    padding: 0.4rem;
    border: 1px solid var(--hairline);
    border-radius: 0.9rem;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: var(--shadow-warm-md);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
}

.language-menu[hidden] { display: none; }

.language-option {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    width: 100%;
    padding: 0.62rem 0.68rem;
    border-radius: 0.62rem;
    color: rgba(45, 42, 38, 0.64);
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: color 0.18s ease, background-color 0.18s ease;
}

.language-option:hover {
    color: var(--ink);
    background: rgba(45, 42, 38, 0.045);
}

.language-option.is-active {
    color: var(--ink);
    background: rgba(145, 108, 92, 0.08);
}

.language-option-name { flex: 1; }

.language-option-check {
    width: 0.34rem;
    height: 0.34rem;
    border-radius: 50%;
    background: var(--clay);
    opacity: 0;
    transform: scale(0.5);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.language-option.is-active .language-option-check {
    opacity: 1;
    transform: scale(1);
}
