/* Portail client Eco-Verdure : en-tête, connexion, bannières. La messagerie est stylée par chatview.css. */

/* Satoshi (Indian Type Foundry, Fontshare), la police du site eco-verdure.com.
   ITF Free Font License : auto-hébergement permis pour nos propres sites, fichiers non modifiés (voir fonts/Satoshi-LICENSE-FFL.txt). */
@font-face { font-family: "Satoshi"; src: url("/fonts/Satoshi-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Satoshi"; src: url("/fonts/Satoshi-Medium.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Satoshi"; src: url("/fonts/Satoshi-Bold.woff2") format("woff2"); font-weight: 600 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Satoshi"; src: url("/fonts/Satoshi-Black.woff2") format("woff2"); font-weight: 800 900; font-style: normal; font-display: swap; }
:root {
    --pt-primary: #134F48;
    --pt-primary-dark: #0E3B36;
    --pt-accent: #9DBF00;
    --pt-cream: #F2EADF;
    --pt-text: #1C2B29;
    --pt-muted: #5A6B68;
    --pt-border: #E3DACB;
    --pt-error: #A3271B;
    --pt-font: "Satoshi", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    /* Le site eco-verdure.com utilise aussi Satoshi pour ses titres */
    --pt-font-display: "Satoshi", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
    margin: 0;
    background: var(--pt-cream);
    color: var(--pt-text);
    font-family: var(--pt-font);
    display: flex;
    flex-direction: column;
    -webkit-text-size-adjust: 100%;
}

[hidden] { display: none !important; }

.pt-icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- En-tête ---------- */
.pt-header {
    background: var(--pt-primary);
    color: var(--pt-cream);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 32px;
    padding-top: calc(12px + env(safe-area-inset-top));
}

.pt-brand { display: flex; align-items: center; gap: 16px; color: inherit; text-decoration: none; min-height: 44px; }
.pt-logo { width: 186px; height: auto; display: block; }
.pt-brand-sub {
    font-size: 11px; font-weight: 700; letter-spacing: 1.6px; text-transform: uppercase; color: #C9D99A;
    border: 1px solid #2E6A63; border-radius: 60px; padding: 5px 11px; white-space: nowrap;
}

.pt-user { display: flex; align-items: center; gap: 12px; }
.pt-avatar {
    width: 40px; height: 40px; border-radius: 50%;
    background: var(--pt-cream); color: var(--pt-primary);
    font-weight: 800; font-size: 14px;
    display: inline-flex; align-items: center; justify-content: center;
}
.pt-user-name { font-weight: 700; font-size: 14px; }

.pt-icon-btn {
    width: 44px; height: 44px; border-radius: 50%;
    border: 1px solid #2E6A63; background: transparent; color: var(--pt-cream);
    display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.pt-icon-btn:hover { background: var(--pt-primary-dark); }

.pt-link-btn {
    border: 0; background: transparent; color: inherit; font: inherit; font-size: 14px; font-weight: 700;
    text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 10px 4px; min-height: 44px;
}
.pt-header .pt-link-btn { color: #DCE8E5; }

/* ---------- Contenu ---------- */
.pt-main { flex: 1; min-height: 0; display: flex; flex-direction: column; }

.pt-login { flex: 1; display: flex; align-items: center; justify-content: center; padding: 32px 16px; }
.pt-card {
    width: 100%; max-width: 440px; background: #FFFFFF; border-radius: 20px; padding: 32px;
    display: flex; flex-direction: column; gap: 16px;
}
.pt-login-title { margin: 0; font-family: var(--pt-font-display); font-size: 36px; font-weight: 600; color: var(--pt-primary); }
.pt-login-intro { margin: 0; color: var(--pt-muted); line-height: 1.5; }

.pt-form { display: flex; flex-direction: column; gap: 10px; }
.pt-label { font-size: 14px; font-weight: 700; }
.pt-input {
    height: 48px; border: 1px solid var(--pt-border); border-radius: 12px; padding: 0 14px;
    font: inherit; font-size: 16px; color: var(--pt-text); background: #F8F4EE; width: 100%;
}
.pt-input:focus { outline: 3px solid var(--pt-accent); outline-offset: 1px; border-color: var(--pt-primary); }
.pt-input-code { font-size: 24px; letter-spacing: 8px; text-align: center; font-weight: 700; }
.pt-hint { margin: 0; font-size: 14px; color: var(--pt-muted); line-height: 1.5; }
.pt-error { margin: 0; color: var(--pt-error); font-size: 14px; font-weight: 700; }

.pt-btn {
    min-height: 48px; padding: 0 22px; border-radius: 60px; border: 0;
    background: var(--pt-accent); color: var(--pt-primary-dark);
    font: inherit; font-weight: 800; font-size: 15px; cursor: pointer;
}
.pt-btn:hover { background: #B2D41A; }
.pt-btn:focus-visible, .pt-link-btn:focus-visible, .pt-icon-btn:focus-visible, .pt-close:focus-visible { outline: 3px solid var(--pt-accent); outline-offset: 2px; }
.pt-btn:disabled { opacity: 0.6; cursor: progress; }
.pt-btn-small { min-height: 44px; padding: 0 16px; font-size: 13px; }
.pt-btn-outline { background: #FFFFFF; border: 1px solid var(--pt-primary); color: var(--pt-primary); }
.pt-btn-outline:hover { background: #EEF3DC; }

/* ---------- Application ---------- */
.pt-app { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 12px; padding: 20px 32px 24px; max-width: 1480px; width: 100%; margin: 0 auto; }
.pt-chat { flex: 1; min-height: 480px; }

.pt-banners { display: flex; flex-wrap: wrap; gap: 12px; }
.pt-banners:empty { display: none; }
.pt-banner {
    flex: 1 1 320px; background: #FFFFFF; border-radius: 20px; padding: 12px 12px 12px 14px;
    display: flex; align-items: center; gap: 12px;
}
.pt-banner-icon {
    width: 44px; height: 44px; flex: none; border-radius: 12px; background: #E4EEC0; color: var(--pt-primary);
    display: inline-flex; align-items: center; justify-content: center;
}
.pt-banner-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 13px; color: var(--pt-muted); line-height: 1.35; }
.pt-banner-text strong { color: var(--pt-text); font-size: 14px; }
.pt-close {
    width: 44px; height: 44px; flex: none; border-radius: 50%; border: 0; background: transparent; color: var(--pt-muted);
    display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}

.pt-chat .cv { --cv-font-display: var(--pt-font-display); }

/* ---------- Dialogue ---------- */
.pt-dialog { border: 0; border-radius: 20px; padding: 28px; width: min(92vw, 460px); color: var(--pt-text); }
.pt-dialog::backdrop { background: rgba(14, 59, 54, 0.45); }
.pt-dialog-title { margin: 0 0 6px; font-family: var(--pt-font-display); font-size: 26px; font-weight: 600; color: var(--pt-primary); }
.pt-dialog-actions { display: flex; justify-content: flex-end; align-items: center; gap: 12px; margin-top: 8px; }
.pt-dialog select.pt-input { appearance: auto; }

/* ---------- Mobile ---------- */
@media (max-width: 760px) {
    .pt-header { padding: 10px 16px; padding-top: calc(10px + env(safe-area-inset-top)); }
    .pt-user-name { display: none; }
    .pt-logo { width: 140px; }
    .pt-brand { gap: 10px; }
    .pt-app { padding: 0; gap: 0; }
    .pt-banners { padding: 10px; gap: 8px; }
    .pt-chat { min-height: 0; }
    body.pt-in-thread .pt-header, body.pt-in-thread .pt-banners { display: none; }
    .pt-card { padding: 24px; }
}

/* Application installée : occuper tout l'écran */
@media (display-mode: standalone) {
    .pt-app { height: 100%; }
}
