/* Cuenta Fantasy 1.2 · diseño moderno, responsive. Panel claro con azul eléctrico → violeta.
   Colores fijos (no dependen del tema de la web) para garantizar contraste, también en temas oscuros. */
:root{
  --afc-azul:#0a4dff;--afc-azul-osc:#0838c4;--afc-azul-cl:#eaf0ff;--afc-violeta:#6a3dff;
  --afc-fondo:#f4f7ff;--afc-txt:#0b1437;--afc-suave:#5b6785;--afc-borde:#dbe3fa;
  --afc-grad:linear-gradient(135deg,#0a4dff 0%,#5b3dff 100%);
  --afc-sombra:0 1px 2px rgba(11,20,55,.06),0 8px 24px rgba(11,20,55,.08);
  --afc-radio:18px;
}
.afc-cuenta,.afc-cuenta *,.afc-modal,.afc-modal *,.afc-barra,.afc-barra *{box-sizing:border-box}
.afc-cuenta,.afc-modal,.afc-barra{font-family:inherit;line-height:1.4}

/* ---------- Modal (en móvil sube desde abajo como una hoja) ---------- */
.afc-overlay{position:fixed;inset:0;background:rgba(6,16,60,.62);-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);z-index:99999;display:flex;align-items:center;justify-content:center;padding:16px;animation:afc-fade .18s ease-out}
.afc-overlay[hidden]{display:none}
.afc-abierto,.afc-abierto body{overflow:hidden}
.afc-modal{position:relative;background:#fff;color:var(--afc-txt);border-radius:22px;max-width:420px;width:100%;max-height:94vh;overflow:auto;padding:0 0 18px;box-shadow:0 24px 70px rgba(6,16,60,.45);animation:afc-sube .22s ease-out}
.afc-modal-cab{background:var(--afc-grad);color:#fff;padding:26px 22px 20px;border-radius:22px 22px 0 0;margin-bottom:16px}
.afc-modal h2{margin:0 0 4px;font-size:22px;font-weight:800;color:#fff;letter-spacing:-.01em}
.afc-sub{margin:0;font-size:13.5px;color:rgba(255,255,255,.85)}
.afc-perks{list-style:none;display:flex;flex-wrap:wrap;gap:6px;margin:12px 0 0;padding:0}
.afc-perks li{background:rgba(255,255,255,.18);border:1px solid rgba(255,255,255,.28);color:#fff;border-radius:999px;padding:4px 10px;font-size:12px;font-weight:600;margin:0}
.afc-cerrar{position:absolute;top:10px;right:12px;width:32px;height:32px;border:0;border-radius:50%;background:rgba(255,255,255,.2);font-size:16px;cursor:pointer;color:#fff;line-height:1;z-index:2}
.afc-cerrar:hover{background:rgba(255,255,255,.35)}
.afc-tabs{display:flex;gap:4px;margin:0 20px 16px;padding:4px;background:var(--afc-azul-cl);border-radius:14px}
.afc-tab{flex:1;padding:10px;border:0;background:transparent;color:var(--afc-azul-osc);border-radius:11px;cursor:pointer;font-weight:700;font-size:14px;transition:background .15s,color .15s}
.afc-tab.is-on{background:#fff;color:var(--afc-azul);box-shadow:0 1px 4px rgba(10,77,255,.2)}
.afc-form{display:none;padding:0 20px}.afc-form.is-on{display:block}
.afc-form label{display:block;font-size:13px;font-weight:700;margin-bottom:12px;color:var(--afc-txt)}
.afc-form input:not([type=file]){display:block;width:100%;margin-top:5px;padding:12px 13px;border:1.5px solid var(--afc-borde);border-radius:12px;font-size:16px;background:#f9fbff;color:var(--afc-txt);transition:border-color .15s,box-shadow .15s}
.afc-form input:focus{outline:0;border-color:var(--afc-azul);box-shadow:0 0 0 4px rgba(10,77,255,.14);background:#fff}
.afc-hp{position:absolute;left:-9999px;height:0;overflow:hidden}
.afc-olvido{display:block;text-align:center;margin-top:12px;font-size:13px;color:var(--afc-azul)!important}

/* ---------- Botones ---------- */
.afc-btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:11px 18px;border-radius:12px;border:1.5px solid var(--afc-azul);background:#fff;color:var(--afc-azul)!important;font-weight:700;font-size:14px;text-decoration:none!important;cursor:pointer;line-height:1.2;transition:transform .12s,box-shadow .15s,background .15s}
.afc-btn:hover{background:var(--afc-azul-cl);transform:translateY(-1px)}
.afc-btn--go{background:var(--afc-grad);border-color:transparent;color:#fff!important;box-shadow:0 6px 16px rgba(10,77,255,.28)}
.afc-btn--go:hover{background:var(--afc-grad);filter:brightness(1.08);box-shadow:0 8px 20px rgba(10,77,255,.38)}
.afc-btn--ghost{background:rgba(255,255,255,.16);border-color:rgba(255,255,255,.45);color:#fff!important;backdrop-filter:blur(4px)}
.afc-btn--ghost:hover{background:rgba(255,255,255,.28)}
.afc-form .afc-btn{width:100%;font-size:16px;padding:13px}
.afc-mini{font-size:12px;font-weight:700;padding:7px 12px;border-radius:999px;border:1.5px solid var(--afc-azul);color:var(--afc-azul)!important;background:#fff;text-decoration:none!important;cursor:pointer;white-space:nowrap;transition:background .15s}
.afc-mini:hover{background:var(--afc-azul-cl)}

/* ---------- Mensajes ---------- */
.afc-msg{margin:10px 0 0;font-size:13px}
.afc-ok{color:#0a7a3d}.afc-err{color:#c2181b}
p.afc-ok{background:#e9f9ef;border:1px solid #a9e2bf;border-radius:12px;padding:11px 13px;margin:0 0 14px}
.afc-aviso{background:#fff8e6;border:1px solid #f2d27a;color:#4a3500;border-radius:12px;padding:11px 13px;margin:0 0 14px;font-size:14px}

/* ---------- Barra "Sigue con": tarjetas de herramientas ---------- */
.afc-barra{margin:24px 0 8px;padding:18px;background:linear-gradient(135deg,#f0f4ff 0%,#f6f0ff 100%);border:1px solid var(--afc-borde);border-radius:var(--afc-radio);box-shadow:var(--afc-sombra)}
.afc-barra-cab{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 10px;margin-bottom:14px}
.afc-barra-t{font-weight:800;font-size:18px;color:var(--afc-txt);letter-spacing:-.01em}
.afc-barra-cab small{color:var(--afc-suave);font-size:13px}
.afc-barra-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(210px,1fr));gap:10px}
.afc-enlace{display:flex;align-items:center;gap:12px;padding:12px 14px;border-radius:14px;background:#fff;border:1.5px solid var(--afc-borde);color:var(--afc-txt)!important;text-decoration:none!important;transition:transform .15s,box-shadow .15s,border-color .15s}
.afc-enlace:hover{transform:translateY(-3px);border-color:var(--afc-azul);box-shadow:0 10px 24px rgba(10,77,255,.16)}
.afc-enlace-ico{flex:none;width:42px;height:42px;border-radius:12px;background:var(--afc-azul-cl);display:flex;align-items:center;justify-content:center;font-size:22px}
.afc-enlace-txt{flex:1;min-width:0;display:flex;flex-direction:column}
.afc-enlace-txt b{font-size:14px;font-weight:800;color:var(--afc-txt)}
.afc-enlace-txt small{font-size:12px;color:var(--afc-suave);margin-top:1px}
.afc-enlace-flecha{flex:none;color:var(--afc-azul);font-weight:800;transition:transform .15s}
.afc-enlace:hover .afc-enlace-flecha{transform:translateX(4px)}
.afc-enlace--cuenta{background:var(--afc-grad);border-color:transparent;grid-column:1/-1;box-shadow:0 8px 22px rgba(10,77,255,.3)}
.afc-enlace--cuenta:hover{border-color:transparent;box-shadow:0 12px 28px rgba(10,77,255,.42);filter:brightness(1.06)}
.afc-enlace--cuenta .afc-enlace-ico{background:rgba(255,255,255,.2)}
.afc-enlace--cuenta .afc-enlace-txt b,.afc-enlace--cuenta .afc-enlace-txt small,.afc-enlace--cuenta .afc-enlace-flecha{color:#fff!important}
.afc-enlace--cuenta .afc-enlace-txt small{opacity:.85}

/* ---------- Página Mi cuenta ---------- */
.afc-cuenta{max-width:820px;margin:0 auto;padding:14px;background:var(--afc-fondo);color:var(--afc-txt);border-radius:24px;border:1px solid var(--afc-borde)}
.afc-cuenta h2,.afc-cuenta h3,.afc-cuenta b,.afc-cuenta p,.afc-cuenta li{color:var(--afc-txt)}
.afc-hero{position:relative;display:flex;align-items:center;gap:16px;flex-wrap:wrap;padding:22px;margin-bottom:16px;border-radius:20px;background:var(--afc-grad);color:#fff;box-shadow:0 14px 34px rgba(10,77,255,.32);overflow:hidden}
.afc-hero::after{content:"";position:absolute;right:-60px;top:-60px;width:220px;height:220px;border-radius:50%;background:rgba(255,255,255,.1);pointer-events:none}
.afc-hero .afc-avatar{width:84px;height:84px;border-radius:50%;border:3px solid #fff;box-shadow:0 6px 18px rgba(0,0,0,.25);object-fit:cover;background:#fff}
.afc-hero-id{flex:1;min-width:180px;position:relative;z-index:1}
.afc-hero h2,.afc-cuenta .afc-hero h2{margin:0;font-size:24px;font-weight:800;color:#fff;letter-spacing:-.01em;word-break:break-word}
.afc-hero small{display:block;color:rgba(255,255,255,.85);font-size:13px;margin:2px 0 8px;word-break:break-all}
.afc-chip{display:inline-block;padding:4px 10px;border-radius:999px;font-size:12px;font-weight:700}
.afc-chip--ok{background:rgba(255,255,255,.95);color:#0a7a3d}
.afc-chip--pend{background:#fff3c4;color:#6b4a00}
.afc-hero .afc-btn{position:relative;z-index:1}
.afc-hero-stats{position:relative;z-index:1;display:grid;grid-template-columns:repeat(3,1fr);gap:8px;width:100%;margin-top:6px}
.afc-hero-stats div{background:rgba(255,255,255,.16);border:1px solid rgba(255,255,255,.25);border-radius:14px;padding:10px 6px;text-align:center}
.afc-hero-stats b,.afc-cuenta .afc-hero-stats b{display:block;font-size:24px;font-weight:800;line-height:1.1;color:#fff}
.afc-hero-stats span{font-size:12px;color:rgba(255,255,255,.88)}
.afc-card{background:#fff;border:1px solid var(--afc-borde);border-radius:var(--afc-radio);padding:18px;margin:0 0 14px;color:var(--afc-txt);box-shadow:var(--afc-sombra)}
.afc-card h3{display:flex;align-items:center;gap:10px;margin:0 0 12px;font-size:17px;font-weight:800}
.afc-ico{flex:none;width:36px;height:36px;border-radius:11px;background:var(--afc-azul-cl);display:inline-flex;align-items:center;justify-content:center;font-size:19px}
.afc-centro{text-align:center}
.afc-vacio,.afc-nota{color:var(--afc-suave)!important;font-size:14px;margin:6px 0}
.afc-sub-t{font-weight:700;font-size:13px;margin:12px 0 4px}
.afc-lista{list-style:none;margin:0 0 10px;padding:0}
.afc-lista--scroll{max-height:420px;overflow:auto;padding-right:4px}
.afc-lista li{display:flex;gap:10px;align-items:center;justify-content:space-between;padding:11px 0;border-top:1px solid var(--afc-borde)}
.afc-lista li:first-child{border-top:0}
.afc-lista li>div{flex:1;min-width:0}
.afc-lista small,.afc-lista em{display:block;color:var(--afc-suave)!important;font-size:12px;font-style:normal}
.afc-lista li.is-nueva{background:var(--afc-azul-cl);margin:0 -8px;padding-left:8px;padding-right:8px;border-radius:10px}
.afc-x{border:0;background:none;font-size:22px;color:var(--afc-suave);cursor:pointer;line-height:1;width:32px;height:32px;border-radius:50%}
.afc-x:hover{color:#c2181b;background:#fdeaea}
.afc-acciones{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px}
.afc-pill{display:inline-block;background:var(--afc-azul);color:#fff!important;border-radius:999px;font-size:12px;font-weight:700;padding:2px 9px;vertical-align:middle;margin-left:6px}
.afc-fila-sub{display:flex;justify-content:space-between;gap:12px;align-items:center;padding:12px 0;border-top:1px solid var(--afc-borde)}
.afc-fila-sub small{display:block;color:var(--afc-suave);font-size:12px}
.afc-switch{flex:none;width:50px;height:30px;border-radius:999px;border:0;background:#b8c3df;position:relative;cursor:pointer;padding:0;transition:background .15s}
.afc-switch span{position:absolute;top:3px;left:3px;width:24px;height:24px;border-radius:50%;background:#fff;box-shadow:0 1px 3px rgba(0,0,0,.25);transition:left .15s}
.afc-switch.is-on{background:var(--afc-azul)}.afc-switch.is-on span{left:23px}
.afc-switch[disabled]{opacity:.5;cursor:not-allowed}
.afc-mini,.afc-btn,.afc-x,.afc-switch,.afc-tab{-webkit-tap-highlight-color:transparent}

/* ---------- Foto de perfil (registro y Mi cuenta) ---------- */
.afc-avatar-campo{text-align:center;margin-bottom:14px}
.afc-avatar-subir{display:inline-flex!important;flex-direction:column;align-items:center;gap:8px;cursor:pointer;margin:0!important;font-weight:700;font-size:13px;color:var(--afc-azul)}
.afc-avatar-prev{width:78px;height:78px;border-radius:50%;object-fit:cover;border:3px solid #fff;box-shadow:0 0 0 2px var(--afc-azul),0 6px 16px rgba(10,77,255,.2);background:#e6ecff;transition:transform .15s}
.afc-avatar-subir:hover .afc-avatar-prev{transform:scale(1.05)}
.afc-perfil label{display:block;font-size:13px;font-weight:700;margin-bottom:12px}
.afc-perfil input[type=text]{display:block;width:100%;margin-top:5px;padding:12px;border:1.5px solid var(--afc-borde);border-radius:12px;font-size:16px;background:#f9fbff;color:var(--afc-txt)}
.afc-perfil input[type=text]:focus{outline:0;border-color:var(--afc-azul);box-shadow:0 0 0 4px rgba(10,77,255,.14)}
.afc-perfil small{display:block;color:var(--afc-suave);font-weight:400;margin-top:4px}
.afc-perfil-stats{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 12px}
.afc-perfil-stats span{background:var(--afc-azul-cl);border-radius:999px;padding:6px 12px;font-size:13px}
.afc-perfil .afc-btn{width:100%}

/* ---------- Animaciones ---------- */
@keyframes afc-fade{from{opacity:0}to{opacity:1}}
@keyframes afc-sube{from{opacity:0;transform:translateY(14px) scale(.98)}to{opacity:1;transform:none}}
@media (prefers-reduced-motion:reduce){.afc-overlay,.afc-modal{animation:none}.afc-enlace,.afc-btn,.afc-enlace-flecha{transition:none}.afc-enlace:hover,.afc-btn:hover{transform:none}}

/* ---------- Responsive ---------- */
@media (max-width:640px){
  .afc-overlay{align-items:flex-end;padding:0}
  .afc-modal{max-width:none;border-radius:22px 22px 0 0;max-height:92vh;padding-bottom:calc(18px + env(safe-area-inset-bottom,0px));animation:afc-hoja .25s ease-out}
  @keyframes afc-hoja{from{transform:translateY(100%)}to{transform:none}}
  .afc-barra{padding:14px}
  .afc-barra-t{font-size:16px}
  .afc-barra-grid{grid-template-columns:1fr 1fr;gap:8px}
  .afc-enlace{flex-direction:column;align-items:flex-start;gap:8px;padding:12px}
  .afc-enlace-flecha{display:none}
  .afc-enlace--cuenta{flex-direction:row;align-items:center}
  .afc-enlace--cuenta .afc-enlace-flecha{display:block}
  .afc-cuenta{padding:10px;border-radius:18px}
  .afc-hero{padding:18px;gap:12px}
  .afc-hero .afc-avatar{width:68px;height:68px}
  .afc-hero h2,.afc-cuenta .afc-hero h2{font-size:20px}
  .afc-hero .afc-btn{width:100%}
  .afc-card{padding:14px;border-radius:16px}
  .afc-lista li{flex-wrap:wrap}
  .afc-lista li>div{flex:1 1 100%}
}
@media (max-width:360px){.afc-barra-grid{grid-template-columns:1fr}}

/* ---------- Botón de cuenta circular (cabecera) ---------- */
.afc-acceso,.afc-acceso *{box-sizing:border-box}
.afc-acceso{position:relative;display:inline-flex;align-items:center;justify-content:center;flex:none;gap:7px;height:42px;min-width:42px;border-radius:999px;text-decoration:none!important;cursor:pointer;font-weight:800;font-size:14px;line-height:1;transition:transform .15s,box-shadow .2s;-webkit-tap-highlight-color:transparent}
.afc-acceso[hidden]{display:none!important}
.afc-acceso--user{width:42px;padding:0}
.afc-acceso--user .afc-acceso-img{display:block;width:38px;height:38px;border-radius:50%;object-fit:cover;background:#e6ecff;border:2px solid #fff;box-shadow:0 0 0 2px rgba(10,77,255,.5),0 2px 8px rgba(0,0,0,.25)}
.afc-acceso--user:hover{transform:scale(1.08)}
.afc-acceso--invitado{padding:0 14px 0 11px;background:#fff;color:var(--afc-azul)!important;box-shadow:0 0 0 2px rgba(10,77,255,.45),0 3px 10px rgba(0,0,0,.2)}
.afc-acceso--invitado svg{width:20px;height:20px;flex:none}
.afc-acceso--invitado:hover{transform:translateY(-1px);box-shadow:0 0 0 2px var(--afc-azul),0 6px 14px rgba(10,77,255,.35)}
.afc-acceso-punto{position:absolute;top:1px;right:1px;width:11px;height:11px;border-radius:50%;background:#ff9f1c;border:2px solid #fff}
.afc-acceso--invitado .afc-acceso-punto{animation:afc-pulso 2s ease-out infinite}
@keyframes afc-pulso{0%{box-shadow:0 0 0 0 rgba(255,159,28,.7)}70%{box-shadow:0 0 0 8px rgba(255,159,28,0)}100%{box-shadow:0 0 0 0 rgba(255,159,28,0)}}
@media (prefers-reduced-motion:reduce){.afc-acceso--invitado .afc-acceso-punto{animation:none}.afc-acceso{transition:none}}
/* En móvil el llamamiento se queda en un círculo (sin texto) para no ocupar sitio */
@media (max-width:640px){.afc-acceso--invitado{width:42px;padding:0}.afc-acceso--invitado .afc-acceso-txt{display:none}}
/* Junto al buscador de AF Menú */
#afm .afc-acceso--barra{margin:0}
#afm .afm-nologo .afc-acceso--barra[data-pos="antes"]{margin-left:auto}
#afm .afm-nologo .afc-acceso--barra[data-pos="antes"]~.afm-sbtn{margin-left:0}
/* Con la hamburguesa a la derecha AF Menú reordena los iconos en móvil: se mantiene el orden elegido */
#afm.afm-bs-r .afc-acceso--barra[data-pos="antes"]{order:0}
#afm.afm-bs-r .afc-acceso--barra[data-pos="despues"]{order:2}
/* Círculo flotante (solo si se activa y no hay cabecera de AF Menú) */
.afc-acceso--flotante{position:fixed;top:calc(12px + env(safe-area-inset-top,0px));right:12px;z-index:9990}
