/* =====================================================================
   Fichas — la herramienta de fichas neutras para inmobiliarias
   colaboradoras (layouts/partner, singular.primenordisk.com). Hoja propia: no
   hereda nada del admin ni de la web de GC, y el admin no la carga.

   Una mesa de oficina: fondo gris azulado (la mesa), papel blanco encima
   (cada bloque es una hoja) y un único acento, el amarillo de subrayador.
   Schibsted Grotesk para todo el texto; IBM Plex Mono para lo que es
   «dato» (enlaces, contadores, rótulos técnicos).
   ===================================================================== */

.fx {
  --desk: #E3E8EE;
  --paper: #FFFFFF;
  --ink: #17202B;
  --graphite: #566270;
  --rule: #CBD3DC;
  --marker: #FFD84D;
  --danger: #B42318;
  --sans: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --shadow: 0 1px 0 rgba(23, 32, 43, .04), 0 10px 30px -12px rgba(23, 32, 43, .22);

  margin: 0;
  min-height: 100vh;
  background: var(--desk);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
.fx *, .fx *::before, .fx *::after { box-sizing: border-box; }
.fx a { color: var(--ink); }
.fx :focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.fx-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* hidden gana siempre (los botones son inline-flex y lo pisaban). */
.fx [hidden] { display: none !important; }
.fx input[type="checkbox"] { accent-color: var(--ink); }

/* ── Barra superior ─────────────────────────────────────────────── */
.fx-top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  max-width: 1120px; margin: 0 auto; padding: 18px 16px;
}
.fx-mark { display: inline-flex; align-items: baseline; gap: 8px; text-decoration: none; }
.fx-mark__name { font-weight: 800; font-size: 20px; letter-spacing: -.4px; }
.fx-mark__tag {
  font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .8px;
  color: var(--graphite); border: 1px solid var(--rule); border-radius: 3px; padding: 1px 5px;
}
.fx-top__user { display: flex; align-items: center; gap: 14px; font-size: 14px; color: var(--graphite); }
.fx-top__user a { font-weight: 600; }

.fx-main { max-width: 1120px; margin: 0 auto; padding: 8px 16px 64px; }

/* ── Tipografía ─────────────────────────────────────────────────── */
.fx-h1 {
  font-size: clamp(34px, 5.2vw, 58px); line-height: 1.02; letter-spacing: -1.6px;
  font-weight: 800; margin: 0 0 18px; max-width: 13ch;
}
.fx-h1 mark {
  color: inherit; padding: 0 .06em;
  background: linear-gradient(transparent 58%, var(--marker) 58%, var(--marker) 92%, transparent 92%);
}
.fx-h2 { font-size: 24px; line-height: 1.15; letter-spacing: -.4px; font-weight: 800; margin: 0 0 6px; }
.fx-h3 { font-size: 17px; font-weight: 700; margin: 0; }
.fx-lede { font-size: 18px; line-height: 1.55; color: var(--graphite); max-width: 46ch; margin: 0 0 26px; }
.fx-muted { color: var(--graphite); font-size: 14px; line-height: 1.55; margin: 0; }
.fx-mono { font-family: var(--mono); font-size: 13px; }

/* ── Botones: uno lleno (la acción) y uno de contorno ───────────── */
.fx-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 20px; border-radius: 6px; border: 1.5px solid var(--ink);
  background: var(--ink); color: #fff; font: 700 15px/1 var(--sans); text-decoration: none;
  cursor: pointer; white-space: nowrap; transition: transform .12s ease, background .12s ease;
}
.fx .fx-btn { color: #fff; }
.fx-btn:hover { background: #24303F; }
.fx-btn:active { transform: translateY(1px); }
.fx-btn[aria-busy="true"] { opacity: .7; cursor: progress; }
.fx .fx-btn--ghost { background: transparent; color: var(--ink); }
.fx-btn--ghost:hover { background: rgba(23, 32, 43, .06); }
.fx-btn--sm { min-height: 36px; padding: 0 14px; font-size: 14px; }

/* ── Avisos ─────────────────────────────────────────────────────── */
.fx-flash {
  margin: 0 0 18px; padding: 12px 16px; border-radius: 6px; font-size: 15px;
  background: var(--paper); border-left: 4px solid var(--ink); box-shadow: var(--shadow);
}
.fx-flash--alert { border-left-color: var(--danger); }

/* ── Portada (landing) ──────────────────────────────────────────── */
.fx-hero {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  gap: 56px; align-items: center; padding: 40px 0 56px;
}
.fx-url {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px;
  background: var(--paper); padding: 10px; border-radius: 8px; box-shadow: var(--shadow);
  max-width: 620px;
}
.fx-url__input {
  width: 100%; min-height: 50px; border: 0; border-radius: 4px; padding: 0 12px;
  font: 400 15px var(--mono); color: var(--ink); background: #F4F6F8;
}
.fx-url__input::placeholder { color: #8A95A2; }
.fx-url__input:focus { outline: 2px solid var(--marker); outline-offset: 0; background: #fff; }
.fx-url details { grid-column: 1 / -1; padding: 2px 4px 4px; }
.fx-url summary { cursor: pointer; font-size: 13px; color: var(--graphite); }
.fx-url ol { margin: 10px 0 10px 18px; padding: 0; font-size: 13px; color: var(--graphite); line-height: 1.7; }
.fx-url textarea {
  width: 100%; min-height: 110px; border: 1px solid var(--rule); border-radius: 4px; padding: 8px 10px;
  font: 12px var(--mono); resize: vertical;
}
.fx-hero .fx-note { margin-top: 14px; font-size: 13px; color: var(--graphite); }

/* La hoja: la ficha neutra dibujada, apoyada en la mesa. */
.fx-hero__sheet { margin: 0; justify-self: center; width: min(100%, 360px); }
.fx-sheet {
  display: block; width: 100%; height: auto; background: var(--paper);
  box-shadow: 0 2px 0 rgba(23, 32, 43, .05), 0 30px 60px -22px rgba(23, 32, 43, .45);
  transform: rotate(-2.5deg); animation: fx-rise .7s cubic-bezier(.2, .7, .2, 1) both;
}
.fx-hero__sheet figcaption {
  margin-top: 22px; text-align: center; font: 12px var(--mono); color: var(--graphite); letter-spacing: .3px;
}
@keyframes fx-rise {
  from { opacity: 0; transform: translateY(18px) rotate(-1deg); }
  to   { opacity: 1; transform: rotate(-2.5deg); }
}

/* Los tres pasos: es un proceso de verdad, por eso van numerados. */
.fx-steps {
  list-style: none; counter-reset: fx-step; margin: 0; padding: 28px 0 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px;
  border-top: 1px solid var(--rule);
}
.fx-steps li { counter-increment: fx-step; }
.fx-steps li::before {
  content: counter(fx-step); display: inline-grid; place-items: center;
  width: 28px; height: 28px; border-radius: 50%; background: var(--ink); color: #fff;
  font: 600 13px var(--mono); margin-bottom: 12px;
}
.fx-steps h2 { font-size: 17px; font-weight: 700; margin: 0 0 6px; }
.fx-steps p { margin: 0; color: var(--graphite); font-size: 15px; }

/* ── Hojas (bloques de contenido) ───────────────────────────────── */
.fx-paper {
  background: var(--paper); border-radius: 8px; box-shadow: var(--shadow);
  padding: 24px; margin-bottom: 18px;
}
.fx-paper__head {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px;
  padding-bottom: 14px; margin-bottom: 18px; border-bottom: 1px solid #E7EBF0;
}
.fx-paper__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 13px; color: var(--graphite); }

/* Barra de la revisión: el botón de generar siempre a mano. */
.fx-bar {
  position: sticky; top: 0; z-index: 5;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px;
  margin: 0 -16px 18px; padding: 14px 16px; background: rgba(227, 232, 238, .94);
  backdrop-filter: blur(6px); border-bottom: 1px solid var(--rule);
}
.fx-bar__actions, .fx-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.fx-actions { margin: 6px 0 28px; }

/* ── Campos ─────────────────────────────────────────────────────── */
.fx-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 16px; margin-bottom: 14px; }
.fx-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fx-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.fx-field--wide { margin-bottom: 14px; }
.fx-label { font-size: 13px; font-weight: 600; color: var(--graphite); }
.fx-input, .fx-select, .fx-textarea {
  width: 100%; min-height: 42px; padding: 8px 11px; border: 1px solid var(--rule); border-radius: 5px;
  background: #fff; color: var(--ink); font: 15px var(--sans);
}
.fx-textarea { line-height: 1.55; resize: vertical; }
.fx-input:focus, .fx-select:focus, .fx-textarea:focus { outline: 2px solid var(--marker); outline-offset: 0; border-color: var(--ink); }
.fx-hint { font-size: 13px; color: var(--graphite); margin: 0; }
.fx-checks { display: flex; flex-wrap: wrap; gap: 10px 18px; }
.fx-check { display: inline-flex; align-items: center; gap: 7px; font-size: 15px; cursor: pointer; }
.fx-check input { width: 17px; height: 17px; accent-color: var(--ink); }
.fx-inline { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.fx-inline .fx-field { flex: 0 1 220px; }

/* ── Fotos (las clases las usa ficha_photos_controller.js) ──────── */
.fx-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.fx .ficha-photo { display: block; position: relative; }
.fx .ficha-photo__select { display: block; cursor: pointer; }
.fx .ficha-photo__box { position: absolute; top: 8px; left: 8px; width: 18px; height: 18px; z-index: 2; accent-color: var(--ink); cursor: pointer; }
.fx .ficha-photo__img {
  display: block; width: 100%; height: 112px; object-fit: cover; border-radius: 5px;
  border: 1px solid #E7EBF0; transition: opacity .15s;
}
.fx .ficha-photo--own .ficha-photo__img { border: 2px solid var(--ink); }
.fx .ficha-photo:has(.ficha-photo__box:not(:checked)) .ficha-photo__img { opacity: .38; }
.fx .ficha-photo__order, .fx .ficha-photo__own {
  position: absolute; bottom: 8px; padding: 2px 7px; border-radius: 3px; pointer-events: none;
  font: 600 11px var(--mono); color: #fff;
}
.fx .ficha-photo__order { left: 8px; background: var(--ink); }
.fx .ficha-photo__order--out { background: var(--danger); }
.fx .ficha-photo__own { right: 8px; background: var(--graphite); }
.fx .ficha-photo__watermark {
  position: absolute; right: 8px; top: 8px; z-index: 3; display: flex; align-items: center; gap: 4px;
  padding: 3px 6px; border-radius: 4px; background: rgba(255, 255, 255, .95);
  font: 600 11px var(--sans); color: var(--ink); cursor: pointer;
}
.fx .ficha-photo__watermark:has(input:checked) { background: var(--marker); }
.fx .ficha-photo__watermark input { width: 14px; height: 14px; margin: 0; accent-color: var(--ink); }
.fx-photos__tools { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 16px 0 0; }
.fx-own { margin-top: 20px; padding-top: 18px; border-top: 1px solid #E7EBF0; }

/* ── Esperas ────────────────────────────────────────────────────── */
.fx-wait { max-width: 680px; margin: 48px auto; }
.fx-wait__url { word-break: break-all; color: var(--graphite); margin: 0 0 18px; }
.fx-progress { height: 6px; border-radius: 3px; background: #E7EBF0; overflow: hidden; margin: 0 0 18px; }
.fx-progress span {
  display: block; width: 36%; height: 100%; border-radius: 3px; background: var(--marker);
  animation: fx-slide 1.4s ease-in-out infinite;
}
@keyframes fx-slide { from { transform: translateX(-100%); } to { transform: translateX(280%); } }
.fx-wait .fx-btn { margin-top: 20px; }

/* ── ¿Te ha servido? ────────────────────────────────────────────── */
.fx-opinion textarea { margin: 12px 0; }
.fx-opinion__choices { display: flex; flex-wrap: wrap; gap: 10px; }
.fx-opinion__done { margin: 0; font-weight: 600; }

/* ── Acceso (vista de Devise, compartida con la web) ────────────── */
.fx .auth-page { display: grid; place-items: center; padding: 48px 0; }
.fx .auth-card {
  width: min(100%, 420px); background: var(--paper); border-radius: 8px; box-shadow: var(--shadow); padding: 28px;
}
.fx .auth-card__title { font-size: 26px; font-weight: 800; letter-spacing: -.5px; margin: 0 0 4px; }
.fx .auth-card__subtitle { color: var(--graphite); margin: 0 0 22px; }
.fx .auth-form .form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.fx .auth-form label { font-size: 13px; font-weight: 600; color: var(--graphite); }
.fx .auth-form input[type="email"], .fx .auth-form input[type="password"] {
  min-height: 44px; padding: 8px 11px; border: 1px solid var(--rule); border-radius: 5px; font: 15px var(--sans);
}
.fx .auth-form input:focus { outline: 2px solid var(--marker); outline-offset: 0; border-color: var(--ink); }
.fx .auth-remember { flex-direction: row !important; align-items: center; }
.fx .auth-form .btn {
  width: 100%; min-height: 46px; border: 0; border-radius: 6px; background: var(--ink); color: #fff;
  font: 700 15px var(--sans); cursor: pointer;
}
.fx .auth-card__links { margin-top: 16px; font-size: 14px; }

/* ── Móvil ──────────────────────────────────────────────────────── */
@media (max-width: 860px) {
  .fx-hero { grid-template-columns: 1fr; gap: 36px; padding-top: 16px; }
  .fx-hero__sheet { width: min(72%, 280px); }
  .fx-steps { grid-template-columns: 1fr; gap: 22px; }
  .fx-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .fx-url { grid-template-columns: 1fr; }
  .fx-url .fx-btn { width: 100%; }
  .fx-grid, .fx-grid--2 { grid-template-columns: 1fr; }
  .fx-paper { padding: 18px; }
  .fx-photos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  .fx-sheet { animation: none; }
  .fx-progress span { animation: none; width: 100%; opacity: .6; }
  .fx-btn { transition: none; }
}
