/* Registro, login y perfiles */
.auth-body { margin: 0; min-height: 100vh; color: #fff;
  background: radial-gradient(1200px 600px at 50% -10%, #1c1c24 0%, #0b0b0d 60%); }
.auth-body .muted { color: var(--muted); }
[hidden] { display: none !important; }

/* Tarjeta de formularios */
.auth-card { width: min(420px, 100%); margin: 0 auto; padding: 36px 22px 48px; }
.auth-card.wide { width: min(560px, 100%); }
.auth-logo { color: var(--accent); font-weight: 800; font-size: 1.6rem; margin-bottom: 18px; }
.auth-card h1 { font-size: 1.6rem; margin: 0 0 18px; }
.auth-alt { text-align: center; color: var(--muted); margin-top: 22px; }
.auth-alt a, .back-link { color: var(--accent); font-weight: 700; text-decoration: none; }
.back-link { display: inline-block; margin-bottom: 10px; }

.fld { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; min-width: 0; }
.fld > span { font-size: .85rem; color: #cfcfd6; font-weight: 600; }
.fld small { color: var(--muted); font-size: .78rem; }
.auth-body input[type=text], .auth-body input[type=email], .auth-body input[type=password] {
  width: 100%; background: #14141a; color: #fff; border: 1px solid #34343e; border-radius: 8px; padding: 13px 14px; font: inherit; font-size: 1rem; }
.auth-body input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.btn-main { width: 100%; background: var(--accent); color:var(--accent-ink,#111); border: 0; border-radius: 999px; padding: 14px; font: inherit;
            font-weight: 800; font-size: 1.05rem; cursor: pointer; text-align: center; }
.btn-outline { display: block; width: 100%; max-width: 420px; border: 3px solid #fff; border-radius: 999px; padding: 13px; color: #fff;
               font-weight: 800; font-size: 1.1rem; text-align: center; text-decoration: none; background: none; }
.btn-outline.small { display: inline-block; width: auto; max-width: none; border-width: 2px; padding: 11px 22px; font-size: 1rem; }
.btn-danger { background: none; border: 2px solid #ef4444; color: #ff8a8a; border-radius: 999px; padding: 11px 22px; font: inherit; font-weight: 700; cursor: pointer; }
.link-btn { background: none; border: 0; color: #fff; font: inherit; font-weight: 800; font-size: 1.1rem; cursor: pointer; padding: 8px; }

.notice { padding: 12px 14px; border-radius: 8px; margin-bottom: 16px; font-size: .95rem; }
.notice ul { margin: 0; padding-left: 18px; }
.notice-error { background: rgba(239,68,68,.12); border: 1px solid rgba(239,68,68,.45); }
.notice-ok { background: rgba(62,207,142,.12); border: 1px solid rgba(62,207,142,.4); }

/* Pantalla de perfiles */
.profiles { max-width: 620px; margin: 0 auto; min-height: 100vh; padding: 56px 20px 32px; display: flex; flex-direction: column; text-align: center; }
.profiles h1 { font-size: 1.7rem; margin: 0 0 8px; }
.profile-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 38px 18px; justify-items: center; margin: 56px 0; }
.profile-tile { background: none; border: 0; color: #fff; display: flex; flex-direction: column; align-items: center; gap: 12px;
                font: inherit; font-weight: 800; font-size: 1.1rem; text-decoration: none; cursor: pointer; max-width: 100%; }
.avatar { position: relative; display: block; width: min(40vw, 170px); height: min(40vw, 170px); border-radius: 50%; border: 3px solid #fff; background: #1a1a1f; }
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.avatar.add { display: grid; place-items: center; background: #000; font-size: 4.2rem; font-weight: 300; line-height: 1; }
.badge-circle { position: absolute; right: -2px; bottom: -2px; width: 38px; height: 38px; border-radius: 50%; background: #fff; color: #000;
                display: grid; place-items: center; font-size: 1.05rem; }
.pname { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-tile:hover .avatar, .profile-tile:focus-visible .avatar { border-color: var(--accent); }
.profiles-actions { margin-top: auto; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.profiles-actions form { margin: 0; }

/* Modal de PIN */
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.8); display: grid; place-items: center; padding: 16px; }
.modal-box { width: min(340px, 100%); background: #17171d; border: 1px solid #2c2c36; border-radius: 14px; padding: 24px; text-align: center; }
.modal-box h2 { margin: 0 0 6px; font-size: 1.2rem; }
#pin-input { width: 170px; text-align: center; font-size: 2rem; letter-spacing: .6em; padding: 12px 0 12px .6em; margin: 14px auto 6px; display: block; }
.pin-error { color: #ff8a8a; min-height: 1.4em; margin: 4px 0 10px; font-size: .9rem; }

/* Editar perfil */
.avatar-big { width: 130px; height: 130px; margin: 6px auto 20px; border-radius: 50%; border: 3px solid #fff; overflow: hidden; background: #1a1a1f; }
.avatar-big img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(68px, 1fr)); gap: 12px; }
.avatar-opt { position: relative; cursor: pointer; display: block; aspect-ratio: 1; }
.avatar-opt input { position: absolute; opacity: 0; pointer-events: none; }
.avatar-opt img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 3px solid transparent; display: block; transition: transform .12s; }
.avatar-opt:hover img { transform: scale(1.06); }
.avatar-opt input:checked + img { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb,244,117,33),.35); }
.avatar-opt input:focus-visible + img { outline: 2px solid #fff; outline-offset: 2px; }

.pin-box { background: #14141a; border: 1px solid #2c2c36; border-radius: 10px; padding: 14px; margin-bottom: 16px; }
.switch-row { display: flex; align-items: center; gap: 12px; cursor: pointer; font-weight: 600; margin-bottom: 4px; }
.switch-row input { width: 20px; height: 20px; accent-color: var(--accent); }
#pin-fields { margin-top: 12px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.form-buttons { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
.form-buttons .btn-main { width: auto; flex: 1; min-width: 140px; }

/* Cabecera del inicio con el perfil activo */
.topbar { display: flex; align-items: center; justify-content: space-between; }
.me-link { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 700; }
.me-link img { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; border: 2px solid #fff; }
.me-link span { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty-hint { color: var(--muted); padding: 30px 0; }
