@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@400;500;600;700&family=Lato:ital,wght@0,300;0,400;0,700;1,400&display=swap');

/* ─── VARIABLES ───────────────────────────────────────────────────── */
:root {
  --forest:      #131f13;
  --forest-mid:  #1e3020;
  --forest-soft: #2d4a2d;
  --lima:        #c8d400;
  --lima-hover:  #d6e300;
  --lima-glow:   rgba(200,212,0,0.25);
  --bg:          #f0ece3;
  --bg-card:     #ffffff;
  --bg-inner:    #f7f4ee;
  --text:        #222;
  --muted:       #666;
  --border:      #ddd8ce;
  --success:     #2d7a4f;
  --error:       #c0392b;
  --radius:      8px;
  --shadow:      0 3px 18px rgba(0,0,0,0.09);
}

/* ─── RESET ───────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ─── BASE ────────────────────────────────────────────────────────── */
body {
  font-family: 'Lato', 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

/* ─── HEADER ──────────────────────────────────────────────────────── */
header {
  background: linear-gradient(135deg, var(--forest) 0%, var(--forest-mid) 100%);
  color: white;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  border-bottom: 3px solid var(--lima);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 20px rgba(0,0,0,0.4);
}

header h1 {
  font-family: 'Oswald', sans-serif;
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--lima);
}

header span {
  font-size: 0.78rem;
  opacity: 0.55;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-weight: 300;
}

/* ─── CONTAINER ───────────────────────────────────────────────────── */
.container {
  max-width: 760px;
  margin: 2rem auto;
  padding: 0 1rem;
}

/* ─── CARD ────────────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}

.card h2 {
  font-family: 'Oswald', sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--forest-mid);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 1.5rem;
  padding-bottom: 0.7rem;
  border-bottom: 2px solid var(--lima);
}

/* Sub-cards (secciones internas del formulario) */
.card-inner {
  background: var(--bg-inner);
  border-radius: 6px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--lima);
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.card-inner h2 {
  font-family: 'Oswald', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

/* ─── TABS (login) ────────────────────────────────────────────────── */
.tabs {
  display: flex;
  border-bottom: 2px solid var(--border);
  margin-bottom: 1.5rem;
}

.tab-btn {
  flex: 1;
  background: none;
  border: none;
  padding: 0.75rem 1rem;
  font-family: 'Oswald', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #aaa;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.2s, border-color 0.2s;
}

.tab-btn.active {
  color: var(--forest-mid);
  border-bottom-color: var(--lima);
}

.tab-btn:hover:not(.active) { color: var(--forest-mid); }

/* ─── FORM ────────────────────────────────────────────────────────── */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-group { margin-bottom: 1rem; }
.form-group.full { grid-column: 1 / -1; }

label {
  display: block;
  font-size: 0.77rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

label .required { color: var(--error); margin-left: 2px; }

input, select {
  width: 100%;
  padding: 0.62rem 0.9rem;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  font-size: 0.95rem;
  font-family: 'Lato', sans-serif;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: white;
  color: var(--text);
}

input:focus, select:focus {
  outline: none;
  border-color: var(--lima);
  box-shadow: 0 0 0 3px var(--lima-glow);
}

input.error, select.error { border-color: var(--error); }

.field-error {
  font-size: 0.76rem;
  color: var(--error);
  margin-top: 0.25rem;
  display: none;
}

.field-error.visible { display: block; }

/* Password field wrapper */
.password-wrapper { position: relative; }
.password-wrapper input { padding-right: 2.8rem; }

.toggle-pass {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: #bbb;
  font-size: 1.05rem;
  padding: 0;
  line-height: 1;
  transition: color 0.2s;
}
.toggle-pass:hover { color: var(--forest-mid); }

.password-hint { font-size: 0.75rem; color: #bbb; margin-top: 0.3rem; }

/* ─── BUTTONS ─────────────────────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: 0.78rem 2rem;
  border: none;
  border-radius: 6px;
  font-family: 'Oswald', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
}

.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--lima);
  color: #111;
  width: 100%;
  box-shadow: 0 4px 14px var(--lima-glow);
}

.btn-primary:hover {
  background: var(--lima-hover);
  box-shadow: 0 6px 18px rgba(200,212,0,0.35);
}

.btn-primary:disabled {
  background: #d4d0c8;
  color: #999;
  box-shadow: none;
  cursor: not-allowed;
}

.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #38946a; }

.btn-danger { background: var(--error); color: white; }
.btn-danger:hover { background: #e74c3c; }

/* Link-style button */
.link-btn {
  background: none;
  border: none;
  color: var(--forest-mid);
  cursor: pointer;
  font-size: 0.88rem;
  padding: 0;
  text-decoration: underline;
  font-family: 'Lato', sans-serif;
}
.link-btn:hover { color: var(--forest); }

/* ─── ALERTS ──────────────────────────────────────────────────────── */
.alert {
  padding: 0.9rem 1.1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  font-size: 0.92rem;
  border-left: 4px solid;
}

.alert-success {
  background: #edf8f2;
  color: #1a5c35;
  border-color: var(--success);
}

.alert-error {
  background: #fdf0ef;
  color: #7a1c1c;
  border-color: var(--error);
}

.alert-info {
  background: #f5f7e8;
  color: #3a4a00;
  border-color: var(--lima);
}

/* ─── LOADING SPINNER ─────────────────────────────────────────────── */
.loading {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(0,0,0,0.15);
  border-top-color: #222;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
  margin-right: 8px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ─── SUCCESS / SENT SCREEN ───────────────────────────────────────── */
.success-screen {
  text-align: center;
  padding: 2.5rem 1rem;
}

.success-screen .icon { font-size: 3.5rem; margin-bottom: 1rem; }

.success-screen h2 {
  font-family: 'Oswald', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--forest-mid);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 0.75rem;
}

.success-screen p { color: var(--muted); line-height: 1.7; font-size: 0.95rem; }

/* ─── PERFIL: CABECERA CON FOTO ───────────────────────────────────── */
.perfil-cabecera {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1rem;
  padding: 1.25rem 1.5rem;
}

.perfil-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.perfil-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--lima);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #111;
  font-family: 'Oswald', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  overflow: hidden;
  flex-shrink: 0;
}

.perfil-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.btn-cambiar-foto {
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--forest-mid);
  border: 2px solid white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  line-height: 1;
  transition: background 0.15s;
  padding: 0;
}
.btn-cambiar-foto:hover:not(:disabled) { background: var(--forest); }
.btn-cambiar-foto:disabled { opacity: 0.6; cursor: default; }

/* Sidebar avatar con foto */
.sidebar-user-avatar-sm img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.perfil-cabecera-info { min-width: 0; }

.perfil-nombre-header {
  font-family: 'Oswald', sans-serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--forest-mid);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.perfil-email-header {
  font-size: 0.83rem;
  color: var(--muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ─── PORTAL: PERFIL (legacy) ─────────────────────────────────────── */
.socio-header {
  background: linear-gradient(135deg, var(--forest) 0%, var(--forest-mid) 100%);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
}

.socio-avatar {
  width: 48px;
  height: 48px;
  background: var(--lima);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #111;
  font-family: 'Oswald', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  margin-right: 1rem;
  flex-shrink: 0;
}

.socio-header .socio-nombre {
  font-family: 'Oswald', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: white;
  text-transform: uppercase;
}

.socio-header .socio-email {
  font-size: 0.83rem;
  color: rgba(255,255,255,0.55);
  margin-top: 1px;
}

.socio-header .btn-cerrar {
  background: rgba(255,255,255,0.1);
  color: white;
  border: 1px solid rgba(255,255,255,0.2);
  padding: 0.45rem 1.1rem;
  font-size: 0.78rem;
  letter-spacing: 1px;
  border-radius: 6px;
  cursor: pointer;
  font-family: 'Oswald', sans-serif;
  text-transform: uppercase;
  transition: background 0.2s;
}

.socio-header .btn-cerrar:hover {
  background: rgba(255,255,255,0.18);
}

.dato-fila {
  display: flex;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--bg-inner);
  font-size: 0.92rem;
}

.dato-fila:last-child { border-bottom: none; }

.dato-label {
  color: var(--muted);
  width: 160px;
  flex-shrink: 0;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding-top: 1px;
}

.dato-valor { font-weight: 500; }

.badge {
  display: inline-block;
  padding: 0.2rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-family: 'Oswald', sans-serif;
}

.badge-activo {
  background: #e8f8ef;
  color: #1a5c35;
  border: 1px solid #b8dfc8;
}

/* ─── FILTROS EVENTOS ─────────────────────────────────────────────── */
.filtros-eventos {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.filtro-btn {
  padding: 0.32rem 0.85rem;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: white;
  color: var(--muted);
  font-family: 'Oswald', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.15s;
}
.filtro-btn:hover { border-color: var(--forest-mid); color: var(--forest-mid); }
.filtro-btn.active {
  background: var(--forest-mid);
  border-color: var(--forest-mid);
  color: white;
}

/* ─── EVENTOS (portal) ────────────────────────────────────────────── */
.evento-card {
  border: 1px solid var(--border);
  border-left: 3px solid var(--lima);
  border-radius: 6px;
  padding: 1rem 1.1rem;
  margin-bottom: 0.85rem;
  background: var(--bg-inner);
}
.evento-card:last-child { margin-bottom: 0; }
.evento-pasado { border-left-color: var(--border); opacity: 0.7; }

.evento-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.evento-tipo {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
}

.evento-fecha { font-size: 0.78rem; color: var(--muted); }

.evento-titulo {
  font-family: 'Oswald', sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--forest-mid);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.3rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.evento-lugar { font-size: 0.83rem; color: var(--muted); margin-bottom: 0.2rem; }
.evento-info  { font-size: 0.8rem;  color: var(--muted); margin-bottom: 0.3rem; }
.evento-desc  { font-size: 0.85rem; color: var(--text); margin: 0.4rem 0; line-height: 1.5; }

.evento-footer {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

.evento-plazas { font-size: 0.78rem; color: var(--muted); flex: 1; }

.evento-link {
  font-size: 0.8rem;
  color: var(--forest-mid);
  text-decoration: none;
  font-weight: 700;
}
.evento-link:hover { text-decoration: underline; }

.evento-estado-label { font-size: 0.78rem; color: var(--muted); font-style: italic; }

.btn-evento {
  border: none;
  border-radius: 6px;
  padding: 0.42rem 1rem;
  font-family: 'Oswald', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-evento:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-inscribir { background: var(--lima); color: #111; }
.btn-inscribir:hover:not(:disabled) { background: var(--lima-hover); }

.btn-cancelar { background: transparent; color: var(--error); border: 1px solid var(--error); }
.btn-cancelar:hover:not(:disabled) { background: #fdf0ef; }

/* ─── PORTAL LAYOUT (sidebar) ────────────────────────────────────── */
.portal-body {
  background: var(--bg);
  overflow: hidden;
  height: 100vh;
}

.portal-loading-screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  background: var(--forest);
  color: rgba(255,255,255,0.7);
  font-size: 0.88rem;
  z-index: 999;
}

.portal-layout {
  display: flex;
  height: 100vh;
}

/* ── Sidebar ────────────────────────────────────────────────────── */
.portal-sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--forest);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 50;
  border-right: 1px solid rgba(255,255,255,0.06);
}

.sidebar-brand {
  padding: 1.4rem 1.2rem 1.1rem;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

.sidebar-brand-title {
  font-family: 'Oswald', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--lima);
  line-height: 1;
}

.sidebar-brand-sub {
  font-size: 0.68rem;
  color: rgba(255,255,255,0.35);
  letter-spacing: 0.5px;
  margin-top: 0.3rem;
  text-transform: uppercase;
}

.sidebar-nav {
  flex: 1;
  padding: 0.75rem 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.62rem 0.85rem;
  border-radius: 6px;
  background: none;
  border: none;
  color: rgba(255,255,255,0.55);
  font-family: 'Lato', sans-serif;
  font-size: 0.9rem;
  font-weight: 400;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, color 0.15s;
}

.nav-item:hover {
  background: rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.85);
}

.nav-item.active {
  background: rgba(200,212,0,0.12);
  color: var(--lima);
  font-weight: 700;
}

.nav-icon { font-size: 1rem; width: 1.2rem; text-align: center; flex-shrink: 0; }
.nav-label { line-height: 1; }

.sidebar-footer {
  padding: 0.85rem 0.9rem;
  border-top: 1px solid rgba(255,255,255,0.07);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.sidebar-user-avatar-sm {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  background: var(--lima);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #111;
  font-family: 'Oswald', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
}

.sidebar-user-info {
  flex: 1;
  min-width: 0;
}

.sidebar-user-name {
  font-size: 0.8rem;
  font-weight: 700;
  color: rgba(255,255,255,0.8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-email {
  font-size: 0.68rem;
  color: rgba(255,255,255,0.35);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-logout {
  background: none;
  border: none;
  color: rgba(255,255,255,0.35);
  cursor: pointer;
  font-size: 1.05rem;
  padding: 0.25rem;
  flex-shrink: 0;
  transition: color 0.15s;
  line-height: 1;
}
.btn-logout:hover { color: rgba(255,255,255,0.75); }

/* ── Main content ───────────────────────────────────────────────── */
.portal-main {
  margin-left: 240px;
  flex: 1;
  height: 100vh;
  padding: 2rem 2.5rem;
  overflow-y: auto;
}

.section-title {
  font-family: 'Oswald', sans-serif;
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--forest-mid);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 1.25rem;
}

/* ─── MISC ────────────────────────────────────────────────────────── */
.info-text {
  font-size: 0.79rem;
  color: #aaa;
  margin-top: 1.5rem;
  text-align: center;
  line-height: 1.6;
}

/* ─── RESPONSIVE ──────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .form-row { grid-template-columns: 1fr; }
  header h1 { font-size: 1.3rem; }
  .container { margin: 1rem auto; }
  .card { padding: 1.5rem; }
  .socio-header { flex-direction: column; gap: 1rem; text-align: center; }
  .dato-label { width: 130px; }

  /* Portal sidebar collapses to bottom bar on mobile */
  .portal-sidebar {
    width: 100%;
    height: auto;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    flex-direction: row;
    border-right: none;
    border-top: 1px solid rgba(255,255,255,0.1);
    z-index: 100;
  }
  .sidebar-brand   { display: none; }
  .sidebar-nav     { flex-direction: row; padding: 0; flex: 1; }
  .nav-item        { flex-direction: column; gap: 0.2rem; padding: 0.6rem 0.5rem; font-size: 0.7rem; flex: 1; justify-content: center; text-align: center; border-radius: 0; }
  .nav-icon        { font-size: 1.2rem; width: auto; }
  .sidebar-footer  { display: none; }
  .portal-main     { margin-left: 0; padding: 1.25rem 1rem; padding-bottom: 5rem; height: calc(100vh - 0px); }
}
