/* =========================================================
   PORTAL DEL SOCIO — Login PWA (una sola columna)
   ========================================================= */

:root {
  --sl-primary: #1a2b4a;
  --sl-primary-light: #2d4a7c;
  --sl-accent: #ff6b35;
  --sl-accent-soft: #ff8a5c;
  --sl-success: #10b981;
  --sl-text: #1e293b;
  --sl-muted: #64748b;
  --sl-border: #e2e8f0;
  --sl-bg: #f4f6fb;
  --sl-card: #ffffff;
  --sl-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--sl-font);
  background: var(--sl-bg);
  color: var(--sl-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100%;
  font-size: 16px;
}

body.sl-body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.sl-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

/* =========================================================
   PANEL ÚNICO — FORMULARIO
   ========================================================= */
.sl-form-panel {
  flex: 1;
  padding: 32px 20px 40px;
  padding-top: calc(32px + env(safe-area-inset-top, 0px));
  padding-bottom: calc(40px + env(safe-area-inset-bottom, 0px));
  display: flex;
  justify-content: center;
  align-items: flex-start;
  background: var(--sl-bg);
}

.sl-form-wrapper {
  width: 100%;
  max-width: 420px;
  background: var(--sl-card);
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(15, 23, 42, .08);
  padding: 26px 22px 28px;
}

/* Branding del gym (logo + nombre + subtítulo) */
.sl-gym-brand {
  text-align: center;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--sl-border);
}

.sl-gym-logo {
  max-height: 72px;
  max-width: 200px;
  width: auto;
  display: block;
  margin: 0 auto 10px;
  object-fit: contain;
}

.sl-gym-logo-fallback {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1a2b4a, #2d4a7c);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 800;
  margin: 0 auto 10px;
  box-shadow: 0 6px 20px rgba(26, 43, 74, .25);
}

.sl-gym-name {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--sl-primary);
  letter-spacing: -.4px;
  margin: 0 0 4px;
  line-height: 1.2;
}

.sl-gym-sub {
  font-size: .82rem;
  color: var(--sl-muted);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: .5px;
  font-weight: 600;
}

.sl-form-header { margin-bottom: 24px; text-align: left; }

.sl-form-header .sl-form-tag {
  display: inline-block;
  padding: 4px 10px;
  background: rgba(255, 107, 53, .08);
  color: var(--sl-accent);
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-radius: 20px;
  margin-bottom: 10px;
}

.sl-form-header h1, .sl-form-header h2 {
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--sl-primary);
  margin: 0 0 8px;
  letter-spacing: -.5px;
}

.sl-form-header p {
  color: var(--sl-muted);
  font-size: .9rem;
  margin: 0;
  line-height: 1.5;
}

.sl-group { margin-bottom: 18px; }

.sl-label {
  display: block;
  font-size: .82rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 6px;
}

.sl-input-wrap { position: relative; }

.sl-input {
  width: 100%;
  padding: 14px 46px 14px 44px;
  border: 1.5px solid var(--sl-border);
  border-radius: 12px;
  font-size: .95rem;
  font-family: inherit;
  color: var(--sl-text);
  background: #f8fafc;
  transition: all .2s;
  min-height: 52px;
}

.sl-input:focus {
  outline: none;
  border-color: var(--sl-accent);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(255, 107, 53, .1);
}

.sl-input::placeholder { color: #94a3b8; }

.sl-input-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: .95rem;
  pointer-events: none;
  transition: color .2s;
}

.sl-input-wrap:focus-within .sl-input-icon { color: var(--sl-accent); }

.sl-toggle-pass {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 8px;
  font-size: .95rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color .15s, background .15s;
  min-width: 40px;
  min-height: 40px;
}

.sl-toggle-pass:hover { color: var(--sl-primary); background: rgba(148, 163, 184, .1); }

.sl-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px 20px;
  border: none;
  border-radius: 12px;
  font-size: .95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all .2s;
  text-decoration: none;
  margin-top: 6px;
  min-height: 52px;
}

.sl-btn-primary {
  background: linear-gradient(135deg, #ff6b35, #ff8a5c);
  color: #fff;
  box-shadow: 0 8px 24px rgba(255, 107, 53, .3);
}

.sl-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 32px rgba(255, 107, 53, .4);
  color: #fff;
}

.sl-btn-primary:active { transform: translateY(0); }
.sl-btn-primary:disabled { opacity: .7; cursor: not-allowed; transform: none; }

.sl-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 24px 0 18px;
  color: #94a3b8;
  font-size: .8rem;
}

.sl-divider::before,
.sl-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--sl-border);
}

.sl-btn-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 13px 20px;
  border: 1.5px solid var(--sl-border);
  border-radius: 12px;
  background: #fff;
  color: var(--sl-primary);
  font-size: .92rem;
  font-weight: 600;
  text-decoration: none;
  transition: all .2s;
  min-height: 52px;
}

.sl-btn-secondary:hover,
.sl-btn-secondary:active {
  border-color: var(--sl-primary);
  background: #f8fafc;
  color: var(--sl-primary);
  transform: translateY(-1px);
}

.sl-btn-secondary i { color: var(--sl-accent); }

.sl-form-footer {
  margin-top: 24px;
  text-align: center;
  font-size: .8rem;
  color: var(--sl-muted);
}

.sl-form-footer a {
  color: var(--sl-accent);
  font-weight: 600;
  text-decoration: none;
}

.sl-form-footer a:hover { text-decoration: underline; }

.sl-alert {
  padding: 12px 16px;
  border-radius: 12px;
  font-size: .88rem;
  margin-bottom: 18px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  line-height: 1.45;
}

.sl-alert i { font-size: 1rem; margin-top: 2px; flex-shrink: 0; }
.sl-alert-error { background: #fee2e2; color: #991b1b; }
.sl-alert-success { background: #d1fae5; color: #065f46; }
.sl-alert-info { background: #dbeafe; color: #1e40af; }
.sl-alert-warning { background: #fef3c7; color: #92400e; }

.sl-help {
  font-size: .78rem;
  color: var(--sl-muted);
  margin-top: 6px;
  display: flex;
  align-items: flex-start;
  gap: 6px;
  line-height: 1.45;
}
.sl-help i { color: #94a3b8; margin-top: 2px; flex-shrink: 0; }

.sl-secure {
  margin-top: 20px;
  text-align: center;
  font-size: .78rem;
  color: #94a3b8;
}
.sl-secure i { color: var(--sl-success); margin-right: 4px; }

/* =========================================================
   DESKTOP — solo centrar el card, nada más
   ========================================================= */
@media (min-width: 768px) {
  body.sl-body {
    background: linear-gradient(150deg, #0f172a 0%, #1a2b4a 45%, #2d4a7c 100%);
    padding: 40px 20px;
    align-items: center;
    justify-content: center;
  }

  .sl-wrapper {
    min-height: auto;
    width: 100%;
    max-width: 420px;
  }

  .sl-form-panel {
    background: transparent;
    padding: 0;
    align-items: center;
  }

  .sl-form-wrapper {
    margin: 0;
  }
}