/* SINERAL — ergonomie mobile de l’espace client (Safari iPhone) */
html{width:100%;max-width:100%;overflow-x:clip;-webkit-text-size-adjust:100%}
body{width:100%;max-width:100%;overflow-x:clip}
#portal,#portal main,#home,#sinip{min-width:0;max-width:100%}
#home .member-dashboard,#home .member-section,#home .dash-grid,#home .dash-card,
#home .wqc,#home .bgc,#home .simw{min-width:0}
#home img,#home video,#home svg{max-width:100%}
#home input,#home select,#home textarea,
#sinip input,#sinip select,#sinip textarea{font-size:16px!important}
#home input,#home select,#home textarea,
#sinip input,#sinip select,#sinip textarea{scroll-margin-bottom:120px}
/* Le décalage bas inclut déjà la safe area : ne pas la compter une seconde fois dans la hauteur. */
#tabs{padding-bottom:6px}
#tabs button{min-height:48px;touch-action:manipulation}
#home button,#sinip button,#portal a{touch-action:manipulation;-webkit-tap-highlight-color:transparent}
#home .weekcal,#home .wc-days,#home .films{overscroll-behavior-x:contain}
#home .wc-detail,#home .wqc,#home .bgc,#home .simw{overflow-wrap:anywhere}
@media(max-width:430px){
  #home{padding-left:max(16px,env(safe-area-inset-left,0px))!important;padding-right:max(16px,env(safe-area-inset-right,0px))!important}
  #home .dash-card{min-height:76px}
  #tabs{left:max(8px,env(safe-area-inset-left,0px))!important;right:max(8px,env(safe-area-inset-right,0px))!important;width:auto!important;max-width:none!important;transform:none!important}
  #tabs button{padding:8px 1px 7px;font-size:10px;gap:3px}
  #tabs button svg{width:20px;height:20px}
  #sinip{min-height:min(430px,calc(100dvh - 150px))}
}
@media(hover:none){
  #home .dash-card:hover{transform:none}
}
@media(prefers-reduced-motion:reduce){
  #home .dash-card{transition:none}
}

/* SINERAL SIGNATURE DESIGN — first visual layer, scoped to the authenticated app */
:root{
  --sn-violet:#7928D7;
  --sn-violet-bright:#9657F0;
  --sn-violet-soft:rgba(121,40,215,.10);
  --sn-edge:rgba(121,40,215,.20);
  --sn-shadow:0 14px 34px rgba(42,20,68,.075),0 2px 7px rgba(42,20,68,.035);
  --sn-highlight:inset 0 1px 0 rgba(255,255,255,.92);
}
:root[data-theme=dark]{
  --sn-violet:#B77BFF;
  --sn-violet-bright:#C69AFF;
  --sn-violet-soft:rgba(183,123,255,.13);
  --sn-edge:rgba(198,154,255,.24);
  --sn-shadow:0 18px 42px rgba(0,0,0,.28),0 2px 8px rgba(0,0,0,.18);
  --sn-highlight:inset 0 1px 0 rgba(255,255,255,.09);
}
body.tabs{
  background-image:radial-gradient(ellipse at 50% -18%,rgba(121,40,215,.075),transparent 58%);
}
:root[data-theme=dark] body.tabs{
  background-image:radial-gradient(ellipse at 50% -18%,rgba(150,87,240,.13),transparent 58%);
}
#home .dash-card,
#home .wqc,#home .bgc,#home .bgk,#home .simw,
#home .ovw,#home .sinic,#home .nlc,
#home .member-section .film{
  position:relative;
  border:1px solid var(--sn-edge)!important;
  box-shadow:var(--sn-highlight),var(--sn-shadow)!important;
  -webkit-backdrop-filter:blur(12px);
  backdrop-filter:blur(12px);
}
#home .dash-card{
  overflow:hidden;
  border-radius:20px!important;
  background:linear-gradient(145deg,rgba(255,255,255,.98),rgba(248,244,253,.94))!important;
  transition:transform .32s cubic-bezier(.2,.8,.2,1),border-color .32s,box-shadow .32s;
}
:root[data-theme=dark] #home .dash-card{
  background:linear-gradient(145deg,rgba(37,27,49,.98),rgba(26,18,36,.96))!important;
}
#home .dash-card::after{
  content:"";position:absolute;inset:0;pointer-events:none;border-radius:inherit;
  background:linear-gradient(115deg,rgba(255,255,255,.20),transparent 38%,rgba(150,87,240,.035));
}
#home .dash-card:active{transform:scale(.985)!important}
#home .dash-icon{
  border:1px solid var(--sn-edge);
  background:linear-gradient(145deg,rgba(255,255,255,.96),rgba(239,229,251,.9))!important;
  color:var(--sn-violet)!important;
  box-shadow:inset 0 1px 0 #fff,0 4px 12px rgba(80,42,120,.07);
}
:root[data-theme=dark] #home .dash-icon{
  background:linear-gradient(145deg,rgba(66,45,88,.95),rgba(38,26,52,.95))!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.14),0 5px 16px rgba(0,0,0,.2);
}
#home .dash-primary{
  background:linear-gradient(135deg,#8A42E8 0%,#7025C8 58%,#55209A 100%)!important;
  border-color:rgba(211,184,255,.45)!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.34),0 16px 34px rgba(104,42,176,.23)!important;
}
#home .dash-primary::before{
  content:"";position:absolute;width:190px;height:190px;right:-76px;top:-112px;border-radius:50%;
  background:radial-gradient(circle,rgba(255,255,255,.28),transparent 68%);pointer-events:none;
}
#home .member-section .wqc,#home .member-section .bgc,
#home .member-section .bgk,#home .member-section .simw,
#home .member-section .ovw,#home .member-section .sinic{
  border-radius:22px!important;
}
#home .sinic{
  background:linear-gradient(115deg,rgba(121,40,215,.075),rgba(255,255,255,.86))!important;
}
:root[data-theme=dark] #home .sinic{
  background:linear-gradient(115deg,rgba(183,123,255,.14),rgba(35,25,47,.96))!important;
}
#home .sinic img{box-shadow:0 5px 16px rgba(64,35,91,.14)}
#home .ph,#home .dash-intro #dash-title{letter-spacing:-.045em}
#home .dash-eyebrow{color:var(--sn-violet-bright)!important}
#tabs{
  border:1px solid var(--sn-edge)!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.62),0 12px 34px rgba(39,20,60,.14)!important;
}
:root[data-theme=dark] #tabs{
  box-shadow:inset 0 1px 0 rgba(255,255,255,.12),0 14px 38px rgba(0,0,0,.38)!important;
}
#tabs .tp{background:linear-gradient(145deg,rgba(150,87,240,.16),rgba(121,40,215,.075))!important}
#tabs button[aria-current=page]{color:var(--sn-violet-bright)!important}
#home .btn,#home .nlb,#home .simok,#home .bgb{
  border-radius:14px!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.28),0 7px 18px rgba(94,36,157,.18)!important;
  transition:transform .22s cubic-bezier(.2,.8,.2,1),filter .22s,box-shadow .22s;
}
#home .btn:active,#home .nlb:active,#home .simok:active,#home .bgb:active{transform:scale(.985)}
#home input:focus,#home select:focus,#home textarea:focus{
  border-color:var(--sn-violet-bright)!important;
  box-shadow:0 0 0 3px var(--sn-violet-soft)!important;
  outline:none!important;
}
@media(hover:hover) and (prefers-reduced-motion:no-preference){
  #home .dash-card:hover{transform:translateY(-3px);border-color:var(--sn-violet-bright)!important}
}
@media(prefers-reduced-motion:reduce){
  #home .dash-card,#home .btn,#home .nlb,#home .simok,#home .bgb{transition:none!important}
}


/* SINERAL — HOME EXPERIENCE / first-screen redesign
   Deliberately scoped to #home. No other portal view or business logic is changed. */
#home{
  --home-ink:#21152f;
  --home-muted:#776b86;
  --home-paper:#fff;
  --home-lilac:#f5efff;
  --home-line:rgba(105,54,166,.13);
  position:relative;
  isolation:isolate;
  gap:0!important;
  padding-top:clamp(20px,5vw,42px)!important;
  background:
    radial-gradient(ellipse at 88% 5%,rgba(154,105,235,.15),transparent 34%),
    radial-gradient(ellipse at 4% 32%,rgba(207,183,255,.17),transparent 38%);
}
:root[data-theme=dark] #home{
  --home-ink:#f5efff;
  --home-muted:#b7a9c8;
  --home-paper:#21182d;
  --home-lilac:#2c203b;
  --home-line:rgba(195,155,255,.17);
  background:
    radial-gradient(ellipse at 88% 5%,rgba(135,75,207,.22),transparent 36%),
    radial-gradient(ellipse at 4% 32%,rgba(82,49,119,.18),transparent 38%);
}
#home>.bk{order:-1;position:relative;z-index:2;margin:0 0 8px!important;opacity:.72}
#home>.welcome{order:0;position:relative;isolation:isolate;overflow:hidden;
  margin:0 0 18px!important;padding:clamp(27px,7vw,48px) 22px 26px!important;
  border:1px solid var(--home-line);border-radius:30px;
  background:linear-gradient(135deg,rgba(255,255,255,.96),rgba(246,239,255,.92));
  box-shadow:0 22px 55px rgba(65,36,94,.075),inset 0 1px 0 rgba(255,255,255,.95);
}
:root[data-theme=dark] #home>.welcome{
  background:linear-gradient(135deg,rgba(43,31,57,.98),rgba(29,21,40,.98));
  box-shadow:0 24px 60px rgba(0,0,0,.27),inset 0 1px 0 rgba(255,255,255,.08);
}
#home>.welcome::before{
  content:"";position:absolute;z-index:-1;pointer-events:none;
  width:270px;height:270px;right:-104px;top:-145px;border-radius:50%;
  background:radial-gradient(circle,rgba(151,94,230,.27),rgba(174,133,239,.10) 42%,transparent 70%);
}
#home>.welcome::after{
  content:"";position:absolute;z-index:-1;pointer-events:none;
  width:190px;height:190px;right:-65px;bottom:-135px;border-radius:50%;
  border:1px solid rgba(137,82,205,.14);
  box-shadow:0 0 0 22px rgba(137,82,205,.035),0 0 0 46px rgba(137,82,205,.025);
}
#home>.welcome #pt{
  position:relative;z-index:1;max-width:100%;overflow-wrap:anywhere;
  color:var(--home-ink)!important;
  font:600 clamp(39px,10.5vw,66px)/.98 Fraunces,Georgia,serif!important;
  letter-spacing:-.055em!important;white-space:normal!important;
  text-wrap:balance;
}
#home>.welcome .ground{
  width:76px;height:3px;margin:18px 0 0!important;border-radius:99px;
  background:linear-gradient(90deg,#8c4ce0,#c7a5ff)!important;opacity:1;
}
#home>.welcome .who{
  position:relative;z-index:1;margin-top:12px!important;
  color:var(--home-muted)!important;font-size:13px!important;font-weight:550;
}
#home>.member-dashboard{
  order:1;position:relative;margin:0 0 26px!important;padding:4px 0 0!important;
}
#home .dash-intro{margin:0 0 17px!important;padding:0 2px}
#home .dash-eyebrow{
  display:inline-flex!important;align-items:center;gap:8px;
  margin:0 0 10px!important;padding:7px 11px;border:1px solid var(--home-line);
  border-radius:99px;background:rgba(151,94,230,.075);
  color:#7841bd!important;font-size:9px!important;letter-spacing:.16em!important;
}
:root[data-theme=dark] #home .dash-eyebrow{color:#d0adff!important;background:rgba(180,131,245,.10)}
#home .dash-eyebrow::before{content:"";width:6px;height:6px;border-radius:50%;background:#9a5be8;box-shadow:0 0 0 3px rgba(154,91,232,.13)}
#home #dash-title{
  max-width:16ch;margin:0 0 8px!important;
  color:var(--home-ink)!important;font:600 clamp(27px,7.5vw,39px)/1.04 Fraunces,Georgia,serif!important;
  letter-spacing:-.045em!important;text-wrap:balance;
}
#home .dash-intro p{max-width:34ch;color:var(--home-muted)!important;font-size:13px!important;line-height:1.55!important}
#home .dash-grid{
  display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:11px!important;
}
#home .dash-card{
  min-width:0;min-height:132px!important;padding:17px!important;
  display:grid!important;grid-template-columns:1fr auto;grid-template-rows:auto 1fr auto;
  align-items:start!important;gap:8px!important;
  border:1px solid var(--home-line)!important;border-radius:22px!important;
  background:linear-gradient(150deg,#fff 0%,#faf7ff 100%)!important;
  color:#291b3a!important;text-align:left;
  box-shadow:0 12px 28px rgba(56,31,83,.065),inset 0 1px 0 #fff!important;
  -webkit-backdrop-filter:none!important;backdrop-filter:none!important;
  transition:transform .28s cubic-bezier(.2,.8,.2,1),box-shadow .28s,border-color .28s!important;
}
:root[data-theme=dark] #home .dash-card{
  background:linear-gradient(150deg,#2b2038 0%,#21182d 100%)!important;
  color:#f5edff!important;box-shadow:0 15px 32px rgba(0,0,0,.24),inset 0 1px 0 rgba(255,255,255,.07)!important;
}
#home .dash-card::after{display:none!important}
#home .dash-icon{
  grid-column:1;grid-row:1;width:39px!important;height:39px!important;flex:auto!important;
  border:1px solid rgba(130,76,190,.13)!important;border-radius:13px!important;
  background:linear-gradient(145deg,#fff,#eee4ff)!important;color:#783fc1!important;
  font-size:20px!important;box-shadow:0 5px 14px rgba(93,53,135,.08)!important;
}
:root[data-theme=dark] #home .dash-icon{
  background:linear-gradient(145deg,#49345f,#342544)!important;color:#d4b3ff!important;
  border-color:rgba(196,158,255,.18)!important;box-shadow:inset 0 1px 0 rgba(255,255,255,.09)!important;
}
#home .dash-card-title{
  grid-column:1/-1;grid-row:3;padding:0!important;
  color:inherit!important;font-size:14px!important;font-weight:680!important;line-height:1.25!important;
  letter-spacing:-.02em;
}
#home .dash-arrow{grid-column:2;grid-row:1;margin:7px 0 0!important;color:#9360ce!important;font-size:19px!important}
#home .dash-primary{
  grid-column:1/-1;min-height:154px!important;padding:20px!important;
  grid-template-columns:1fr auto;grid-template-rows:auto 1fr auto;
  border:1px solid rgba(226,207,255,.42)!important;
  background:
    radial-gradient(circle at 88% 4%,rgba(255,255,255,.25),transparent 34%),
    linear-gradient(125deg,#8748d5 0%,#7134bd 52%,#51248f 100%)!important;
  color:#fff!important;
  box-shadow:0 18px 38px rgba(103,51,166,.24),inset 0 1px 0 rgba(255,255,255,.28)!important;
}
#home .dash-primary::before{
  content:"";position:absolute;right:-30px;bottom:-92px;width:205px;height:205px;
  border:1px solid rgba(255,255,255,.22);border-radius:50%;
  box-shadow:0 0 0 18px rgba(255,255,255,.055),0 0 0 38px rgba(255,255,255,.035);
}
#home .dash-primary .dash-icon{
  background:rgba(255,255,255,.15)!important;color:#fff!important;
  border-color:rgba(255,255,255,.22)!important;box-shadow:inset 0 1px 0 rgba(255,255,255,.2)!important;
}
#home .dash-primary .dash-card-title{font-size:18px!important;max-width:18ch}
#home .dash-primary .dash-arrow{color:#fff!important}
#home .dash-sini{background:linear-gradient(145deg,#f6efff,#eee3ff)!important}
:root[data-theme=dark] #home .dash-sini{background:linear-gradient(145deg,#38274b,#2b1e3c)!important}
#home>.weekcal{order:3;margin-top:8px!important}
#home>.member-section{order:4}
@media(max-width:430px){
  #home{padding-left:16px!important;padding-right:16px!important}
  #home>.welcome{padding:26px 19px 23px!important;border-radius:26px!important}
  #home>.member-dashboard{margin-bottom:24px!important}
  #home .dash-grid{gap:9px!important}
  #home .dash-card{min-height:122px!important;padding:14px!important;border-radius:19px!important}
  #home .dash-primary{min-height:145px!important;padding:17px!important}
  #home .dash-card-title{font-size:13px!important}
  #home .dash-primary .dash-card-title{font-size:17px!important}
}
@media(prefers-reduced-motion:no-preference){
  #home .dash-card:active{transform:scale(.975)!important;box-shadow:0 5px 14px rgba(56,31,83,.12)!important}
  #home>.welcome{animation:sn-home-enter .65s cubic-bezier(.2,.8,.2,1) both}
  #home>.member-dashboard{animation:sn-home-enter .72s .08s cubic-bezier(.2,.8,.2,1) both}
  @keyframes sn-home-enter{from{opacity:.35;transform:translateY(12px)}to{opacity:1;transform:translateY(0)}}
}
@media(prefers-reduced-motion:reduce){
  #home>.welcome,#home>.member-dashboard{animation:none!important}
}
