/* Social Connect V2 — Tema alineado con SocialConnect (limpio, verde, DM Sans) */

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700&family=Plus+Jakarta+Sans:wght@700;800&display=swap");

:root {
  color-scheme: light;
  /* Paleta tipo SocialConnect */
  --g: #16a34a;
  --gl: #22c55e;
  --gd: #15803d;
  --gbg: #f0fdf4;
  --gs: #dcfce7;
  --t: #0d9488;
  --td: #0f766e;
  --r: #dc2626;
  --rs: #fee2e2;
  --tx: #111827;
  --tx2: #374151;
  --tx3: #6b7280;
  --tx4: #9ca3af;
  --bd: #e5e7eb;
  --bg: #f9fafb;
  --bg2: #f3f4f6;
  --w: #fff;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --radius-sm: 8px;
  --radius-lg: 18px;
  --radius-xl: 22px;
  --ring: rgba(22, 163, 74, 0.35);

  /* Compatibilidad con clases antiguas */
  --ink: var(--tx);
  --ink-muted: var(--tx3);
  --font: "Inter", "DM Sans", system-ui, -apple-system, sans-serif;
  --font-display: "Plus Jakarta Sans", system-ui, sans-serif;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 24px 48px rgba(15, 23, 42, 0.1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--tx);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: rgba(22, 163, 74, 0.22);
  color: var(--tx);
}

a {
  color: var(--g);
  font-weight: 600;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Login / páginas centradas */
.shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

/* Acceso — fondo ambiental + tarjeta cristal */
.shell--auth {
  position: relative;
  isolation: isolate;
  background:
    radial-gradient(ellipse 110% 85% at 50% -25%, rgba(34, 197, 94, 0.22), transparent 58%),
    radial-gradient(ellipse 90% 55% at 100% 5%, rgba(13, 148, 136, 0.14), transparent 50%),
    radial-gradient(ellipse 70% 45% at 0% 95%, rgba(22, 163, 74, 0.1), transparent 48%),
    linear-gradient(168deg, #ecfdf5 0%, #f0fdf9 24%, #f8fafc 52%, #eef2f7 100%);
  background-attachment: fixed;
}

.shell--auth::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.45;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56' viewBox='0 0 56 56'%3E%3Cpath fill='%2316a34a' fill-opacity='0.04' d='M28 0h14v14H28V0zm0 42h14v14H28V42zM0 28h14v14H0V28zm42-14h14v14H42V14z'/%3E%3C/svg%3E");
  pointer-events: none;
}

.shell--app {
  justify-content: flex-start;
  align-items: stretch;
  padding-top: 2rem;
}

/* Fondo suave para paneles fullscreen (ej. superadmin), sin pisar el club */
body:not(.has-club-topnav) .shell--app {
  min-height: 100dvh;
  padding-bottom: 2.5rem;
  background:
    radial-gradient(ellipse 95% 55% at 50% -15%, rgba(34, 197, 94, 0.12), transparent 52%),
    radial-gradient(ellipse 80% 40% at 100% 0%, rgba(13, 148, 136, 0.06), transparent 45%),
    linear-gradient(180deg, #f0fdf9 0%, var(--bg) 42%);
  background-attachment: fixed;
}

.panel {
  position: relative;
  width: min(440px, 100%);
  background: var(--w);
  border: 1px solid var(--bd);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md), var(--shadow-lg);
  padding: 2rem 1.75rem 1.75rem;
  transition: box-shadow 0.25s var(--ease-out), transform 0.25s var(--ease-out);
}

.shell--auth .panel {
  width: min(420px, 100%);
  padding: 2.35rem 2rem 2rem;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(255, 255, 255, 0.88);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.95) inset,
    0 28px 56px rgba(15, 23, 42, 0.11),
    0 10px 28px rgba(22, 163, 74, 0.07);
}

.shell--auth .panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 1.75rem;
  right: 1.75rem;
  height: 3px;
  border-radius: 0 0 6px 6px;
  background: linear-gradient(90deg, var(--g) 0%, var(--t) 100%);
  opacity: 0.95;
}

.panel--wide {
  width: min(1120px, 100%);
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
  border-radius: var(--radius-lg);
}

.shell--app .panel--wide {
  border: 1px solid rgba(148, 163, 184, 0.22);
  box-shadow: var(--shadow-md), 0 28px 48px rgba(15, 23, 42, 0.06);
  padding-left: clamp(1.1rem, 2.5vw, 1.85rem);
  padding-right: clamp(1.1rem, 2.5vw, 1.85rem);
  padding-top: 1.35rem;
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 1.65rem;
}

.brand__mark {
  width: 52px;
  height: 52px;
  margin-bottom: 1rem;
  border-radius: 15px;
  background: linear-gradient(145deg, var(--g) 0%, var(--td) 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.25) inset,
    0 12px 28px rgba(22, 163, 74, 0.32);
}

.brand__mark svg {
  display: block;
}

.brand__title {
  margin: 0 0 0.4rem;
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 4.5vw, 1.85rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.15;
  background: linear-gradient(120deg, #14532d 0%, #16a34a 38%, #0d9488 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand__sub {
  margin: 0;
  max-width: 28ch;
  color: var(--tx3);
  font-size: 0.94rem;
  line-height: 1.45;
}

/* Formularios */
.form__row {
  margin-bottom: 1rem;
}

.form__row label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--tx2);
}

.input {
  width: 100%;
  padding: 0.62rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--bd);
  background: rgba(255, 255, 255, 0.96);
  font: inherit;
  font-size: 0.94rem;
  color: var(--tx);
  transition: border-color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
}

.input:hover:not(:focus) {
  border-color: #d1d5db;
}

.input:focus {
  outline: none;
  border-color: var(--g);
  box-shadow: 0 0 0 3px var(--ring);
}

.input::placeholder {
  color: var(--tx4);
}

.hint {
  font-size: 0.78rem;
  color: var(--tx3);
  margin-top: 0.35rem;
}

.hint code {
  font-size: 0.85em;
  background: var(--bg2);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}

/* Botones (primario verde como SocialConnect .btn-g) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.58rem 1.1rem;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  line-height: 1.25;
  background: linear-gradient(180deg, var(--gl) 0%, var(--g) 100%);
  color: #fff;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.2) inset,
    0 4px 14px rgba(22, 163, 74, 0.28);
  transition: background 0.2s var(--ease-out), transform 0.15s var(--ease-out), box-shadow 0.2s var(--ease-out);
}

.btn:hover {
  background: linear-gradient(180deg, #4ade80 0%, var(--gd) 100%);
  transform: translateY(-1px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.22) inset,
    0 8px 22px rgba(22, 163, 74, 0.32);
}

.btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.15) inset, 0 2px 8px rgba(22, 163, 74, 0.22);
}

.btn:focus-visible {
  outline: none;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.2) inset,
    0 4px 14px rgba(22, 163, 74, 0.28),
    0 0 0 3px var(--ring);
}

.btn--block {
  width: 100%;
}

.btn--ghost {
  background: var(--w);
  color: var(--tx2);
  border: 1.5px solid var(--bd);
  box-shadow: none;
}

.btn--ghost:hover {
  border-color: rgba(22, 163, 74, 0.45);
  color: var(--gd);
  background: var(--gbg);
  transform: translateY(-1px);
}

.btn--ghost:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--ring);
}

.btn--small {
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
}

/* Mensajes */
.msg {
  min-height: 1.25rem;
  font-size: 0.88rem;
  margin-top: 0.75rem;
}

.msg--error {
  color: var(--r);
  font-weight: 600;
}

.msg--success {
  color: var(--g);
  font-weight: 600;
}

/* Dashboard compartido */
.dash-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--bd);
}

.dash-header h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2.5vw, 1.45rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--tx);
  line-height: 1.2;
}

.dash-header__eyebrow {
  margin: 0 0 0.3rem;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--t);
}

/* Superadmin — cabecera alineada con la marca */
.dash-header.dash-header--super {
  padding: 1.1rem 1.2rem 1.15rem;
  margin-bottom: 1.35rem;
  border-bottom: none;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(240, 253, 244, 0.85) 0%, rgba(255, 255, 255, 0.98) 55%);
  border: 1px solid rgba(22, 163, 74, 0.14);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset, var(--shadow);
}

.dash-meta {
  font-size: 0.88rem;
  color: var(--tx3);
}

.grid {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 900px) {
  .grid--2 {
    grid-template-columns: 1fr 1fr;
  }
}

.card-section {
  background: var(--w);
  border: 1px solid var(--bd);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.35rem 1.4rem;
  box-shadow: var(--shadow), 0 12px 32px rgba(15, 23, 42, 0.04);
}

.card-section h2 {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--tx);
}

.table-wrap {
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid var(--bd);
  background: var(--w);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

th,
td {
  text-align: left;
  padding: 0.6rem 0.65rem;
  border-bottom: 1px solid var(--bd);
}

th {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--tx4);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--bg);
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover td {
  background: var(--bg);
}

.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 100px;
  font-size: 0.68rem;
  font-weight: 700;
}

.badge--on {
  background: var(--gs);
  color: var(--g);
}

.badge--off {
  background: var(--rs);
  color: var(--r);
}

.actions {
  white-space: nowrap;
}

.select {
  width: 100%;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  border: 1.5px solid var(--bd);
  background: var(--w);
  font: inherit;
  font-size: 0.88rem;
  color: var(--tx);
  cursor: pointer;
}

.select:focus {
  outline: none;
  border-color: var(--g);
  box-shadow: 0 0 0 3px var(--ring);
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.footer-note {
  margin-top: 1.25rem;
  font-size: 0.82rem;
  color: var(--tx3);
  text-align: center;
}

a:focus-visible {
  outline: 2px solid var(--g);
  outline-offset: 2px;
  border-radius: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }

  .btn:hover,
  .btn--ghost:hover {
    transform: none;
  }
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-thumb {
  background: var(--bd);
  border-radius: 6px;
}

/* Marca — logo SocialConnect */
.sc-logo {
  display: block;
  height: auto;
  max-width: 100%;
  object-fit: contain;
}

.sc-logo--sidebar {
  width: min(132px, calc(100% - 4px));
  margin-inline: auto;
  border-radius: 10px;
}

.sc-logo--sidebar-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  flex-shrink: 0;
  object-fit: cover;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.14);
}

.sc-logo--auth-card {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  flex-shrink: 0;
  object-fit: cover;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.14);
}

.sc-logo--hero {
  width: min(120px, 100%);
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
}

.sc-logo--admin {
  width: 52px;
  border-radius: 8px;
  flex-shrink: 0;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}

.club-app:not(.club-dark) .sc-logo--sidebar {
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.12);
}
