:root{
  --color-primary:#111111;
  --color-primary-dark:#000000;
  --color-secondary:#5E5E63;
  --color-success:#34C759;
  --color-warning:#FF9500;
  --color-danger:#FF3B30;
  --color-background:#FFFFFF;
  --color-background-secondary:#F6F6F4;
  --color-surface:#FFFFFF;
  --color-text-primary:#0A0A0A;
  --color-text-secondary:#6F6F73;
  --color-text-tertiary:#A7A7AD;
  --color-border:#E7E7E4;
  --color-shadow:rgba(0,0,0,0.1);
  --color-overlay:rgba(0,0,0,0.4);
  --color-premium:#FFD700;
  --color-premium-dark:#FFA500;

  --font-family:'Manrope',-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;

  --font-size-xs:11px;
  --font-size-sm:13px;
  --font-size-base:15px;
  --font-size-lg:17px;
  --font-size-xl:20px;
  --font-size-2xl:28px;
  --font-size-3xl:34px;

  --spacing-xs:4px;
  --spacing-sm:8px;
  --spacing-md:16px;
  --spacing-lg:24px;
  --spacing-xl:32px;
  --spacing-2xl:48px;

  --radius-sm:8px;
  --radius-md:12px;
  --radius-lg:16px;
  --radius-xl:24px;
  --radius-full:50%;

  --shadow-sm:0 1px 3px rgba(0,0,0,0.06);
  --shadow-md:0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg:0 8px 24px rgba(0,0,0,0.12);

  --header-height:56px;
  --bottom-nav-height:64px;

  --safe-area-top:env(safe-area-inset-top);
  --safe-area-bottom:env(safe-area-inset-bottom);
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:var(--font-family);
  color:var(--color-text-primary);
  background:var(--color-background-secondary);
}

.hidden{display:none !important}
.text-center{text-align:center}
.text-muted{color:var(--color-text-secondary)}

.splash{
  position:fixed;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  background:linear-gradient(180deg,#FFFFFF 0%, #F3F3F1 100%);
  color:#111111;
  z-index:99999;
}

#app.app{
  min-height:100vh;
  display:flex;
  flex-direction:column;
  background:var(--color-background-secondary);
}

/* ===== HEADER ===== */
#app.app>header.header{
  height:var(--header-height);
  padding:0 var(--spacing-sm);
  padding-top:var(--safe-area-top);
  display:flex;
  align-items:center;
  justify-content:flex-start;
  gap:10px;
  background:var(--color-primary);
  color:#111111;
}

.header-btn{
  width:40px;
  height:40px;
  border:0;
  border-radius:12px;
  background:rgba(255,255,255,0.14);
  color:#111111;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
}

#header-title{
  margin:0;
  padding:0;
  font-size:17px;
  font-weight:800;
  letter-spacing:-0.2px;
  line-height:1;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

#app.app>header.header>div[style*="display:flex"]{
  margin-left:auto;
}

/* Content */
#content{
  flex:1 1 auto;
  padding:16px;
  padding-bottom:calc(16px + var(--safe-area-bottom));
}

/* Bottom nav */
#bottom-nav{
  height:var(--bottom-nav-height);
  padding-bottom:var(--safe-area-bottom);
  background:#fff;
  border-top:1px solid var(--color-border);
  display:flex;
  align-items:center;
  justify-content:space-around;
  position:sticky;
  bottom:0;
}

.nav-item{
  background:transparent;
  border:0;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:4px;
  color:var(--color-text-secondary);
  font-size:12px;
  padding:8px 10px;
  cursor:pointer;
}
.nav-item.active{color:var(--color-primary);}

/* Toast */
.toast-root{
  position:fixed;
  left:0;
  right:0;
  bottom:calc(var(--bottom-nav-height) + var(--safe-area-bottom) + 12px);
  display:flex;
  justify-content:center;
  pointer-events:none;
  z-index:9999;
}
.toast{
  pointer-events:auto;
  min-width:260px;
  max-width:92vw;
  background:rgba(20,20,20,0.92);
  color:#111111;
  border-radius:14px;
  padding:12px 14px;
  box-shadow:0 14px 40px rgba(0,0,0,0.25);
}

/* Spinner */
.spinner{
  width:26px;
  height:26px;
  border-radius:50%;
  border:3px solid rgba(0,0,0,0.12);
  border-top-color:rgba(0,0,0,0.55);
  animation:spin 0.8s linear infinite;
}
@keyframes spin{to{transform:rotate(360deg)}}

/* Desktop layout */
@media (min-width:768px){
  #app.app{
    max-width:480px;
    margin:0 auto;
    box-shadow:var(--shadow-lg);
    background:var(--color-background-secondary);
  }
  #app.app>header.header{
    padding:0 var(--spacing-sm);
  }
}

/* =========================================================
   PROFESSIONAL PROFILE - Bottom Action Bar (FIX FINAL MOBILE)
   - Más “flotante” y separada de la bottom-nav
   ========================================================= */

.pp-action-bar{
  position:fixed;
  left:50%;
  transform:translateX(-50%);
  width:min(560px, calc(100vw - 24px));
  max-width:560px;
  bottom:calc(var(--bottom-nav-height) + var(--safe-area-bottom) + 18px);
  background:rgba(255,255,255,0.97);
  border:1px solid rgba(0,0,0,0.06);
  border-radius:22px;
  padding:10px;
  display:grid;
  grid-template-columns:50px minmax(0, 1.08fr) minmax(0, 0.96fr) minmax(0, 1.16fr);
  gap:8px;
  align-items:stretch;
  box-shadow:0 18px 50px rgba(0,0,0,0.15);
  backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px);
  z-index:200;
}

.pp-action-fav-btn{
  width:50px;
  min-width:50px;
  height:58px;
  padding:0 !important;
  border-width:2px !important;
  border-radius:16px !important;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}

.pp-action-btn{
  min-width:0;
  min-height:58px;
  padding:8px 6px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:5px;
  border-radius:16px !important;
  text-align:center;
}

.pp-action-btn--agenda,
.pp-action-btn--quote{
  background:#fff !important;
}

.pp-action-btn i{
  font-size:16px;
  line-height:1;
}

.pp-action-label{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  min-width:0;
  font-size:12px;
  font-weight:700;
  line-height:1.05;
  white-space:normal;
  word-break:normal;
  overflow-wrap:normal;
  text-align:center;
}

.pp-action-label--single{
  display:block;
  white-space:nowrap;
}

.pp-action-label-sub{
  display:block;
  font-size:inherit;
}

@media (max-width:430px){
  .pp-action-bar{
    width:calc(100vw - 18px);
    grid-template-columns:46px minmax(0, 1.04fr) minmax(0, 0.94fr) minmax(0, 1.12fr);
    gap:6px;
    padding:8px;
  }
  .pp-action-fav-btn{
    width:46px;
    min-width:46px;
    height:56px;
    border-radius:14px !important;
  }
  .pp-action-btn{
    min-height:56px;
    padding:7px 5px;
    gap:4px;
    border-radius:14px !important;
  }
  .pp-action-label{
    font-size:11px;
    line-height:1.02;
  }
}

@media (max-width:360px){
  .pp-action-bar{
    width:calc(100vw - 14px);
    grid-template-columns:42px minmax(0, 1fr) minmax(0, 0.92fr) minmax(0, 1.06fr);
    gap:5px;
    padding:7px;
  }
  .pp-action-fav-btn{
    width:42px;
    min-width:42px;
    height:52px;
  }
  .pp-action-btn{
    min-height:52px;
    padding:6px 4px;
    gap:3px;
  }
  .pp-action-btn i{
    font-size:15px;
  }
  .pp-action-label{
    font-size:10.5px;
  }
}


/* ===================================
   COMUVIA V2 - premium refresh
   =================================== */
:root{
  --color-primary:#111111;
  --color-primary-dark:#000000;
  --color-secondary:#6E6E73;
  --color-background:#FFFFFF;
  --color-background-secondary:#F5F5F7;
  --color-surface:#FFFFFF;
  --color-text-primary:#111111;
  --color-text-secondary:#6E6E73;
  --color-text-tertiary:#A1A1A6;
  --color-border:rgba(17,17,17,0.08);
  --shadow-sm:0 6px 18px rgba(17,17,17,0.04);
  --shadow-md:0 12px 30px rgba(17,17,17,0.08);
  --shadow-lg:0 24px 60px rgba(17,17,17,0.12);
}

body{
  background:
    radial-gradient(480px 320px at 12% 0%, rgba(120,119,255,0.10), transparent 60%),
    radial-gradient(420px 260px at 88% 8%, rgba(0,199,190,0.10), transparent 60%),
    radial-gradient(320px 220px at 78% 22%, rgba(255,45,146,0.08), transparent 55%),
    linear-gradient(180deg, #FCFCFD 0%, #F5F5F7 100%);
  color:var(--color-text-primary);
}

body::before,
body::after{
  content:'';
  position:fixed;
  inset:auto;
  pointer-events:none;
  z-index:0;
  filter:blur(60px);
  opacity:.45;
}
body::before{
  width:180px;height:180px;left:-40px;top:120px;
  background:radial-gradient(circle, rgba(120,119,255,.38) 0%, rgba(120,119,255,0) 72%);
}
body::after{
  width:220px;height:220px;right:-50px;top:240px;
  background:radial-gradient(circle, rgba(0,199,190,.28) 0%, rgba(255,45,146,.16) 35%, rgba(255,45,146,0) 72%);
}

#app.app{
  position:relative;
  z-index:1;
  background:transparent;
}

#app.app>header.header{
  position:sticky;
  top:0;
  z-index:50;
  height:calc(var(--header-height) + var(--safe-area-top));
  padding:var(--safe-area-top) 12px 0;
  background:rgba(255,255,255,0.72);
  color:var(--color-text-primary);
  border-bottom:1px solid rgba(17,17,17,0.05);
  backdrop-filter:blur(20px) saturate(160%);
  -webkit-backdrop-filter:blur(20px) saturate(160%);
}

.header-btn{
  background:rgba(17,17,17,0.04);
  color:var(--color-text-primary);
  border:1px solid rgba(17,17,17,0.04);
  box-shadow:0 4px 14px rgba(17,17,17,0.04);
}

#header-title{
  color:var(--color-text-primary);
  min-width:0;
}

.brand-home-title{
  display:flex;
  align-items:center;
}

.brand-wordmark{
  display:block;
  width:auto;
}

.brand-wordmark--header{
  height:24px;
  max-width:150px;
}

.brand-wordmark--splash{
  height:54px;
}

.brand-wordmark--auth{
  height:44px;
  margin:0 auto 12px;
}

.splash{
  background:
    radial-gradient(520px 340px at 18% 16%, rgba(120,119,255,0.14), transparent 62%),
    radial-gradient(430px 280px at 82% 12%, rgba(0,199,190,0.12), transparent 58%),
    radial-gradient(300px 220px at 56% 76%, rgba(255,45,146,0.10), transparent 54%),
    linear-gradient(180deg,#FFFFFF 0%, #F7F7FA 100%);
}

.splash-inner{
  position:relative;
  text-align:center;
  padding:28px 24px;
}

.splash-subtitle{
  max-width:320px;
  margin:14px auto 0;
  color:var(--color-text-secondary);
  font-size:15px;
  line-height:1.45;
}

#content{
  position:relative;
  z-index:1;
  padding:18px 16px calc(18px + var(--safe-area-bottom));
}

#bottom-nav{
  position:sticky;
  bottom:10px;
  margin:0 10px 10px;
  height:calc(var(--bottom-nav-height) - 8px);
  border:1px solid rgba(17,17,17,0.06);
  border-radius:22px;
  background:rgba(255,255,255,0.8);
  box-shadow:0 12px 30px rgba(17,17,17,0.08);
  backdrop-filter:blur(24px) saturate(180%);
  -webkit-backdrop-filter:blur(24px) saturate(180%);
}

.nav-item{
  color:var(--color-text-secondary);
  font-weight:600;
}
.nav-item.active{
  color:var(--color-text-primary);
}

.toast{
  color:#FFFFFF;
}

@media (min-width:768px){
  #app.app{
    max-width:460px;
    margin:18px auto;
    border-radius:32px;
    overflow:hidden;
    box-shadow:0 30px 80px rgba(17,17,17,0.14);
    border:1px solid rgba(255,255,255,0.8);
    background:rgba(255,255,255,0.66);
    backdrop-filter:blur(26px) saturate(165%);
    -webkit-backdrop-filter:blur(26px) saturate(165%);
  }
  #bottom-nav{
    margin:0 12px 12px;
  }
}


/* ===================================
   COMUVIA V3 - apple blue / refined system
   =================================== */
:root{
  --color-primary:#0071E3;
  --color-primary-dark:#0062C3;
  --color-secondary:#6E6E73;
  --color-background:#FFFFFF;
  --color-background-secondary:#F5F5F7;
  --color-surface:#FFFFFF;
  --color-text-primary:#111111;
  --color-text-secondary:#6E6E73;
  --color-text-tertiary:#A1A1A6;
  --color-border:rgba(17,17,17,0.08);
  --shadow-sm:0 8px 20px rgba(17,17,17,0.04);
  --shadow-md:0 16px 34px rgba(17,17,17,0.07);
  --shadow-lg:0 28px 64px rgba(17,17,17,0.12);
}

body{
  background:
    radial-gradient(560px 340px at 12% 2%, rgba(10,132,255,0.08), transparent 64%),
    radial-gradient(420px 280px at 88% 8%, rgba(255,255,255,0.55), transparent 60%),
    linear-gradient(180deg, #FCFCFD 0%, #F5F5F7 100%);
}

body::before{
  width:180px;height:180px;left:-40px;top:100px;
  background:radial-gradient(circle, rgba(10,132,255,.20) 0%, rgba(10,132,255,0) 70%);
  opacity:.34;
}
body::after{
  width:220px;height:220px;right:-60px;top:240px;
  background:radial-gradient(circle, rgba(10,132,255,.14) 0%, rgba(10,132,255,0) 72%);
  opacity:.26;
}

#app.app>header.header{
  background:rgba(255,255,255,0.82);
  border-bottom:1px solid rgba(17,17,17,0.04);
  box-shadow:0 4px 18px rgba(17,17,17,0.03);
}

.header-btn{
  background:rgba(17,17,17,0.035);
  border:1px solid rgba(17,17,17,0.04);
}

.brand-wordmark--header{
  height:30px;
  max-width:210px;
}

.brand-wordmark--splash{
  height:62px;
}

.brand-wordmark--auth{
  height:52px;
}

#content{
  padding:20px 16px calc(18px + var(--safe-area-bottom));
}

#bottom-nav{
  background:rgba(255,255,255,0.88);
  box-shadow:0 16px 36px rgba(17,17,17,0.09);
}

.nav-item.active{
  color:#0071E3;
}

@media (min-width:768px){
  #app.app{
    max-width:470px;
    box-shadow:0 34px 90px rgba(17,17,17,0.13);
  }
}


/* ===================================
   COMUVIA V4 - brand clarity and header strength
   =================================== */
.brand-lockup{
  display:inline-flex;
  align-items:center;
  justify-content:center;
}

.brand-name{
  display:inline-block;
  color:#111111;
  font-family:var(--font-family);
  letter-spacing:-0.06em;
  white-space:nowrap;
  text-rendering:geometricPrecision;
}

.brand-char-v{
  color:#0071E3;
  text-shadow:0 0 14px rgba(10,132,255,0.12);
}

.brand-name--header{
  font-size:28px;
  line-height:1;
  font-weight:700;
}

.brand-name--hero{
  font-size:clamp(42px, 10vw, 52px);
  line-height:0.98;
  font-weight:700;
}

.brand-name--auth,
.brand-name--splash{
  font-size:clamp(36px, 9vw, 46px);
  line-height:1;
  font-weight:700;
}

.brand-home-title{
  min-width:0;
}

#header-title{
  overflow:visible;
  text-overflow:clip;
}

#app.app>header.header{
  padding-left:14px;
  padding-right:14px;
}

#app.app>header.header .back-btn{
  margin-right:4px;
}

@media (max-width:480px){
  #app.app>header.header .back-btn[style*="hidden"],
  #app.app>header.header .back-btn[style="visibility: hidden;"]{
    width:18px;
    min-width:18px;
    padding:0;
    background:transparent;
    border:0;
    box-shadow:none;
  }
}


/* ===================================
   COMUVIA V5 - home layout hierarchy + bottom nav fix
   =================================== */
body{
  background:#F5F5F7;
}

body::before,
body::after{
  opacity:.18;
}

#app.app{
  background:#F5F5F7;
}

#app.app>header.header{
  background:#FFFFFF;
  border-bottom:1px solid rgba(17,17,17,0.04);
  box-shadow:none;
}

#content{
  background:#F5F5F7;
  padding:22px 16px calc(104px + var(--safe-area-bottom));
}

#bottom-nav{
  position:fixed;
  left:50%;
  transform:translateX(-50%);
  width:min(470px, calc(100vw - 20px));
  bottom:calc(env(safe-area-inset-bottom) + 10px);
  margin:0;
  z-index:120;
  background:rgba(255,255,255,0.96);
  border:1px solid rgba(17,17,17,0.06);
  box-shadow:0 18px 36px rgba(17,17,17,0.10);
}

.nav-item{
  font-weight:600;
}

@media (min-width:768px){
  #app.app{
    max-width:470px;
    margin:0 auto;
    min-height:100vh;
  }
  #bottom-nav{
    width:min(470px, calc(100vw - 24px));
  }
}
