:root{
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  color:#171717;
  background:#f1f1ee;

  --dark:#171717;
  --text:#292929;
  --muted:#686868;
  --line:#ddd;
  --soft:#f7f7f4;
  --soft-2:#fafafa;
  --success:#147a37;
  --danger:#a31717;
  --radius:18px;
  --radius-sm:12px;
  --shadow:0 6px 24px #0000000b;
}

*{box-sizing:border-box}

html{
  -webkit-text-size-adjust:100%;
}

body{
  margin:0;
  min-height:100vh;
  background:#f1f1ee;
}

button,
input,
select,
textarea{
  font:inherit;
}

button{
  cursor:pointer;
}

header{
  background:var(--dark);
  color:#fff;
  padding:20px max(20px,env(safe-area-inset-left));
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:20px;
}

header h1{
  margin:4px 0;
  font-size:28px;
  line-height:1.15;
}

header p{
  margin:0;
  color:#bbb;
}

header a{
  color:#fff;
  text-decoration:none;
}

main{
  width:min(1050px,100%);
  margin:auto;
  padding:18px;
}

.card{
  background:#fff;
  border-radius:var(--radius);
  padding:22px;
  margin-bottom:18px;
  box-shadow:var(--shadow);
}

.grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:14px;
}

.wide{
  grid-column:1/-1;
}

.row{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:15px;
}

.search{
  display:flex;
  gap:8px;
}

label{
  display:flex;
  flex-direction:column;
  gap:6px;
  font-weight:650;
}

input,
select,
textarea,
button{
  padding:13px;
  border-radius:11px;
  border:1px solid #ccc;
}

input,
select,
textarea{
  width:100%;
  background:#fff;
  color:var(--dark);
}

input:focus,
select:focus,
textarea:focus{
  outline:3px solid #1717171a;
  border-color:var(--dark);
}

textarea{
  min-height:90px;
  resize:vertical;
}

button,
.button{
  background:var(--dark);
  color:#fff;
  border:0;
  text-decoration:none;
  padding:13px 18px;
  border-radius:11px;
  display:inline-block;
  font-weight:750;
}

button:hover,
.button:hover{
  opacity:.92;
}

button:disabled{
  opacity:.45;
  cursor:not-allowed;
}

.secondary{
  background:#ddd;
  color:#111;
}

.list a{
  display:flex;
  justify-content:space-between;
  gap:18px;
  padding:15px 0;
  border-bottom:1px solid #eee;
  text-decoration:none;
  color:#111;
}

.list span,
small{
  color:var(--muted);
}

.summaryGrid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
}

.summaryGrid div{
  background:var(--soft);
  padding:13px;
  border-radius:11px;
  overflow-wrap:anywhere;
}

.summaryGrid small{
  display:block;
  margin-bottom:5px;
}

.intro,
.imageChoice{
  background:var(--soft);
  padding:18px;
  border-radius:14px;
  margin:12px 0 18px;
}

.eyebrow{
  font-size:12px;
  font-weight:800;
  letter-spacing:.12em;
}

.check,
.choice{
  display:flex;
  flex-direction:row;
  align-items:flex-start;
  gap:10px;
  margin:12px 0;
  font-weight:500;
}

.choice{
  background:#fff;
  padding:14px;
  border-radius:11px;
  border:1px solid var(--line);
}

.choice:has(input:checked){
  border-color:var(--dark);
  box-shadow:0 0 0 2px #17171712;
}

.check input,
.choice input{
  width:auto;
  margin-top:3px;
  flex:0 0 auto;
}

.signature{
  width:100%;
  height:190px;
  border:2px dashed #999;
  border-radius:12px;
  background:#fff;
  touch-action:none;
}

.actions{
  display:flex;
  gap:10px;
  margin-top:10px;
}

.ok{
  color:var(--success);
  font-weight:750;
}

.error{
  color:var(--danger);
  font-weight:700;
}

.mediaForms{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:14px;
}

.mediaForms form{
  background:var(--soft);
  padding:14px;
  border-radius:12px;
}

.gallery{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:10px;
  margin-top:15px;
}

.gallery figure{
  margin:0;
}

.gallery img,
.gallery video{
  width:100%;
  aspect-ratio:1;
  object-fit:cover;
  border-radius:10px;
  background:#111;
}

.gallery figcaption{
  text-align:center;
  text-transform:uppercase;
  font-size:11px;
  margin-top:4px;
}

.login main{
  max-width:480px;
  padding-top:10vh;
}

.loginCard{
  text-align:center;
}

.loginCard form{
  text-align:left;
}

.loginCard button{
  width:100%;
  margin-top:12px;
}

.brand{
  font-weight:900;
  letter-spacing:.14em;
}

/* Asistente guiado del consentimiento */

.wizardForm{
  position:relative;
}

.wizardHeader{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:20px;
  margin-bottom:14px;
}

.wizardHeader h3{
  margin:5px 0 4px;
  font-size:27px;
}

.wizardHeader p{
  margin:0;
}

.wizardCounter{
  background:var(--soft);
  border:1px solid var(--line);
  padding:10px 14px;
  border-radius:999px;
  white-space:nowrap;
  font-size:14px;
}

.wizardProgress{
  height:8px;
  background:#e8e8e4;
  border-radius:999px;
  overflow:hidden;
  margin:0 0 24px;
}

.wizardProgressBar{
  height:100%;
  width:0;
  background:var(--dark);
  border-radius:inherit;
  transition:width .25s ease;
}

.wizardStep{
  display:none;
  min-height:340px;
  animation:wizardFade .18s ease;
}

.wizardStep.is-active{
  display:block;
}

.legalWizardStep{
  border:1px solid var(--line);
  border-radius:15px;
  overflow:hidden;
  background:var(--soft-2);
}

.legalStepHeading{
  padding:20px 22px 15px;
  background:#fff;
  border-bottom:1px solid var(--line);
}

.legalStepHeading h3{
  margin:5px 0 4px;
  font-size:22px;
  line-height:1.25;
}

.legalStepHeading p{
  margin:6px 0 0;
  color:#555;
}

.legalText{
  white-space:pre-wrap;
  line-height:1.72;
  font-size:17px;
  color:var(--text);
  padding:22px 24px;
  background:var(--soft-2);
  max-height:58vh;
  overflow:auto;
  overflow-wrap:anywhere;
}

.patientConsentIntro{
  padding:22px 26px;
  background:var(--soft);
  border:1px solid var(--line);
  border-radius:16px;
  margin:18px;
}

.patientConsentIntro p{
  margin:0;
  font-size:18px;
  line-height:1.75;
  color:#252525;
}

.patientConsentIntro strong{
  font-weight:800;
}

.wizardNavigation{
  display:grid;
  grid-template-columns:auto 1fr auto;
  align-items:center;
  gap:12px;
  margin-top:22px;
  padding-top:18px;
  border-top:1px solid var(--line);
  position:sticky;
  bottom:0;
  background:#fff;
  z-index:5;
}

.wizardStepTitle{
  text-align:center;
  font-weight:700;
  color:#555;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.wizardPrev[hidden],
.wizardNext[hidden]{
  display:none;
}

.signatureActions{
  justify-content:flex-end;
}

.submitConsent{
  min-width:220px;
}

@keyframes wizardFade{
  from{opacity:.3;transform:translateY(5px)}
  to{opacity:1;transform:none}
}

@media(max-width:720px){
  header{
    align-items:flex-start;
  }

  header h1{
    font-size:23px;
  }

  main{
    padding:12px;
  }

  .card{
    padding:17px;
    border-radius:15px;
  }

  .grid,
  .mediaForms,
  .summaryGrid{
    grid-template-columns:1fr;
  }

  .row{
    align-items:stretch;
    flex-direction:column;
  }

  .search{
    width:100%;
  }

  .search input{
    min-width:0;
    flex:1;
  }

  .list a{
    flex-direction:column;
    gap:4px;
  }

  .gallery{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }

  .wizardHeader{
    flex-direction:column;
  }

  .wizardCounter{
    align-self:flex-start;
  }

  .wizardStep{
    min-height:300px;
  }

  .legalText{
    font-size:16px;
    padding:18px;
    max-height:none;
  }

  .patientConsentIntro{
    margin:14px;
    padding:18px;
  }

  .patientConsentIntro p{
    font-size:16px;
    line-height:1.65;
  }

  .wizardNavigation{
    grid-template-columns:1fr 1fr;
  }

  .wizardStepTitle{
    grid-column:1/-1;
    grid-row:1;
    text-align:left;
  }

  .wizardPrev{
    grid-column:1;
    grid-row:2;
  }

  .wizardNext{
    grid-column:2;
    grid-row:2;
  }

  .signatureActions{
    flex-direction:column;
  }

  .signatureActions button{
    width:100%;
  }
}
.dashboardActions{margin-bottom:18px}.dashboardAction{display:flex;justify-content:space-between;align-items:center;padding:20px 22px;border-radius:18px;background:linear-gradient(135deg,#17191d,#2b3038);color:#fff;text-decoration:none;box-shadow:0 14px 30px rgba(0,0,0,.16)}.dashboardAction strong{font-size:1.08rem}.dashboardAction span{opacity:.72}.completionMain{min-height:70vh;display:grid;place-items:center}.completionCard{max-width:680px;text-align:center;padding:52px 32px}.successIcon{width:74px;height:74px;margin:0 auto 20px;border-radius:50%;display:grid;place-items:center;background:#e8f7ef;color:#18794e;font-size:38px;font-weight:800}.completionActions{display:grid;gap:12px;margin:28px auto 12px;max-width:420px}.completionActions .button{display:block;text-align:center}.documentList{display:grid;gap:10px;margin-top:18px}.documentList>a{display:flex;justify-content:space-between;gap:18px;padding:16px;border:1px solid #e5e7eb;border-radius:14px;text-decoration:none;color:inherit;background:#fff}.documentList a div{display:grid;gap:4px}.documentList span{color:#667085;font-size:.9rem}.documentMeta{text-align:right}.archiveSearch{max-width:none}.pdfViewer{height:78vh;background:#2b2b2b;border-radius:18px;overflow:hidden}.pdfViewer iframe{width:100%;height:100%;border:0}.internalDocumentHeader code{word-break:break-all;font-size:.78rem}@media(max-width:700px){.dashboardAction,.documentList>a{align-items:flex-start;flex-direction:column}.documentMeta{text-align:left}.pdfViewer{height:70vh}}


/* Capil·Art Pro v2 · iPad/PWA */
.appHero{display:flex;justify-content:space-between;align-items:center;gap:20px;padding:28px;margin-bottom:18px;border-radius:22px;background:linear-gradient(135deg,#171717,#34373d);color:#fff;box-shadow:0 18px 42px #0002}.appHero h2{font-size:30px;margin:0 0 6px}.appHero p{margin:0;color:#d4d4d4}.heroBadge{padding:10px 14px;border:1px solid #ffffff30;border-radius:999px;background:#ffffff12;font-weight:750;white-space:nowrap}.quickGrid{display:grid;grid-template-columns:repeat(3,1fr);gap:14px;margin-bottom:18px}.quickCard{display:grid;gap:6px;padding:22px;border-radius:18px;background:#fff;color:#171717;text-decoration:none;box-shadow:var(--shadow);border:1px solid #e7e7e3}.quickCard>span{font-size:30px}.quickCard strong{font-size:18px}.quickCard small{font-size:13px}.sectionTitle{display:flex;justify-content:space-between;align-items:center;margin-bottom:16px}.sectionTitle h2,.row h2{margin:4px 0}.patientList a{align-items:center}.patientAvatar{width:44px;height:44px;border-radius:14px;background:#171717;color:#fff;display:grid;place-items:center;font-weight:850;font-size:18px;flex:0 0 auto}.patientMain{display:grid;gap:4px;flex:1}.chevron{font-size:30px;color:#999}.gallery figure{position:relative;background:#fafafa;border-radius:12px;padding:0 0 10px;overflow:hidden;border:1px solid #e9e9e5}.gallery figcaption{padding:6px 8px 0;display:grid;gap:7px}.deleteButton{width:100%;padding:9px 10px;border-radius:9px;background:#fff0f0;color:#a31717;border:1px solid #efcaca;font-size:12px;font-weight:800}.deleteButton:hover{background:#a31717;color:#fff}.installHint{position:fixed;left:50%;bottom:18px;transform:translateX(-50%);background:#171717;color:#fff;padding:12px 16px;border-radius:999px;box-shadow:0 10px 30px #0003;z-index:99;font-size:14px}.standalone body{padding-top:env(safe-area-inset-top)}
@media(max-width:720px){.quickGrid{grid-template-columns:1fr}.appHero{align-items:flex-start;flex-direction:column}.heroBadge{align-self:flex-start}}
@media(min-width:900px){main{width:min(1180px,100%)}.card{padding:28px}.gallery{grid-template-columns:repeat(4,1fr)}}
