/* Copia da platformisds/public/assets/css/design-tokens.css — non modificare qui:
   si riallinea ricopiando il file dal Club. */
/* =====================================================
   DESIGN TOKENS — Piattaforma ISDS
   Brand: I Segreti dello Stile
   Direction: Luxury club / editorial / dark-first
   ===================================================== */

:root {
    /* ── Display serif (editorial) ─────────────────── */
    --font-display: "Fraunces", "Playfair Display", Georgia, serif;
    /* Existing: --font-inter, --font-barlow already defined in style.css */

    /* ── Gold accent (membership / premium) ─────────
       Used ONLY for: primary CTAs, premium badges, live
       indicators, recommended tier, focus rings.
       Never decorative. */
    --gold: 38 32% 58%;           /* hsl(38, 32%, 58%)  — muted brass */
    --gold-soft: 38 30% 70%;      /* hover / highlight  */
    --gold-deep: 36 30% 42%;      /* pressed / active   */
    --gold-ink: 36 35% 18%;       /* ink on gold bg     */

    /* ── Semantic status (warm-harmonised) ───────────
       Replaces Bootstrap #198754 / #dc3545 / #ffc107 */
    --status-pending: 38 55% 55%;     /* ochre          */
    --status-pending-bg: 38 40% 14%;
    --status-approved: 95 25% 45%;    /* olive green    */
    --status-approved-bg: 95 20% 14%;
    --status-rejected: 8 50% 50%;     /* brick red      */
    --status-rejected-bg: 8 35% 14%;
    --status-info: 200 25% 55%;       /* dust blue      */
    --status-info-bg: 200 20% 14%;

    /* ── Surfaces (dark-first) ───────────────────────
       Extend shadcn tokens from style.css */
    --surface-1: 24 6% 8%;        /* base dark page bg   */
    --surface-2: 24 6% 11%;       /* card surface        */
    --surface-3: 24 6% 14%;       /* raised card / modal */
    --hairline: 30 10% 22%;       /* subtle dividers     */

    /* ── Ink (testo su superfici scure) ──────────────
       Fonte unica: i --wardrobe-* sono alias di questi. */
    --ink: #f5f2ec;
    --ink-muted: rgba(245, 242, 236, 0.62);
    --ink-dim: rgba(245, 242, 236, 0.42);
    --border-soft: rgba(245, 242, 236, 0.09);
    --border-strong: rgba(245, 242, 236, 0.18);

    /* ── Motion ──────────────────────────────────────
       Luxury motion: slower, ease-out, interruptible */
    --dur-fast: 180ms;
    --dur-base: 320ms;
    --dur-slow: 480ms;
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-in: cubic-bezier(0.64, 0, 0.78, 0);
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);

    /* ── Editorial type scale (display) ─────────────
       Used for serif titles. Body/UI keep the Inter
       scale already defined in style.css. */
    --fs-display: clamp(2rem, 4vw + 1rem, 3.5rem);   /* 32→56 */
    --fs-h1: clamp(1.75rem, 2.4vw + 1rem, 2.5rem);   /* 28→40 */
    --fs-h2: clamp(1.375rem, 1.2vw + 1rem, 1.75rem); /* 22→28 */
    --fs-h3: clamp(1.125rem, 0.6vw + 1rem, 1.375rem);/* 18→22 */
    --fs-kicker: 0.75rem;   /* 12 — eyebrow uppercase tracked */

    /* ── Alias storici --wardrobe-* ──────────────────
       Vivevano in wardrobe.css, ma mentor.css/feedback.css li usano
       anche nel layout admin (che wardrobe.css non lo carica):
       la fonte unica deve stare qui, caricata ovunque. */
    --wardrobe-gold: hsl(var(--gold));
    --wardrobe-gold-hover: hsl(var(--gold-soft));
    --wardrobe-gold-soft: hsla(var(--gold) / 0.45); /* bordi/velature oro */
    --wardrobe-ink: var(--ink);
    --wardrobe-ink-muted: var(--ink-muted);
    --wardrobe-surface: hsl(var(--surface-1));
    --wardrobe-surface-2: hsl(var(--surface-2));
    --wardrobe-border: var(--border-soft);
    --wardrobe-border-strong: var(--border-strong);
    --wardrobe-radius: 10px;
    --wardrobe-motion: var(--dur-base) var(--ease-out);
}

/* =====================================================
   GLOBAL A11Y & MOTION
   ===================================================== */

/* Visible focus ring for keyboard users only */
*:focus-visible {
    outline: 2px solid hsl(var(--gold));
    outline-offset: 2px;
    border-radius: 3px;
}
/* Remove default webkit/moz dotted ring when focus-visible is active */
button:focus:not(:focus-visible),
a:focus:not(:focus-visible),
input:focus:not(:focus-visible),
textarea:focus:not(:focus-visible),
select:focus:not(:focus-visible) {
    outline: none;
}

/* Respect user motion preference */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* =====================================================
   EDITORIAL TYPOGRAPHY HELPERS
   ===================================================== */

.tt-serif { font-family: var(--font-display); font-weight: 500; letter-spacing: -0.01em; }
.tt-serif-italic { font-family: var(--font-display); font-style: italic; font-weight: 400; }

.tt-eyebrow {
    font-family: var(--font-inter);
    font-size: var(--fs-kicker);
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: hsl(var(--gold));
    display: inline-block;
}
.tt-eyebrow--muted { color: rgba(255,255,255,0.55); }

.tt-display { font-family: var(--font-display); font-weight: 500; font-size: var(--fs-display); line-height: 1.05; letter-spacing: -0.02em; color: #fff; }
.tt-h1-serif { font-family: var(--font-display); font-weight: 500; font-size: var(--fs-h1); line-height: 1.12; letter-spacing: -0.015em; color: #fff; }
.tt-h2-serif { font-family: var(--font-display); font-weight: 500; font-size: var(--fs-h2); line-height: 1.2; letter-spacing: -0.01em; color: #fff; }
.tt-h3-serif { font-family: var(--font-display); font-weight: 500; font-size: var(--fs-h3); line-height: 1.3; color: #fff; }

/* =====================================================
   SISTEMA BOTTONI — sei ruoli (scelta E: pill + maiuscolo)
   Le azioni parlano MAIUSCOLO tracciato in pillola piena;
   filtri ed etichette restano pillole minuscole
   (.wardrobe-pill, .tt-status): i due linguaggi non si
   confondono mai.
   Nei nuovi template usare .btn + ruolo; .tt-btn-gold e
   .wardrobe-btn restano come alias storici.
   ===================================================== */

:root {
    --btn-radius: 999px;
    --btn-track: 0.13em;
    --btn-weight: 650;
    --btn-fs: 12px;
    --btn-fs-sm: 10.5px;
    --btn-fs-lg: 13px;
}

/* base comune a tutti i ruoli */
.btn,
.tt-btn-gold,
.wardrobe-btn {
    box-sizing: border-box;
    display: inline-flex; align-items: center; justify-content: center; gap: 9px;
    height: 40px; padding: 0 22px;
    font-family: var(--font-inter);
    font-size: var(--btn-fs);
    font-weight: var(--btn-weight);
    letter-spacing: var(--btn-track);
    text-transform: uppercase;
    line-height: 1; white-space: nowrap;
    color: var(--ink);
    background: none;
    border: 1px solid transparent;
    border-radius: var(--btn-radius);
    text-decoration: none;
    cursor: pointer;
    user-select: none;
    transition: background var(--dur-fast) var(--ease-out),
                border-color var(--dur-fast) var(--ease-out),
                color var(--dur-fast) var(--ease-out),
                transform var(--dur-fast) var(--ease-out),
                box-shadow var(--dur-fast) var(--ease-out);
}
.btn:active,
.tt-btn-gold:active,
.wardrobe-btn:active { transform: translateY(1px); }
.btn:disabled, .btn.is-disabled, .btn[aria-disabled="true"],
.tt-btn-gold:disabled, .tt-btn-gold.is-disabled,
.wardrobe-btn:disabled { opacity: 0.42; pointer-events: none; }
.btn > svg { width: 14px; height: 14px; flex-shrink: 0; }

/* taglie */
.btn--sm,
.tt-btn-gold--sm { height: 32px; padding: 0 14px; font-size: var(--btn-fs-sm); gap: 7px; }
.btn--lg,
.tt-btn-gold--lg { height: 48px; padding: 0 30px; font-size: var(--btn-fs-lg); }
.btn--block { width: 100%; }

/* 1 · Primario, oro pieno. Regola dura: al massimo uno per vista. */
.btn--gold,
.tt-btn-gold {
    color: hsl(var(--gold-ink));
    background: linear-gradient(180deg, hsl(var(--gold-soft)), hsl(var(--gold)));
    border-color: hsl(var(--gold));
    box-shadow: 0 1px 0 rgba(255,255,255,0.15) inset, 0 8px 24px -10px rgba(180,140,60,0.35);
}
.btn--gold:hover,
.tt-btn-gold:hover {
    background: linear-gradient(180deg, hsl(var(--gold)), hsl(var(--gold-deep)));
    transform: translateY(-1px);
    color: hsl(var(--gold-ink));
    box-shadow: 0 2px 0 rgba(255,255,255,0.2) inset, 0 14px 32px -12px rgba(180,140,60,0.5);
}
.btn--gold:active,
.tt-btn-gold:active { transform: translateY(0); }

/* 2 · Secondario, contorno oro: l'alternativa qualificata. */
.btn--outline,
.tt-btn-gold--outline {
    background: transparent;
    color: hsl(var(--gold));
    border-color: hsla(var(--gold) / 0.55);
    box-shadow: none;
}
.btn--outline:hover,
.tt-btn-gold--outline:hover {
    background: hsla(var(--gold) / 0.1);
    border-color: hsl(var(--gold));
    color: hsl(var(--gold-soft));
    transform: none;
}

/* 3 · Neutro, contorno avorio: annulla, torna, cambia. Mai oro. */
.btn--ghost,
.wardrobe-btn {
    background: transparent;
    color: var(--ink);
    border-color: var(--border-strong);
    box-shadow: none;
}
.btn--ghost:hover,
.wardrobe-btn:hover { border-color: var(--ink); color: var(--ink); transform: none; }

/* 4 · Link quieto: back-link, "vedi tutto", azioni da una riga. */
.btn--quiet {
    height: auto; padding: 2px 0;
    border: 0; border-radius: 2px;
    color: var(--ink-muted);
    gap: 7px;
}
.btn--quiet:hover { color: hsl(var(--gold)); background: none; transform: none; }
.btn--quiet .btn-arr { transition: transform var(--dur-fast) var(--ease-out); }
.btn--quiet:hover .btn-arr { transform: translateX(3px); }

/* 5 · Distruttivo: rosso mattone semantico, mai acceso. */
.btn--danger,
.wardrobe-btn--danger {
    background: transparent;
    color: hsl(var(--status-rejected));
    border-color: hsla(var(--status-rejected) / 0.4);
}
.btn--danger:hover,
.wardrobe-btn--danger:hover {
    background: hsla(var(--status-rejected) / 0.09);
    border-color: hsla(var(--status-rejected) / 0.8);
    color: hsl(8 55% 62%);
    transform: none;
}
.btn--danger-quiet { color: var(--ink-dim); border-color: transparent; }
.btn--danger-quiet:hover {
    color: hsl(var(--status-rejected));
    background: hsla(var(--status-rejected) / 0.08);
}

/* 6 · Icona: sempre circolare, sempre con aria-label. */
.btn--icon {
    width: 40px; padding: 0; border-radius: 50%;
    color: var(--ink-muted);
    border-color: var(--border-strong);
}
.btn--icon:hover { color: var(--ink); border-color: var(--ink); transform: none; }
.btn--icon.btn--sm { width: 32px; }
.btn--icon.btn--bare { border-color: transparent; background: rgba(255,255,255,0.06); }
.btn--icon.btn--bare:hover { background: rgba(255,255,255,0.12); border-color: transparent; }
.btn--icon.btn--danger { border-color: transparent; color: var(--ink-dim); }
.btn--icon.btn--danger:hover {
    color: hsl(var(--status-rejected));
    background: hsla(var(--status-rejected) / 0.09);
    border-color: transparent;
}

/* stato di caricamento: <span class="btn-spin"></span> + testo */
.btn .btn-spin,
.tt-btn-gold .btn-spin {
    width: 13px; height: 13px; border-radius: 50%;
    border: 2px solid currentColor; border-right-color: transparent;
    animation: btn-spin 0.7s linear infinite;
    flex-shrink: 0;
}
@keyframes btn-spin { to { transform: rotate(360deg); } }

/* =====================================================
   STATUS PILL (reusable, semantic)
   ===================================================== */

.tt-status {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 3px 11px;
    font-family: var(--font-inter);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    border-radius: 999px;
    border: 1px solid transparent;
    line-height: 1.4;
    white-space: nowrap;
}
.tt-status::before {
    content: "";
    width: 6px; height: 6px; border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}
.tt-status--pending  { color: hsl(var(--status-pending));  background: hsl(var(--status-pending-bg));  border-color: hsla(var(--status-pending) / 0.35); }
.tt-status--approved { color: hsl(var(--status-approved)); background: hsl(var(--status-approved-bg)); border-color: hsla(var(--status-approved) / 0.35); }
.tt-status--rejected { color: hsl(var(--status-rejected)); background: hsl(var(--status-rejected-bg)); border-color: hsla(var(--status-rejected) / 0.35); }
.tt-status--info     { color: hsl(var(--status-info));     background: hsl(var(--status-info-bg));     border-color: hsla(var(--status-info) / 0.35); }
.tt-status--premium  { color: hsl(var(--gold));            background: hsla(var(--gold) / 0.1);           border-color: hsla(var(--gold) / 0.4); }
.tt-status--white    { color: #1a1208;                      background: #fff;                            border-color: #fff; }
/* Stato neutro (bozza, livello FREE, riga inattiva): usato da tempo nelle viste
   ma mai definito, quindi quelle pillole uscivano trasparenti e senza colore. */
.tt-status--muted    { color: var(--ink-dim);               background: rgba(255, 255, 255, 0.05);       border-color: rgba(255, 255, 255, 0.12); }
.tt-status--no-dot::before { display: none; }

/* Ambiente e versione (partials/env-pill.php), visibile solo agli admin: nella
   sidebar accanto a «Pannello Admin» e nell'header del pannello admin.
   Ocra su test, verde in produzione. */
.tt-env-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 700;
    line-height: 1.4;
    white-space: nowrap;
}
.tt-env-pill__nome {
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.tt-env-pill__versione {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    opacity: 0.85;
}
.tt-env-pill--pending {
    background: hsl(var(--status-pending-bg));
    color: hsl(var(--status-pending));
}
.tt-env-pill--approved {
    background: hsl(var(--status-approved-bg));
    color: hsl(var(--status-approved));
}

/* =====================================================
   GOLD SEAL (membership marker, recommended tier badge)
   Sits above cards. Tiny, refined, NOT a giant gradient badge.
   ===================================================== */

.tt-seal {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    display: inline-flex; align-items: center; gap: 8px;
    padding: 5px 14px;
    font-family: var(--font-inter);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: hsl(var(--gold-ink));
    background: linear-gradient(180deg, hsl(var(--gold-soft)), hsl(var(--gold)));
    border-radius: 999px;
    box-shadow: 0 4px 16px -4px rgba(180,140,60,0.45);
    white-space: nowrap;
}
.tt-seal--muted {
    color: hsl(var(--gold));
    background: hsla(var(--gold) / 0.1);
    border: 1px solid hsla(var(--gold) / 0.4);
    box-shadow: none;
}
.tt-seal svg { width: 12px; height: 12px; }

/* =====================================================
   ALERT (flash messages) — override Bootstrap warm-toned
   ===================================================== */

.alert {
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 14px;
    border: 1px solid transparent;
    line-height: 1.5;
}
.alert-success  { color: hsl(var(--status-approved)); background: hsl(var(--status-approved-bg)); border-color: hsla(var(--status-approved) / 0.3); }
.alert-danger   { color: hsl(var(--status-rejected)); background: hsl(var(--status-rejected-bg)); border-color: hsla(var(--status-rejected) / 0.3); }
.alert-info     { color: hsl(var(--status-info));     background: hsl(var(--status-info-bg));     border-color: hsla(var(--status-info) / 0.3); }
.alert-warning  { color: hsl(var(--status-pending));  background: hsl(var(--status-pending-bg));  border-color: hsla(var(--status-pending) / 0.3); }

/* =====================================================
   TEXT CONTRAST HELPERS (AA compliant on dark surface)
   Replace rgba(255,255,255,0.4/0.5) with these:
   ===================================================== */

.tt-text-dim   { color: rgba(255, 255, 255, 0.72); }
.tt-text-muted { color: rgba(255, 255, 255, 0.62); }
.tt-text-soft  { color: rgba(255, 255, 255, 0.82); }

/* Inline text-button used inside alerts/banners */
.tt-link-inline {
    background: none;
    border: none;
    color: inherit;
    text-decoration: underline;
    cursor: pointer;
    font-size: inherit;
    font-family: inherit;
    padding: 0;
}
.tt-link-inline:hover { opacity: 0.8; }

/* =====================================================
   PRESS FEEDBACK on tappable cards
   ===================================================== */

.tt-tappable {
    transition: transform var(--dur-base) var(--ease-out),
                box-shadow var(--dur-base) var(--ease-out),
                border-color var(--dur-base) var(--ease-out);
    will-change: transform;
}
.tt-tappable:active { transform: scale(0.985); }

/* =====================================================
   MOBILE INPUT FONT-SIZE FLOOR (anti auto-zoom iOS)
   Safari iOS zooma la pagina al focus di qualsiasi campo
   con font-size < 16px. Floor globale con !important:
   vince su ogni regola componente e su stili inline senza
   toccare il design desktop. Gli input volutamente grandi
   (> 16px, es. input.mentor-chat__subject) vanno esclusi
   qui sotto, altrimenti verrebbero ridotti a 16px.
   ===================================================== */
@media (max-width: 767px) {
    input[type="text"]:not(.mentor-chat__subject),
    input[type="email"],
    input[type="password"],
    input[type="search"],
    input[type="tel"],
    input[type="url"],
    input[type="number"],
    input[type="date"],
    input[type="time"],
    input[type="datetime-local"],
    input[type="month"],
    input[type="week"],
    input:not([type]),
    textarea,
    select,
    trix-editor,
    [contenteditable="true"] {
        font-size: 16px !important;
    }
}
