/* ═══════════════════════════════════════════════════════════════
   pwa-shell.css — Coque PWA VietGuide
   Chargé par wp-language-course-viet-premium.php sur la page /vietguide/
   ═══════════════════════════════════════════════════════════════ */

/* ── Filigrane TG (SVG encodé) ── */
:root {
  --vg-filigrane: url("data:image/svg+xml,%3Csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20width=%2752%27%20height=%2752%27%3E%3Cpolygon%20points=%2726,4%2048,26%2026,48%204,26%27%20fill=%27none%27%20stroke=%27rgba(255,200,50,0.13)%27%20stroke-width=%270.8%27/%3E%3Ctext%20x=%2726%27%20y=%2730%27%20font-family=%27Arial,sans-serif%27%20font-size=%279%27%20font-weight=%27700%27%20fill=%27rgba(255,200,50,0.18)%27%20text-anchor=%27middle%27%3ETG%3C/text%3E%3C/svg%3E") repeat;
  --vg-gradient: linear-gradient(135deg, #4A0808 0%, #8B0E0E 40%, #DA251D 100%);
  --vg-nav-height: 54px;
}

/* ── Reset cross-browser ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  /* Évite le tap-highlight bleu sur mobile (Chrome, Firefox, Samsung) */
  -webkit-tap-highlight-color: transparent;
}

html {
  /* Empêche le zoom auto sur les inputs sur iOS Safari */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* Scroll fluide sur tout le document */
  scroll-behavior: smooth;
  height: 100%;
}

body {
  min-height: 100%;
  min-height: 100dvh;       /* dvh = dynamic viewport height (iOS Safari 15.4+, Firefox 101+) */
  width: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'DM Sans', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: var(--vg-filigrane) repeat, var(--vg-gradient);
  background-attachment: fixed; /* Filigrane fixe pendant le scroll — cross-browser */
  color: #f0f4ff;
  /* Scroll naturel sur body : un doigt sur tous les navigateurs mobiles */
  overflow-x: hidden;
  overflow-y: auto;
  /* iOS Safari : momentum scroll */
  -webkit-overflow-scrolling: touch;
}

/* overscroll-behavior uniquement sur l'écran app — pas sur l'écran login */
.pwa-app {
  overscroll-behavior: none;
  -ms-overflow-style: none; /* IE/Edge */
}

/* ── Fond unifié sur le conteneur du plugin ── */
.wplcv-wrap {
  background: var(--vg-filigrane) repeat, var(--vg-gradient) !important;
}

/* ── Thème sombre harmonisé dans la PWA ── */
.wplcv-app {
  --bg:        #0d1b2e !important;
  --surface:   #1a0606 !important;
  --surface-2: #2B0A0A !important;
  --surface-3: #2B0A0A !important;
  --text:      #e8f0fe !important;
  --text-2:    #FF6B6B !important;
  --muted:     #8B0E0E !important;
  --border:    #2B0A0A !important;
  --card:      #1a0606 !important;
  --accent:    #DA251D !important;
  --primary:   #FFCD00 !important;
  --primary-dk:#DA251D !important;
  --primary-bg:#2B0A0A !important;
  --green:     #8B0E0E !important;
  --green-bg:  #1a0606 !important;
  --red:       #DA251D !important;
  --red-bg:    #2B0A0A !important;
  --shadow:    0 4px 16px rgba(0,0,0,.35) !important;
  --shadow-lg: 0 8px 32px rgba(0,0,0,.5) !important;
  color: #e8f0fe !important;
  background: transparent !important;
}

/* ── Ajustements plugin dans la PWA ── */
.wplcv-wrap      { border-radius: 0 !important; box-shadow: none !important; max-width: 100% !important; }
.wplcv-theme-btn  { display: none !important; }
.wplcv-title-block { display: none !important; }

/* ── Écran login ── */
.login-screen {
  min-height: 100dvh;
  min-height: 100vh; /* Fallback pour anciens navigateurs */
  display: -webkit-box;   /* iOS Safari < 9 */
  display: -ms-flexbox;   /* IE 10 */
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -ms-flex-direction: column;
  flex-direction: column;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-pack: start;
  -ms-flex-pack: start;
  justify-content: flex-start;
  padding: 60px 20px 40px;
  /* Pas de background ici : hérité du body (background-attachment:fixed) */
  gap: 24px;
  /* Scroll géré par body — compatible tous navigateurs mobiles */
}
.login-logo       { text-align: center; }
.login-flags      { font-size: 2rem; margin-bottom: 10px; line-height: 1; }
.login-brand      { font-size: 2rem; font-weight: 900; color: #fff; letter-spacing: -.03em; }
.login-sub        { font-size: 11px; color: rgba(255,255,255,.4); text-transform: uppercase; letter-spacing: .12em; margin-top: 4px; }
.login-box {
  width: 100%; max-width: 360px;
  background: rgba(255,255,255,.08);
  border: 1.5px solid rgba(255,255,255,.15);
  border-radius: 24px;
  padding: 28px 24px;
}
.login-box label {
  display: block; font-size: 11px; font-weight: 700;
  color: rgba(255,255,255,.55);
  margin-bottom: 7px; text-transform: uppercase; letter-spacing: .07em;
}
.login-box input[type=text],
.login-box input[type=password] {
  display: block; width: 100%;
  background: rgba(255,255,255,.1);
  border: 1.5px solid rgba(255,255,255,.2);
  border-radius: 12px;
  padding: 14px 16px;
  color: #fff; font-size: 16px; /* 16px minimum évite le zoom auto iOS */
  font-family: inherit;
  outline: none;
  margin-bottom: 16px;
  -webkit-appearance: none; /* Supprime le style natif iOS */
  appearance: none;
}
.login-box input[type=text]:focus,
.login-box input[type=password]:focus {
  border-color: #FFCD00;
  background: rgba(255,255,255,.15);
}
.login-box input::-webkit-input-placeholder { color: rgba(255,255,255,.3); } /* Chrome, Safari */
.login-box input::-moz-placeholder          { color: rgba(255,255,255,.3); opacity: 1; } /* Firefox */
.login-box input::placeholder               { color: rgba(255,255,255,.3); }
.login-btn {
  display: block; width: 100%;
  background: #FFCD00; color: #fff;
  border: none; border-bottom: 3px solid #DA251D;
  border-radius: 14px; padding: 15px;
  font-size: 16px; font-weight: 800;
  cursor: pointer; font-family: inherit;
  -webkit-appearance: none;
  appearance: none;
  margin-top: 4px;
  /* Transition tactile cross-browser */
  -webkit-transition: transform .1s, border-bottom-width .1s;
  transition: transform .1s, border-bottom-width .1s;
}
.login-btn:active { -webkit-transform: translateY(2px); transform: translateY(2px); border-bottom-width: 1px; }
.login-lost {
  display: block; text-align: center;
  margin-top: 16px; font-size: 13px;
  color: rgba(255,255,255,.35); text-decoration: none;
}

/* ── Coque app premium ── */
.pwa-app {
  min-height: 100dvh;
  min-height: 100vh; /* Fallback */
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: calc(var(--vg-nav-height) + env(safe-area-inset-bottom, 0px));
  background: transparent;
}
.pwa-statusbar {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-pack: justify;
  -ms-flex-pack: justify;
  justify-content: space-between;
  padding: 10px 16px 8px;
  background: #1a0606;
  border-bottom: 1px solid rgba(255,255,255,.1);
  gap: 8px;
  position: relative;
  z-index: 50;
}
.sb-left   { display: flex; align-items: center; gap: 8px; position: relative; }
.sb-logo   { font-size: 1.1rem; }
.sb-name   { font-size: .9rem; font-weight: 800; color: #fff; }
.sb-badge  { font-size: .62rem; font-weight: 800; padding: 3px 9px; border-radius: 999px; text-transform: uppercase; letter-spacing: .06em; }
.sb-badge.weekly   { background: rgba(255,165,0,.2);  color: #ffa500; }
.sb-badge.monthly  { background: rgba(139,14,14,.2); color: #FFCD00; }
.sb-badge.annual   { background: rgba(88,204,2,.2);  color: #FFCD00; }
.sb-badge.lifetime { background: rgba(255,200,0,.2); color: #FFCD00; }
.sb-right  { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.sb-expiry { font-size: .62rem; color: rgba(255,255,255,.4); }
@media(max-width:420px){ .sb-expiry{ display: none; } }
.sb-btn { background: rgba(255,255,255,.08); border: none; color: rgba(255,255,255,.5); border-radius: 8px; padding: 5px 9px; cursor: pointer; font-size: .85rem; }

#vg-update-banner {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: #DA251D; color: #fff;
  padding: 12px 16px;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
  gap: 12px;
  z-index: 99998; font-size: .85rem;
  box-shadow: 0 -4px 20px rgba(0,0,0,.3);
}
#vg-update-banner button {
  background: #FFCD00; border: none; color: #fff;
  border-radius: 8px; padding: 6px 16px;
  cursor: pointer; font-weight: 700; font-size: .8rem;
}

.pwa-offline { display: none; background: #7c3a00; color: #ffd7aa; text-align: center; padding: 7px 16px; font-size: .78rem; font-weight: 700; }
.pwa-offline.on { display: block; }
.pwa-content { width: 100%; }
