/* FBR Web Theme
   Shared visual language aligned with the mobile app:
   - premium sport dashboard look
   - high contrast and readable typography
   - consistent palette and card system
*/

:root {
  --fbr-bg: #08182d;
  --fbr-bg-soft: #0f2743;
  --fbr-surface: #f6fbff;
  --fbr-surface-soft: #eef5ff;
  --fbr-border: #c9d9ee;
  --fbr-text: #17355a;
  --fbr-text-soft: #4e6484;
  --fbr-accent: #e4572e;
  --fbr-accent-soft: #f47f52;
  --fbr-accent-strong: #d64720;
  --fbr-brand-blue: #2d8ee6;
  --fbr-focus: rgba(45, 142, 230, 0.24);
  --fbr-success: #2fbf71;
  --fbr-shadow: 0 14px 28px rgba(18, 47, 78, 0.14);
}

html,
body {
  font-family: "Manrope", "Segoe UI", sans-serif;
}

body {
  color: var(--fbr-text);
  line-height: 1.5;
}

/* Ambient depth layer (kept subtle to preserve readability). */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(circle at 9% -6%, rgba(45, 142, 230, 0.24), transparent 38%),
    radial-gradient(circle at 95% -4%, rgba(228, 87, 46, 0.2), transparent 36%),
    linear-gradient(180deg, rgba(8, 24, 45, 0.22), rgba(8, 24, 45, 0.44));
}

/* Shared elevated surfaces. */
.top-card,
.card,
.tcard,
.final-hero,
.steps,
.formulario,
.loader-card,
.coach-login-card,
.recu-card {
  border: 1px solid var(--fbr-border) !important;
  border-radius: 18px !important;
  box-shadow: var(--fbr-shadow) !important;
}

.top-card,
.card,
.tcard,
.final-hero,
.steps,
.formulario,
.loader-card,
.recu-card {
  background:
    radial-gradient(circle at 94% 4%, rgba(106, 213, 233, 0.16), transparent 44%),
    linear-gradient(160deg, var(--fbr-surface) 0%, var(--fbr-surface-soft) 100%) !important;
}

.coach-login-card {
  background:
    radial-gradient(circle at 94% 4%, rgba(106, 213, 233, 0.12), transparent 40%),
    linear-gradient(165deg, #f5faff 0%, #e9f2ff 100%) !important;
}

.coach-login-card,
.coach-login-card h1,
.coach-login-intro,
.coach-login-form label,
.coach-login-message,
.coach-login-kicker {
  color: #17355a !important;
}

.coach-login-back {
  color: #204b79 !important;
}

/* Header bars in same family as app top surfaces. */
.header-fbr,
.header {
  border: 1px solid rgba(201, 217, 238, 0.88);
  border-radius: 18px;
  background:
    radial-gradient(circle at 92% -90%, rgba(255, 255, 255, 0.95), rgba(241, 248, 255, 0.9)),
    linear-gradient(165deg, rgba(245, 251, 255, 0.88), rgba(233, 243, 255, 0.84));
  box-shadow: 0 12px 26px rgba(18, 47, 78, 0.16);
  backdrop-filter: blur(10px);
}

.topbar {
  border: 1px solid rgba(201, 217, 238, 0.88);
  border-radius: 18px;
  background:
    radial-gradient(circle at 92% -90%, rgba(255, 255, 255, 0.95), rgba(241, 248, 255, 0.9)),
    linear-gradient(165deg, rgba(245, 251, 255, 0.9), rgba(233, 243, 255, 0.86));
  box-shadow: 0 12px 26px rgba(18, 47, 78, 0.16);
  backdrop-filter: blur(10px);
}

.header-fbr h1,
.welcome__title--header {
  color: #204b79 !important;
  letter-spacing: 0.03em;
}

.header-fbr h1 span,
.welcome__title span {
  color: var(--fbr-accent) !important;
}

.header nav a,
.topbar nav a {
  color: #1d466f !important;
  font-weight: 700;
}

.header nav a:hover,
.topbar nav a:hover {
  color: #123453 !important;
}

.app-link {
  color: #f6fbff !important;
}

/* Primary controls and CTA. */
.about-toggle,
.menu-toggle,
.enviar-container button,
.coach-login-form button,
.recu-form .btn {
  border-radius: 999px !important;
  border: 1px solid rgba(28, 104, 180, 0.42) !important;
  background: linear-gradient(160deg, #2d8ee6 0%, #2b79c5 100%) !important;
  color: #f6fbff !important;
  box-shadow: 0 10px 18px rgba(30, 104, 171, 0.24) !important;
  transition: transform 160ms ease, box-shadow 180ms ease, filter 180ms ease;
}

.about-toggle:hover,
.menu-toggle:hover,
.enviar-container button:hover,
.coach-login-form button:hover,
.recu-form .btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 22px rgba(30, 104, 171, 0.32) !important;
  filter: saturate(1.04);
}

.card .cta,
.top-card__cta {
  color: #1e4a79 !important;
  font-weight: 800;
}

.welcome__text,
.top-card__text,
.card__body p,
.final-hero__subtitle,
.tcard__role,
.tcard__quote,
.tcard__text,
.auth-head p,
.form-help,
.codes-hint,
.note {
  color: #2a4d76 !important;
  opacity: 1 !important;
}

.first50-counter {
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(191, 214, 236, 0.88);
  border-radius: 12px;
  padding: 0.4rem 0.65rem;
  color: #1e4a79 !important;
  font-weight: 800;
}

/* Inputs with clean, high contrast app style. */
input,
select,
textarea {
  border: 1px solid #c6d9ee !important;
  border-radius: 12px !important;
  background: linear-gradient(160deg, #ffffff 0%, #f2f8ff 100%) !important;
  color: #183a61 !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

input:focus,
select:focus,
textarea:focus {
  border-color: #7fa9d7 !important;
  box-shadow: 0 0 0 3px rgba(45, 142, 230, 0.2) !important;
  outline: none;
}

/* Pills and tags, aligned with app chip language. */
.chip,
.card__badge,
.top-card__badge,
.tcard__badge,
.badge-premium-pro {
  border: 1px solid #bfd6ec !important;
  background: linear-gradient(160deg, rgba(244, 251, 255, 0.97), rgba(232, 244, 255, 0.95)) !important;
  color: #225486 !important;
}

.price-tag .new,
.free,
.first50-counter {
  color: var(--fbr-accent) !important;
}

/* Panels / dropdowns with stronger contrast and cleaner depth. */
.about-panel,
.menu-panel {
  border: 1px solid var(--fbr-border) !important;
  border-radius: 18px !important;
  box-shadow: 0 16px 36px rgba(18, 47, 78, 0.22) !important;
}

.about-panel {
  background: linear-gradient(165deg, #f8fbff 0%, #eef5ff 100%) !important;
}

.menu-panel {
  background: linear-gradient(165deg, #142741 0%, #1c3352 100%) !important;
}

.menu-link {
  color: #eaf2ff !important;
}

.menu-link:hover {
  color: #ffd9ca !important;
}

/* Motion: gentle reveal for premium feel. */
.welcome__grid .card,
.testimonials .tcard,
.top-card,
.formulario,
.coach-login-card {
  animation: fbrFadeInUp 420ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.welcome__grid .card:nth-child(2) { animation-delay: 45ms; }
.welcome__grid .card:nth-child(3) { animation-delay: 90ms; }
.welcome__grid .card:nth-child(4) { animation-delay: 135ms; }

@keyframes fbrFadeInUp {
  0% {
    opacity: 0;
    transform: translateY(10px) scale(0.992);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Shared polish for form-centric pages (index/nivel/dias/test). */
.form-grid,
.nivel-container,
.progress-wrapper,
.dias {
  position: relative;
  z-index: 1;
}

.formulario,
.dias,
.nivel-card,
.steps,
.progress-wrapper .progress-bar {
  border-color: rgba(201, 217, 238, 0.92) !important;
}

.formulario h2,
.dias h2,
.nivel-card h2,
.welcome h1,
.method h2,
.innovation h2,
.plans h2,
.athletes h2,
.coach h2 {
  font-family: "Archivo", "Manrope", "Segoe UI", sans-serif !important;
  color: #173e66 !important;
  letter-spacing: 0.01em;
}

.formulario {
  width: min(760px, 94vw) !important;
  gap: 16px !important;
  padding: 28px 26px !important;
}

.formulario p,
.formulario .marca-hint,
.dias .campo-help,
.dias .aviso-marca {
  color: #36567b !important;
}

.informacion label,
.campo label {
  color: #173e66 !important;
  font-weight: 700 !important;
}

.informacion input,
.informacion select,
.campo input,
.campo select {
  min-height: 46px;
}

.informacion input::placeholder,
.campo input::placeholder {
  color: #6b85a8 !important;
}

.steps__bar,
.progress-wrapper .progress-bar {
  background: rgba(33, 79, 126, 0.14) !important;
}

.steps__bar-fill,
.progress-wrapper .progress-fill {
  background: linear-gradient(90deg, var(--fbr-brand-blue), var(--fbr-accent)) !important;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.44), 0 4px 14px rgba(45, 142, 230, 0.3) !important;
}

.steps__stage,
.progress-info span {
  color: #174a79 !important;
}

.steps__label,
.progress-info p {
  color: #4a6383 !important;
}

.enviar-container button,
.dias .enviar-container button,
.formulario button[type="submit"] {
  min-height: 52px;
  font-weight: 800 !important;
  letter-spacing: 0.04em;
}

.enviar-container button:active,
.dias .enviar-container button:active,
.formulario button[type="submit"]:active {
  transform: translateY(0);
  filter: saturate(1.08);
}

.enviar-container button.is-submitting,
.formulario button[type="submit"].is-submitting {
  cursor: wait;
  opacity: 0.86;
  filter: saturate(0.88);
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible,
a:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--fbr-focus) !important;
}

/* Harmonize landing cards and sections to keep brand continuity with app palette. */
.method-grid article,
.innovation-grid article,
.plan,
.chart-card,
.coach,
.login {
  border-color: rgba(201, 217, 238, 0.9) !important;
  box-shadow: 0 10px 24px rgba(19, 50, 82, 0.12) !important;
}

.plan.featured {
  background: linear-gradient(145deg, #17385b 0%, #1f507f 100%) !important;
}

.plan.featured h3,
.plan.featured p,
.plan.featured .tag {
  color: #f3f8ff !important;
}

.app-link,
.btn.primary {
  background: linear-gradient(160deg, var(--fbr-accent), var(--fbr-accent-strong)) !important;
  color: #ffffff !important;
  border: 1px solid rgba(212, 71, 32, 0.34) !important;
  box-shadow: 0 10px 20px rgba(228, 87, 46, 0.28) !important;
}

.app-link:hover,
.btn.primary:hover {
  filter: brightness(1.05);
}

/* Form microinteractions and validation feedback (shared for web storefront forms). */
.formulario input,
.formulario select,
.formulario textarea,
.dias-form input,
.dias-form select,
.dias-form textarea {
  transition: border-color 160ms ease, box-shadow 180ms ease, background-color 180ms ease;
}

.formulario input[data-touched="1"]:invalid,
.formulario select[data-touched="1"]:invalid,
.formulario textarea[data-touched="1"]:invalid,
.dias-form input[data-touched="1"]:invalid,
.dias-form select[data-touched="1"]:invalid,
.dias-form textarea[data-touched="1"]:invalid {
  border-color: #d94f3d !important;
  box-shadow: 0 0 0 3px rgba(217, 79, 61, 0.16) !important;
  background: linear-gradient(160deg, #fffafa 0%, #fff1ef 100%) !important;
}

.formulario [required][data-touched="1"]:valid,
.dias-form [required][data-touched="1"]:valid {
  border-color: #2fbf71 !important;
  box-shadow: 0 0 0 3px rgba(47, 191, 113, 0.13) !important;
  background: linear-gradient(160deg, #fbfffd 0%, #edf9f2 100%) !important;
}

.field-status {
  display: block;
  margin-top: 5px;
  min-height: 1.1em;
  font-size: 0.83rem;
  line-height: 1.3;
  color: #557196;
}

.field-status.is-error {
  color: #b03f32;
  font-weight: 600;
}

.field-status.is-valid {
  color: #1f8e57;
  font-weight: 600;
}

/* Landing polish for stronger visual rhythm while preserving current structure. */
.topbar {
  position: sticky;
  top: 10px;
}

.topbar nav a {
  position: relative;
}

.topbar nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -5px;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--fbr-brand-blue), var(--fbr-accent));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 180ms ease;
}

.topbar nav a:hover::after,
.topbar nav a:focus-visible::after {
  transform: scaleX(1);
}

.welcome-copy {
  position: relative;
}

.welcome-copy::before {
  content: "FBR PERFORMANCE";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  font-weight: 800;
  color: #225486;
  background: linear-gradient(160deg, rgba(246, 251, 255, 0.95), rgba(232, 244, 255, 0.95));
  border: 1px solid rgba(191, 214, 236, 0.95);
}

.gallery-stage {
  border: 1px solid rgba(201, 217, 238, 0.85) !important;
  box-shadow: 0 20px 48px rgba(18, 47, 78, 0.2), 0 8px 18px rgba(20, 56, 90, 0.12) !important;
}

.method h2,
.innovation h2,
.plans h2,
.athletes h2,
.coach h2 {
  position: relative;
  padding-bottom: 8px;
}

.method h2::after,
.innovation h2::after,
.plans h2::after,
.athletes h2::after,
.coach h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 72px;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--fbr-brand-blue), var(--fbr-accent));
}

.coach {
  position: relative;
  overflow: hidden;
}

.coach::before {
  content: "";
  position: absolute;
  inset: -22% 50% auto -14%;
  height: 220px;
  background: radial-gradient(circle, rgba(45, 142, 230, 0.16), transparent 70%);
  pointer-events: none;
}

.coach-copy,
.coach-media {
  position: relative;
  z-index: 1;
}

@media (prefers-reduced-motion: reduce) {
  .welcome__grid .card,
  .testimonials .tcard,
  .top-card,
  .formulario,
  .coach-login-card {
    animation: none !important;
  }

  .about-toggle,
  .menu-toggle,
  .enviar-container button,
  .coach-login-form button,
  .recu-form .btn,
  .app-link,
  .btn.primary,
  .topbar nav a::after {
    transition: none !important;
  }
}

/* Mobile readability and touch comfort. */
@media (max-width: 768px) {
  .top-card,
  .card,
  .tcard,
  .formulario,
  .loader-card,
  .recu-card,
  .coach-login-card {
    border-radius: 16px !important;
  }

  .about-toggle,
  .menu-toggle,
  .enviar-container button,
  .coach-login-form button,
  .recu-form .btn {
    min-height: 44px;
  }

  .formulario {
    padding: 22px 18px !important;
  }

  .informacion {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }
}
