/* ficha.css — Tu ficha de alumna. Claro, editorial: Baskervville en cursiva, píldoras, papel. */

.ficha-body {
  background:
    radial-gradient(1100px 520px at 85% -10%, var(--lilac) 0%, transparent 60%),
    radial-gradient(900px 480px at -10% 110%, #f6eefb 0%, transparent 55%),
    var(--paper);
  color: var(--ink-body);
}
.ficha-body .topbar { background: rgba(255, 255, 255, .82); backdrop-filter: blur(10px); }

.ficha {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(28px, 6vw, 72px) 16px 96px;
}

.ficha em { font-family: var(--font-italic); font-style: italic; font-weight: 400; color: var(--brand); }

.f-kicker {
  margin: 0 0 14px;
  font-size: 12px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--brand);
  font-weight: 500;
}

/* --- Portada --- */
.f-cover { text-align: center; animation: f-rise var(--slow) both; }
.f-cover h1 {
  margin: 0 0 18px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.4rem, 7vw, var(--t-4xl));
  line-height: 1.05;
  color: var(--ink);
}
.f-cover h1 em { font-size: 1.08em; }
.f-lead { max-width: 520px; margin: 0 auto 30px; font-size: var(--t-lg); line-height: 1.5; }
.f-lead strong { font-weight: 500; color: var(--ink); }
.f-letter {
  max-width: 460px; margin: -8px auto 30px;
  font-family: var(--font-italic); font-style: italic; font-size: var(--t-lg); line-height: 1.45; color: var(--ink-body);
}
.f-letter span { display: block; margin-top: 6px; color: var(--brand); }
.f-firma { display: block; width: 132px; height: auto; margin: 10px auto 0; }

.f-meta {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 10px;
  margin: 0 0 34px; padding: 0; list-style: none;
}
.f-meta li {
  display: inline-flex; align-items: baseline; gap: 8px;
  padding: 10px 18px;
  border: 1px solid var(--lilac-2);
  border-radius: var(--r-pill);
  background: var(--surface);
  font-size: var(--t-sm);
}
.f-meta span { font-family: var(--font-italic); font-style: italic; font-size: 1.35em; color: var(--brand); }

.f-cover .btn, .f-actions .btn {
  font-size: 12px; letter-spacing: .14em; text-transform: uppercase; padding: 14px 30px;
}

/* --- Progreso --- */
.f-progress {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  margin-bottom: 22px;
}
.f-progress span {
  position: relative;
  padding-top: 12px;
  font-size: var(--t-xs);
  color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.f-progress span::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  border-radius: var(--r-pill); background: var(--lilac-2);
}
.f-progress span.done::before, .f-progress span.on::before { background: var(--brand); }
.f-progress span.on { color: var(--ink); font-weight: 500; }
.f-progress b { font-weight: 500; margin-right: 6px; color: var(--brand); }

/* --- Tarjeta --- */
.f-card {
  padding: clamp(26px, 5vw, 48px);
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-float);
  animation: f-rise var(--normal) both;
}
.f-card h2 {
  margin: 0 0 30px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.9rem, 5vw, var(--t-3xl));
  line-height: 1.1;
  color: var(--ink);
}

.f-field { margin-bottom: 26px; }
.f-label { display: block; margin-bottom: 6px; font-weight: 500; color: var(--ink); font-size: var(--t-base); }
.f-field small { display: block; margin: -2px 0 10px; color: var(--muted); font-size: var(--t-xs); }

.f-field input:not([type=radio]):not([type=file]),
.f-field textarea,
.f-field select {
  width: 100%;
  padding: 13px 16px;
  border: 1.5px solid var(--lilac-2);
  border-radius: var(--r-sm);
  background: #fcfaff;
  font: inherit;
  font-size: var(--t-base);
  color: var(--ink);
  transition: border-color var(--fast), box-shadow var(--fast), background var(--fast);
}
.f-field textarea { resize: vertical; min-height: 96px; line-height: 1.5; }
.f-field input:focus, .f-field textarea:focus, .f-field select:focus {
  outline: none; border-color: var(--brand); background: var(--surface);
  box-shadow: 0 0 0 4px rgba(132, 84, 152, .12);
}

.f-select { position: relative; }
.f-select select { appearance: none; padding-right: 44px; cursor: pointer; }
.f-select::after {
  content: ""; position: absolute; right: 18px; top: 50%; width: 8px; height: 8px;
  border-right: 1.5px solid var(--brand); border-bottom: 1.5px solid var(--brand);
  transform: translateY(-70%) rotate(45deg); pointer-events: none;
}


/* Píldoras */
.f-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.f-pill { cursor: pointer; }
.f-pill input { position: absolute; opacity: 0; pointer-events: none; }
.f-pill span {
  display: inline-block;
  padding: 10px 18px;
  border: 1.5px solid var(--lilac-2);
  border-radius: var(--r-pill);
  background: var(--surface);
  font-size: var(--t-sm);
  transition: background var(--fast), border-color var(--fast), color var(--fast), transform var(--fast);
}
.f-pill:hover span { border-color: var(--brand); }
.f-pill input:checked + span { background: var(--brand); border-color: var(--brand); color: #fff; }
.f-pill input:focus-visible + span { box-shadow: 0 0 0 4px rgba(132, 84, 152, .2); }

/* Foto */
.f-photo {
  display: inline-flex; align-items: center; gap: 16px; cursor: pointer;
  color: var(--brand); font-weight: 500; font-size: var(--t-sm);
}
.f-photo img, .f-photo-ph {
  width: 88px; height: 88px; border-radius: 50%; object-fit: cover;
  border: 1.5px dashed var(--brand);
}
.f-photo.has img { border: 3px solid var(--lilac-2); }
.f-photo-ph {
  display: grid; place-items: center; background: var(--lilac);
  font-size: 30px; font-weight: 300;
}
.f-photo:hover .f-photo-ph { background: var(--lilac-2); }

/* Errores: rojo suave, nunca verde */
.f-field.bad input:not([type=radio]), .f-field.bad textarea, .f-field.bad select, .f-field.bad .f-pill span { border-color: #d2705c; }
.f-field.bad .f-photo-ph { border-color: #d2705c; background: #fbeae6; }
.f-msg { display: none; margin: 8px 0 0; color: #a2442f; font-size: var(--t-xs); }
.f-field.bad .f-msg:not(:empty) { display: block; }
.f-error {
  margin: 0 0 18px; padding: 12px 16px;
  border-radius: var(--r-sm); background: #fbeae6; color: #8a3a2a; font-size: var(--t-sm);
}

.f-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 10px; }
.f-actions .btn[disabled] { opacity: .6; cursor: progress; }

/* Final */
.f-done-photo {
  width: 120px; height: 120px; border-radius: 50%; object-fit: cover;
  margin-bottom: 22px; border: 4px solid var(--surface); box-shadow: var(--shadow-float);
}

@keyframes f-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

@media (max-width: 560px) {
  .f-progress { grid-template-columns: repeat(4, 1fr); }
  .f-progress span { font-size: 0; }
  .f-progress b { font-size: 12px; }
  .f-actions { flex-direction: column-reverse; }
  .f-actions .btn { width: 100%; }
}
