:root {
    --ink: #333333;
    --muted: #6c7280;
    --line: #d9dde5;
    --page: #f7f7f7;
    --surface: #ffffff;
    --primary: #2b78d0;
    --primary-dark: #1f5da5;
    --orange: #ef8500;
    --shadow: 0 10px 30px rgba(0, 0, 0, .24);
    --bar-height: 64px;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
    margin: 0;
    color: var(--ink);
    font-family: Arial, "Segoe UI", sans-serif;
}
button, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

/* Écran de sélection inspiré du modèle Odoo fourni. */
.selector-page {
    min-height: 100vh;
    background-color: #f5f5f5;
    background-image:
        linear-gradient(45deg, rgba(0,0,0,.018) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(0,0,0,.018) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, rgba(0,0,0,.018) 75%),
        linear-gradient(-45deg, transparent 75%, rgba(0,0,0,.018) 75%);
    background-size: 4px 4px;
    background-position: 0 0, 0 2px, 2px -2px, -2px 0;
}

.selector-shell {
    min-height: 100vh;
    display: grid;
    place-content: center;
    padding: 24px 16px;
}

.selector-card {
    width: min(510px, calc(100vw - 32px));
    background: var(--surface);
    border: 1px solid #aaa;
    border-radius: 5px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.selector-header {
    display: grid;
    place-items: center;
    min-height: 250px;
    padding: 32px 24px 22px;
}

.selector-logo {
    display: block;
    width: min(400px, 94%);
    max-height: 165px;
    object-fit: contain;
}


.selector-subtitle {
    margin-top: 16px;
    color: var(--muted);
    font-size: 15px;
    text-align: center;
}

.selector-form {
    padding: 22px 14px 26px;
    border-top: 1px solid #ededed;
}

.selector-form label,
.workspace-selector label {
    display: block;
    margin-bottom: 7px;
    font-size: 14px;
    font-weight: 700;
}

select {
    width: 100%;
    height: 36px;
    padding: 0 12px;
    color: #444;
    background: #fff;
    border: 1px solid #999;
    border-radius: 4px;
    outline: none;
}
select:focus {
    border-color: #4aa3ff;
    box-shadow: 0 0 0 2px rgba(74, 163, 255, .22);
}

.selector-footer {
    margin-top: 14px;
    color: #5c8ccf;
    text-align: center;
    font-size: 13px;
}

.alert {
    margin: 0 12px 4px;
    padding: 10px 12px;
    color: #9f2520;
    background: #fff1f0;
    border: 1px solid #f2b8b5;
    border-radius: 4px;
    font-size: 13px;
}

/* Module intégré sans barre supplémentaire : l'adresse PILOT 360 reste visible. */
.viewer-page {
    min-height: 100vh;
    overflow: hidden;
    background: #fff;
}

.module-workspace {
    position: fixed;
    inset: 0;
    min-width: 0;
    min-height: 0;
    background: #fff;
}

.module-frame {
    display: block;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    background: #fff;
    border: 0;
}

.noscript-box {
    position: fixed;
    left: 20px;
    right: 20px;
    bottom: 20px;
    z-index: 30;
    padding: 12px;
    color: #8e2520;
    background: #fff1f0;
    border: 1px solid #e6aaa7;
}

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


/* PILOT 360 V8 — optimisation Android et iPad. */
html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}
body {
    min-width: 0;
    overflow-x: hidden;
}
.selector-shell {
    min-height: 100svh;
    padding-top: max(18px, env(safe-area-inset-top));
    padding-right: max(16px, env(safe-area-inset-right));
    padding-bottom: max(18px, env(safe-area-inset-bottom));
    padding-left: max(16px, env(safe-area-inset-left));
}
@supports (min-height: 100dvh) {
    .selector-shell { min-height: 100dvh; }
}
.selector-form select {
    min-height: 44px;
    touch-action: manipulation;
}

/* Tablettes : carte confortable sans dépasser l’écran. */
@media (min-width: 601px) and (max-width: 1024px) {
    .selector-card { width: min(560px, calc(100vw - 48px)); }
    .selector-header { min-height: 240px; padding: 28px 28px 20px; }
    .selector-logo { width: min(430px, 92%); max-height: 175px; }
    .selector-form { padding: 24px 22px 28px; }
    .selector-form label { font-size: 15px; }
    .selector-form select { height: 48px; font-size: 16px; }
}

/* Smartphones Android / iPhone : aucun débordement et aucune mise au point avec zoom. */
@media (max-width: 600px) {
    .selector-shell { place-content: center; padding-top: max(14px, env(safe-area-inset-top)); }
    .selector-card { width: 100%; max-width: 440px; border-radius: 7px; }
    .selector-header { min-height: 205px; padding: 24px 16px 18px; }
    .selector-logo { width: min(330px, 96%); max-height: 145px; }
    .selector-subtitle { margin-top: 10px; font-size: 13px; line-height: 1.35; }
    .selector-form { padding: 20px 14px 24px; }
    .selector-form label { font-size: 15px; }
    .selector-form select { height: 50px; padding: 0 14px; font-size: 16px; }
    .selector-footer { margin-top: 12px; padding: 0 8px; font-size: 12px; line-height: 1.4; }
}
