/*
 * Jetons visuels communs au site du nœud et à l'app dür.air.
 * Source : DesignSystem.swift (Color.appAccent, iconInactive…), BrowserColor,
 * ProjectArchiveState (sync*Color). Voir docs/AUDIT_WEB_APP_UNIFIE.md (dépôt de l'app).
 *
 * Une page adopte la palette de l'app en chargeant cette feuille après ses propres
 * styles et en posant la classe « dur-app » sur <body>. Les pages qui ne la chargent
 * pas gardent leurs couleurs (les valeurs de repli de header-nav.js).
 */
:root {
    /* Accent : cyan du logo (Color.appAccent #1EA7FF). */
    --accent: #1EA7FF;
    --accent-rgb: 30, 167, 255;
    --accent-soft: rgba(30, 167, 255, 0.2);   /* modeBgActive */

    /* Fonds : noir, voile cyan (AppBackground.cyanCloud). */
    --bg: #04080C;
    --bg2: #0B131B;                            /* surfaces opaques : fenêtres, menus */
    --surface: rgba(255, 255, 255, 0.05);      /* BrowserColor.cardFill */
    --border: rgba(255, 255, 255, 0.12);       /* cardStroke, un cran plus visible au web */
    --menu-bg: #0F1922;                        /* menus déroulants de l'en-tête */
    --on-accent: #FFFFFF;                      /* texte posé sur l'accent */

    /* Textes (BrowserColor). */
    --text: #FFFFFF;
    --text2: rgba(255, 255, 255, 0.62);
    --text3: rgba(255, 255, 255, 0.42);

    /* États de l'archive (ProjectArchiveState) et du web. */
    --green: #38B861;                          /* Sauvegardé */
    --yellow: #F2B814;                         /* À sauvegarder, À récupérer */
    --red: #FF6B66;                            /* BrowserColor.destructive, lisible sur noir */
    --problem: #E63838;                        /* Conflit, hors ligne */
    --web: #33C7FF;                            /* webExportHighlight */

    /* Rôles dans un programme. */
    --grant-host: #D4A15A;
    --grant-enrich-acquire: #5B8DEF;
    --grant-enrich: #3D9A6A;
    --grant-reader: rgba(255, 255, 255, 0.55);

    /* Formes et police (SF Rounded dans l'app). */
    --radius-card: 14px;
    --radius-field: 10px;
    --font-round: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}

body.dur-app {
    background:
        radial-gradient(120% 80% at 15% -10%, rgba(30, 167, 255, 0.10), transparent 60%),
        linear-gradient(180deg, #000 0%, #08141F 55%, #000 100%) fixed;
    background-color: #000;
    color: var(--text);
}

body.dur-app h1,
body.dur-app h2,
body.dur-app h3,
body.dur-app .btn,
body.dur-app button[type="submit"],
body.dur-app .pchip {
    font-family: var(--font-round);
}

body.dur-app header {
    background: rgba(0, 0, 0, 0.55);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

/* Cartes et fenêtres : coins arrondis comme les cartes de l'app. */
body.dur-app .login-box,
body.dur-app .section,
body.dur-app .filters-bar,
body.dur-app .project-card,
body.dur-app .modal {
    border-radius: var(--radius-card);
    border-color: rgba(255, 255, 255, 0.1);
}
body.dur-app .login-box,
body.dur-app .modal {
    background: rgba(11, 19, 27, 0.92);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
body.dur-app .project-card,
body.dur-app .filters-bar,
body.dur-app .section {
    background: rgba(255, 255, 255, 0.04);
}

/* Bouton principal : capsule cyan, texte blanc, halo (GlassCapsuleButtonStyle .primary). */
body.dur-app .btn,
body.dur-app .login-box button {
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    box-shadow: 0 2px 8px rgba(30, 167, 255, 0.35);
}
body.dur-app .btn-secondary,
body.dur-app .btn-danger {
    box-shadow: none;
}
body.dur-app .btn-danger {
    background: rgba(255, 59, 48, 0.16);
    border-color: rgba(255, 59, 48, 0.35);
    color: #FF8C85;
}

/* Champs en verre. */
body.dur-app input[type="text"],
body.dur-app input[type="email"],
body.dur-app input[type="password"],
body.dur-app input[type="search"],
body.dur-app select,
body.dur-app textarea {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.14);
    border-radius: var(--radius-field);
    color: var(--text);
}
body.dur-app input:focus,
body.dur-app select:focus,
body.dur-app textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(30, 167, 255, 0.2);
    outline: none;
}
body.dur-app select option { background: #0B131B; color: #fff; }

/* Liens dans le texte. */
body.dur-app .hint a,
body.dur-app p a {
    color: var(--accent);
    text-decoration: none;
}
body.dur-app .hint a:hover,
body.dur-app p a:hover { text-decoration: underline; }

/* En-tête compact sur téléphone : identité et onglets sur une ligne, maison et langue sur la
 * suivante, le reste replié. Avant : environ 300 px de haut sur un iPhone. */
@media (max-width: 640px) {
    body.dur-app header { position: sticky; top: 0; z-index: 40; flex-wrap: wrap; gap: 8px 10px; padding: 10px 12px; }
    body.dur-app .header-left { width: 100%; flex-wrap: nowrap; justify-content: space-between; gap: 10px; }
    body.dur-app .header-identity { gap: 8px; min-width: 0; }
    body.dur-app .header-avatar { width: 32px; height: 32px; }
    body.dur-app header h1 { font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    body.dur-app .who { display: none; }
    body.dur-app .nav-personal { flex-wrap: nowrap; gap: 2px; }
    body.dur-app .header-right { width: 100%; margin-left: 0; flex-wrap: nowrap; justify-content: space-between; gap: 6px; }
    body.dur-app .nav-house:not(.hidden) { min-width: 0; flex-wrap: nowrap; gap: 4px; padding-left: 0; border-left: 0; }
    body.dur-app .hn-house-role,
    body.dur-app .nav-cluster-label,
    body.dur-app .hn-sep,
    body.dur-app .durair-help-btn { display: none; }
    body.dur-app .hn-house-name { max-width: 7.5rem; }
}
