/* ==========================================================================
   OWL Diagnostic Kiosk — kiosk.css
   Touchscreen kiosk interface styles
   ========================================================================== */

/* --------------------------------------------------------------------------
   Poppins — auto-hébergé (pas de dépendance CDN, pas de FOUT)
   -------------------------------------------------------------------------- */
@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url('../fonts/poppins-400-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
                 U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF,
                 U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url('../fonts/poppins-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
                 U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
                 U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 600;
  font-display: block;
  src: url('../fonts/poppins-600-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
                 U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF,
                 U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 600;
  font-display: block;
  src: url('../fonts/poppins-600-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
                 U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
                 U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 700;
  font-display: block;
  src: url('../fonts/poppins-700-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
                 U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF,
                 U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 700;
  font-display: block;
  src: url('../fonts/poppins-700-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
                 U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
                 U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* --------------------------------------------------------------------------
   CSS Custom Properties
   -------------------------------------------------------------------------- */
:root {
  --primary:       #1B2A4A;
  --primary-dark:  #0D2138;
  --accent:        #CC9900;
  --accent-light:  #CBA328;
  --bg-light:      #F3F5F9;
  --text:          #1a1a2e;
  --white:         #ffffff;
  --error:         #ff6b6b;
  --overlay-glass: rgba(13, 33, 56, 0.85);
  --input-bg:      rgba(255, 255, 255, 0.08);
  --input-bg-focus:rgba(255, 255, 255, 0.12);
  --input-border:  rgba(255, 255, 255, 0.2);
  --font-main:     'Poppins', Georgia, serif;
}

/* --------------------------------------------------------------------------
   1. Reset & Base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin:     0;
  padding:    0;
}

html {
  height: 100%;
  font-size: 16px;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

body {
  height:      100%;
  width:       100%;
  overflow:    hidden;
  background:  var(--primary-dark);
  color:       var(--white);
  font-family: var(--font-main);
  font-size:   16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

ul {
  list-style: none;
}

button {
  font-family: var(--font-main);
}

/* --------------------------------------------------------------------------
   2. Slideshow Overlay (#slideshow-overlay)
   -------------------------------------------------------------------------- */
#slideshow-overlay {
  position:       fixed;
  top:            0;
  left:           0;
  width:          100vw;
  height:         100vh;
  z-index:        100;
  background:     var(--primary-dark);
  opacity:        0;
  pointer-events: none;
  transition:     opacity 0.5s ease;
}

#slideshow-overlay.active {
  opacity:        1;
  pointer-events: all;
}

/* Slide image container */
#slideshow-images {
  position: absolute;
  inset:    0;
  overflow: hidden;
}

/* Individual slide images */
.slide-img {
  position:   absolute;
  inset:      0;
  width:      100%;
  height:     100%;
  object-fit: cover;
  opacity:    0;
  transition: opacity 1s ease;
}

.slide-img.visible {
  opacity: 1;
}

/* Fallback when no images are configured */
.no-images-bg {
  position:        absolute;
  inset:           0;
  display:         flex;
  flex-direction:  column;
  align-items:     center;
  justify-content: center;
  gap:             24px;
  background:      var(--primary-dark);
}

.no-images-bg .logo-placeholder {
  width:     160px;
  height:    160px;
  object-fit: contain;
  animation: pulse-logo 2s ease-in-out infinite;
}

.no-images-bg .no-images-label {
  color:       rgba(255, 255, 255, 0.5);
  font-size:   15px;
  font-weight: 400;
}

@keyframes pulse-logo {
  0%, 100% { opacity: 1;   transform: scale(1); }
  50%       { opacity: 0.6; transform: scale(1.06); }
}

/* --------------------------------------------------------------------------
   3. Slideshow CTA (.slideshow-cta)
   -------------------------------------------------------------------------- */
.slideshow-cta {
  position:  absolute;
  bottom:    40px;
  left:      50%;
  transform: translateX(-50%);
  z-index:   10;
}

.cta-pulse {
  display:      inline-block;
  background:   var(--overlay-glass);
  color:        var(--white);
  border:       2px solid var(--accent);
  border-radius: 16px;
  padding:      20px 40px;
  font-size:    22px;
  font-weight:  600;
  font-family:  var(--font-main);
  text-align:   center;
  white-space:  nowrap;
  cursor:       pointer;
  animation:    pulse-border 2s ease-in-out infinite;
  user-select:  none;
}

@keyframes pulse-border {
  0%, 100% {
    border-color: var(--accent);
    box-shadow:   0 0 0 0 rgba(204, 153, 0, 0.4),
                  0 0 20px rgba(204, 153, 0, 0.15);
  }
  50% {
    border-color: var(--accent-light);
    box-shadow:   0 0 0 8px rgba(204, 153, 0, 0),
                  0 0 40px rgba(204, 153, 0, 0.4);
  }
}

/* --------------------------------------------------------------------------
   4. Kiosk Form (#kiosk-form)
   -------------------------------------------------------------------------- */
#kiosk-form {
  display:          none;
  flex-direction:   column;
  align-items:      center;
  justify-content:  center;
  height:           100vh;
  overflow:         hidden;
  padding:          24px 20px;
  background:       var(--primary-dark);
}

#kiosk-form.visible {
  display: flex;
}

/* Form container — constrains width */
.form-container {
  width:      100%;
  max-width:  760px;
}

/* Form header — horizontal: logo gauche, texte droite */
.form-header {
  display:        flex;
  flex-direction: row;
  align-items:    center;
  gap:            20px;
  margin-bottom:  20px;
}

.logo-owl {
  display:     block;
  max-height:  56px;
  max-width:   200px;
  width:       auto;
  flex-shrink: 0;
}

/* Logo in the slideshow no-images fallback */
.logo-pulse {
  max-height: 160px;
  max-width:  360px;
  width:      auto;
  animation:  pulse-logo 2.5s ease-in-out infinite;
}

.form-header h1 {
  font-size:     20px;
  font-weight:   700;
  color:         var(--white);
  line-height:   1.3;
  margin-bottom: 4px;
}

.form-header .form-subtitle {
  font-size:   13px;
  font-weight: 400;
  color:       rgba(255, 255, 255, 0.65);
  line-height: 1.4;
}

/* Deux champs côte à côte (Nom + Entreprise) */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* --------------------------------------------------------------------------
   5. Form Elements
   -------------------------------------------------------------------------- */
.form-group {
  margin-bottom: 12px;
}

label {
  display:        block;
  color:          var(--accent-light);
  font-size:      12px;
  font-weight:    600;
  margin-bottom:  5px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

input[type="text"],
input[type="email"],
input[type="url"] {
  width:        100%;
  padding:      11px 16px;
  border-radius: 10px;
  background:   var(--input-bg);
  border:       1.5px solid var(--input-border);
  color:        var(--white);
  font-size:    15px;
  font-family:  var(--font-main);
  min-height:   46px;
  outline:      none;
  transition:   border-color 0.2s ease, background 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}

input[type="text"]::placeholder,
input[type="email"]::placeholder,
input[type="url"]::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="url"]:focus {
  border-color: var(--accent);
  background:   var(--input-bg-focus);
}

/* Website YES/NO toggle */
.website-toggle {
  display: flex;
  flex-direction: row;
  gap:     12px;
}

.toggle-btn {
  flex:          1;
  min-height:    46px;
  border-radius: 10px;
  border:        2px solid var(--input-border);
  background:    transparent;
  color:         rgba(255, 255, 255, 0.6);
  font-size:     15px;
  font-family:   var(--font-main);
  font-weight:   500;
  cursor:        pointer;
  transition:    border-color 0.2s ease,
                 background   0.2s ease,
                 color        0.2s ease;
  user-select:   none;
}

.toggle-btn:active {
  transform: scale(0.97);
}

.toggle-btn.active {
  border-color: var(--accent);
  background:   rgba(204, 153, 0, 0.15);
  color:        var(--white);
  font-weight:  700;
}

/* URL group (shown/hidden based on toggle) */
#url-group {
  display: none;
}

#url-group.visible {
  display: block;
}

/* Select + input côte à côte */
.url-input-group {
  display: flex;
  align-items: stretch;
}

.url-input-group select {
  padding:        11px 10px;
  border-radius:  10px 0 0 10px;
  border:         1.5px solid var(--input-border);
  border-right:   none;
  background:     rgba(255, 255, 255, 0.15);
  color:          var(--white);
  font-family:    var(--font-main);
  font-size:      14px;
  font-weight:    600;
  cursor:         pointer;
  outline:        none;
  appearance:     none;
  -webkit-appearance: none;
  min-width:      100px;
  text-align:     center;
  flex-shrink:    0;
  transition:     border-color 0.2s ease, background 0.2s ease;
}

.url-input-group select:focus {
  border-color: var(--accent);
  background:   rgba(255, 255, 255, 0.2);
}

.url-input-group select option {
  background: var(--primary-dark);
  color:      var(--white);
}

.url-input-group input {
  border-radius:  0 10px 10px 0;
  flex:           1;
  min-width:      0; /* empêche le débordement flex */
}

/* --------------------------------------------------------------------------
   6. Analyze Button (.btn-analyze)
   -------------------------------------------------------------------------- */
.btn-analyze {
  display:        block;
  width:          100%;
  min-height:     52px;
  background:     var(--accent);
  color:          var(--white);
  border:         none;
  border-radius:  12px;
  font-size:      17px;
  font-family:    var(--font-main);
  font-weight:    700;
  cursor:         pointer;
  margin-top:     10px;
  letter-spacing: 0.3px;
  transition:     background 0.2s ease,
                  transform  0.15s ease,
                  box-shadow 0.2s ease;
}

.btn-analyze:hover {
  background:  #d4a000;
  box-shadow:  0 4px 20px rgba(204, 153, 0, 0.35);
}

.btn-analyze:active {
  transform: scale(0.98);
  background: #b38700;
}

.btn-analyze:disabled {
  opacity: 0.6;
  cursor:  not-allowed;
  transform: none;
}

/* --------------------------------------------------------------------------
   7. Loading Overlay (#loading-overlay)
   -------------------------------------------------------------------------- */
#loading-overlay {
  position:        fixed;
  inset:           0;
  background:      var(--primary-dark);
  z-index:         200;
  display:         none;
  flex-direction:  column;
  align-items:     center;
  justify-content: center;
  text-align:      center;
  padding:         40px;
}

#loading-overlay.active {
  display: flex;
}

.loading-logo {
  width:       120px;
  height:      120px;
  object-fit:  contain;
  animation:   pulse-gold 1.5s ease-in-out infinite;
}

@keyframes pulse-gold {
  0%, 100% {
    opacity:   1;
    transform: scale(1);
  }
  50% {
    opacity:   0.6;
    transform: scale(1.05);
  }
}

.loading-message {
  color:      var(--accent);
  font-size:  20px;
  font-weight: 500;
  margin-top: 30px;
  min-height: 32px;
  transition: opacity 0.3s ease;
}

.progress-bar-container {
  width:         280px;
  height:        6px;
  background:    rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  margin-top:    20px;
  overflow:      hidden;
}

.progress-bar {
  height:     100%;
  background: var(--accent);
  width:      0%;
  transition: width 0.5s ease;
  border-radius: 3px;
}

/* --------------------------------------------------------------------------
   8. Result Screen (#result-screen)
   -------------------------------------------------------------------------- */
#result-screen {
  display:         none;
  flex-direction:  column;
  align-items:     center;
  justify-content: center;
  text-align:      center;
  min-height:      100vh;
  padding:         40px 20px;
  background:      var(--primary-dark);
  overflow-y:      auto;
}

#result-screen.active {
  display: flex;
}

.result-logo {
  max-height:    70px;
  width:         auto;
  margin-bottom: 24px;
}

.result-title {
  font-size:     32px;
  font-weight:   700;
  color:         var(--white);
  margin-bottom: 20px;
  line-height:   1.3;
}

.result-level {
  font-size:     24px;
  font-weight:   700;
  color:         var(--accent);
  margin-bottom: 8px;
}

.result-stars {
  font-size:      32px;
  color:          var(--accent);
  letter-spacing: 4px;
  margin-bottom:  16px;
}

/* 2 colonnes Points forts / Priorités */
.result-cols {
  display:   grid;
  grid-template-columns: 1fr 1fr;
  gap:       0 32px;
  width:     100%;
  max-width: 860px;
  margin:    8px auto 0;
  text-align: left;
}

.result-col {
  display:        flex;
  flex-direction: column;
}

/* Séparateur vertical entre les deux colonnes */
.result-col:first-child {
  border-right: 1px solid rgba(255,255,255,0.1);
  padding-right: 28px;
}
.result-col:last-child {
  padding-left: 4px;
}

.result-section-label {
  margin:        0 0 8px;
  font-size:     11px;
  font-weight:   600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color:         rgba(255,255,255,0.4);
}

.result-strengths {
  text-align: left;
  margin:     0;
  padding:    0;
  width:      100%;
}

.result-strengths li {
  color:         #4ade80;
  margin-bottom: 10px;
  font-size:     14px;
  padding-left:  22px;
  position:      relative;
  line-height:   1.5;
}

.result-strengths li::before {
  content:     '✓';
  position:    absolute;
  left:        0;
  color:       #4ade80;
  font-size:   15px;
  font-weight: bold;
  line-height: 1.3;
}

.result-priorities {
  text-align: left;
  margin:     0;
  padding:    0;
  width:      100%;
}

.result-priorities li {
  color:         rgba(255, 255, 255, 0.85);
  margin-bottom: 10px;
  font-size:     14px;
  padding-left:  20px;
  position:      relative;
  line-height:   1.5;
}

.result-priorities li::before {
  content:  '•';
  position: absolute;
  left:     0;
  color:    var(--accent);
  font-size: 18px;
  line-height: 1.3;
}


/* Boutons d'action résultat (imprimer / email) */
.result-actions {
  display:        flex;
  gap:            14px;
  margin:         20px auto 0;
  width:          100%;
  max-width:      860px;
}

.btn-result-action {
  flex:           1;
  min-height:     52px;
  border-radius:  12px;
  font-family:    var(--font-main);
  font-size:      15px;
  font-weight:    600;
  cursor:         pointer;
  transition:     background 0.2s ease, transform 0.15s ease, opacity 0.2s ease;
  border:         2px solid transparent;
}

.btn-result-action:active  { transform: scale(0.97); }
.btn-result-action:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.btn-print {
  background: var(--accent);
  color:      var(--white);
  border-color: var(--accent);
}
.btn-print:hover:not(:disabled) { background: #d4a000; }

.btn-email {
  background:   transparent;
  color:        var(--accent);
  border-color: var(--accent);
}
.btn-email:hover:not(:disabled) {
  background: rgba(204, 153, 0, 0.12);
  color:      var(--white);
}

/* Feedback action (confirmation impression / email) */
.result-action-feedback {
  display:       none;
  margin:        12px auto 0;
  max-width:     500px;
  width:         100%;
  padding:       12px 20px;
  border-radius: 10px;
  font-size:     14px;
  font-weight:   500;
  text-align:    center;
}
.feedback-success {
  background: rgba(76, 175, 80, 0.15);
  border:     1px solid rgba(76, 175, 80, 0.4);
  color:      #81C784;
}
.feedback-error {
  background: rgba(229, 57, 53, 0.15);
  border:     1px solid rgba(229, 57, 53, 0.4);
  color:      #EF9A9A;
}

/* Bouton Nouvelle analyse */
.btn-new-analysis {
  margin-top:    16px;
  padding:       12px 32px;
  background:    transparent;
  border:        2px solid rgba(255,255,255,0.2);
  border-radius: 10px;
  color:         rgba(255,255,255,0.55);
  font-size:     14px;
  font-family:   var(--font-main);
  font-weight:   500;
  cursor:        pointer;
  transition:    border-color 0.2s ease, color 0.2s ease;
}
.btn-new-analysis:hover {
  border-color: rgba(255,255,255,0.5);
  color:        var(--white);
}

/* Countdown — caché par défaut, affiché par JS après 1 min */
#countdown-bar   { display: none; }
.countdown-text  { display: none; color: rgba(255,255,255,0.4); font-size: 12px; margin-top: 6px; }

/* Countdown bar at bottom of result screen */
.countdown-bar {
  width:         100%;
  max-width:     400px;
  height:        4px;
  background:    rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  margin:        20px auto 0;
  overflow:      hidden;
}

.countdown-fill {
  height:        100%;
  background:    var(--accent);
  width:         100%;
  border-radius: 2px;
  /* JS sets the transition duration dynamically */
}


/* --------------------------------------------------------------------------
   9. Error Messages
   -------------------------------------------------------------------------- */
.field-error {
  display:    block;
  color:      var(--error);
  font-size:  13px;
  margin-top: 6px;
  min-height: 18px;
  transition: opacity 0.2s ease;
}

.field-error:empty {
  display: none;
}

.input-error {
  border-color: var(--error) !important;
}

/* --------------------------------------------------------------------------
   10. Pause Screen (#pause-screen)
   -------------------------------------------------------------------------- */
#pause-screen {
  position:        fixed;
  inset:           0;
  background:      var(--primary-dark);
  z-index:         300;
  display:         none;
  flex-direction:  column;
  align-items:     center;
  justify-content: center;
  text-align:      center;
  padding:         40px;
}

#pause-screen.active {
  display: flex;
}

.pause-logo {
  max-height:    100px;
  width:         auto;
  margin-bottom: 32px;
  opacity:       0.8;
}

.pause-message {
  color:       var(--white);
  font-size:   28px;
  font-weight: 600;
  line-height: 1.4;
  max-width:   480px;
}

.pause-submessage {
  color:      rgba(255, 255, 255, 0.55);
  font-size:  16px;
  margin-top: 16px;
}

/* --------------------------------------------------------------------------
   11. Utility / Shared
   -------------------------------------------------------------------------- */
.visually-hidden {
  position:  absolute;
  width:     1px;
  height:    1px;
  padding:   0;
  margin:    -1px;
  overflow:  hidden;
  clip:      rect(0, 0, 0, 0);
  white-space: nowrap;
  border:    0;
}

/* Smooth fade helper */
.fade-out {
  opacity:    0 !important;
  transition: opacity 0.3s ease !important;
}

/* --------------------------------------------------------------------------
   12. Responsive — small phone screens
   -------------------------------------------------------------------------- */
@media (max-width: 640px) {
  #kiosk-form {
    padding:    16px;
    overflow-y: auto; /* Scroll autorisé uniquement sur mobile */
    height:     auto;
    min-height: 100vh;
  }

  .form-header {
    flex-direction: column;
    text-align:     center;
    gap:            12px;
    margin-bottom:  16px;
  }

  .form-row {
    grid-template-columns: 1fr; /* Champs en colonne sur mobile */
  }

  .form-header h1 {
    font-size: 18px;
  }

  .form-header .form-subtitle {
    font-size: 13px;
  }

  .logo-owl {
    max-height: 48px;
  }

  .cta-pulse {
    font-size:  18px;
    padding:    16px 28px;
    white-space: normal;
    text-align: center;
  }

  .slideshow-cta {
    bottom: 24px;
    width:  calc(100% - 40px);
  }

  .btn-analyze {
    font-size: 15px;
  }

  .result-title {
    font-size: 22px;
  }

  .result-stars {
    font-size: 24px;
  }

  .result-level {
    font-size: 18px;
  }

  .loading-message {
    font-size: 16px;
  }

  .progress-bar-container {
    width: 220px;
  }

  .pause-message {
    font-size: 22px;
  }

  .result-print-msg {
    font-size: 14px;
    padding:   14px 16px;
  }
}
