/* ==========================================================================
   CURSO IVÁN CARMONA - HOJA DE ESTILOS PRINCIPAL
   Estilo premium, glassmorphism sutil, color principal #2669BE
   ========================================================================== */

/* ---------- Variables de diseño (colores y espaciados) ---------- */
:root {
  /* Color principal y variantes */
  --color-primary: #2669BE;
  --color-primary-dark: #1d5192;
  --color-primary-light: #3d7fd4;
  --color-primary-alpha: rgba(38, 105, 190, 0.15);
  --color-primary-alpha-strong: rgba(38, 105, 190, 0.25);

  /* Neutros */
  --color-text: #1a1a2e;
  --color-text-muted: #5c5c7a;
  --color-bg: #f0f4f9;
  --color-bg-dark: #0f1419;
  --color-white: #ffffff;

  /* Glassmorphism */
  --glass-bg: rgba(255, 255, 255, 0.75);
  --glass-border: rgba(255, 255, 255, 0.9);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);

  /* Sombras profundas (sensación premium) */
  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-card-hover: 0 12px 40px rgba(38, 105, 190, 0.15), 0 4px 12px rgba(0, 0, 0, 0.06);
  --shadow-button: 0 4px 14px rgba(38, 105, 190, 0.35);
  --shadow-button-hover: 0 6px 20px rgba(38, 105, 190, 0.45);

  /* Espaciados */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;

  /* Bordes y transiciones */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  --transition-fast: 0.2s ease;
  --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Reset y base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-primary-dark);
}

/* ---------- Contenedor de página ---------- */
.page-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page-wrapper--checkout {
  background: linear-gradient(160deg, var(--color-bg) 0%, #e8eef5 100%);
}

/* ==========================================================================
   HERO (Página principal) — con video de fondo tipo banner
   ========================================================================== */
.hero {
  position: relative;
  padding: var(--space-3xl) var(--space-lg) var(--space-2xl);
  text-align: center;
  overflow: hidden;
  min-height: 42vh;
  background: #152a47;
}

/* Contenedor del video: fondo sólido igual al tono del overlay para que al cargar no se vea un “flash” raro */
.hero__video-wrap {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: #152a47;
}

.hero__video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Capa uniforme sobre el video: un solo color y opacidad fija para que no varíe con los frames */
.hero__bg {
  position: absolute;
  inset: 0;
  background: rgba(21, 42, 71, 0.88);
  z-index: 1;
  pointer-events: none;
}

.hero__content {
  position: relative;
  z-index: 2;
  max-width: 640px;
  margin: 0 auto;
}

.hero__brand {
  margin-bottom: var(--space-lg);
}

/* Imagotipo: logo con texto; se muestra en sus colores. Si necesitas versión clara sobre fondo oscuro, usa .hero__logo--light */
.hero__logo {
  margin: 0 auto;
  max-height: 56px;
  width: auto;
  height: auto;
}

.hero__logo--light {
  filter: brightness(0) invert(1);
  opacity: 0.95;
}

.hero__title {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  color: var(--color-white);
  margin-bottom: var(--space-md);
  letter-spacing: -0.02em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.hero__subtitle {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.88);
  font-weight: 500;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.15);
}

/* ==========================================================================
   SECCIÓN DE PAGOS (tarjetas con glassmorphism)
   ========================================================================== */
.payments {
  flex: 1;
  padding: var(--space-2xl) var(--space-lg) var(--space-3xl);
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}

/* Frase de marca debajo del hero */
.payments__tagline {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--color-primary);
  text-align: center;
  margin-bottom: var(--space-md);
  font-style: italic;
}

.payments__heading {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-text);
  text-align: center;
  margin-bottom: var(--space-xl);
}

/* Grid de tarjetas de pago */
.payments__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-xl);
  align-items: stretch;
}

/* Tarjeta individual: glassmorphism sutil */
.payment-card {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  box-shadow: var(--shadow-card);
  transition: transform var(--transition-smooth), box-shadow var(--transition-smooth), border-color var(--transition-smooth);
  display: flex;
  flex-direction: column;
}

.payment-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card-hover);
  border-color: var(--color-primary-alpha-strong);
}

.payment-card__icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  background: var(--color-primary-alpha);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: var(--space-lg);
  transition: background var(--transition-fast), color var(--transition-fast);
}

.payment-card:hover .payment-card__icon {
  background: var(--color-primary);
  color: var(--color-white);
}

.payment-card__title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-sm);
}

.payment-card__desc {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin-bottom: var(--space-lg);
  flex: 1;
}

/* Botón call-to-action (color principal #2669BE) */
.payment-card__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md) var(--space-lg);
  background: var(--color-primary);
  color: var(--color-white) !important;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  box-shadow: var(--shadow-button);
  transition: background var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
  margin-top: auto;
}

.payment-card__cta:hover {
  background: var(--color-primary-dark);
  box-shadow: var(--shadow-button-hover);
  transform: scale(1.02);
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.footer {
  padding: var(--space-xl) var(--space-lg);
  background: var(--color-bg-dark);
  color: rgba(255, 255, 255, 0.8);
}

.footer__content {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}

.footer__copy {
  font-size: 0.875rem;
}

.footer__social {
  display: flex;
  gap: var(--space-md);
}

.footer__link {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.footer__link:hover {
  background: var(--color-primary);
  color: var(--color-white);
}

.footer--compact .footer__content {
  justify-content: center;
  text-align: center;
}

/* ==========================================================================
   CHECKOUT (página checkout-info.html)
   ========================================================================== */
.checkout-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--glass-border);
}

.checkout-header__back {
  font-weight: 500;
  color: var(--color-primary);
}

.checkout-header__back:hover {
  color: var(--color-primary-dark);
}

.checkout-header__logo {
  max-height: 36px;
  width: auto;
}

/* Contenedor del formulario */
.checkout-main {
  flex: 1;
  padding: var(--space-xl) var(--space-lg);
  max-width: 480px;
  margin: 0 auto;
  width: 100%;
}

.checkout-intro {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.checkout-intro__title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-sm);
}

.checkout-intro__text {
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

/* Formulario */
.checkout-form {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  box-shadow: var(--shadow-card);
  margin-bottom: var(--space-xl);
}

.form-group {
  margin-bottom: var(--space-lg);
}

.form-group__label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-xs);
}

.form-group__input {
  width: 100%;
  padding: var(--space-md) var(--space-lg);
  font-family: inherit;
  font-size: 1rem;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: var(--radius-md);
  background: var(--color-white);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-group__input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-alpha);
}

.form-group__input::placeholder {
  color: var(--color-text-muted);
  opacity: 0.7;
}

.form-group__input.error {
  border-color: #c53030;
}

.form-group__error {
  display: block;
  font-size: 0.8rem;
  color: #c53030;
  margin-top: var(--space-xs);
  min-height: 1.2em;
}

.checkout-form__submit {
  width: 100%;
  padding: var(--space-lg);
  background: var(--color-primary);
  color: var(--color-white);
  font-family: inherit;
  font-weight: 600;
  font-size: 1rem;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  box-shadow: var(--shadow-button);
  transition: background var(--transition-fast), box-shadow var(--transition-fast);
  margin-top: var(--space-md);
}

.checkout-form__submit:hover:not(:disabled) {
  background: var(--color-primary-dark);
  box-shadow: var(--shadow-button-hover);
}

.checkout-form__submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.submit-loading {
  display: none;
}

.checkout-form__submit.is-loading .submit-text {
  display: none;
}

.checkout-form__submit.is-loading .submit-loading {
  display: inline;
}

/* Mensaje de éxito */
.success-message {
  text-align: center;
  padding: var(--space-xl);
}

.success-message__box {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
  box-shadow: var(--shadow-card);
}

.success-message__icon {
  font-size: 3rem;
  color: #2f855a;
  margin-bottom: var(--space-lg);
}

.success-message__title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-md);
}

.success-message__text {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* ==========================================================================
   PÁGINAS DE RESULTADO (success.html / failure.html)
   ========================================================================== */
.result-main {
  flex: 1;
  padding: var(--space-2xl) var(--space-lg);
  max-width: 480px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.result-box {
  text-align: center;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
  box-shadow: var(--shadow-card);
  width: 100%;
}

.result-box__icon {
  font-size: 3.5rem;
  margin-bottom: var(--space-lg);
}

.result-box__icon--success {
  color: #2f855a;
}

.result-box__icon--failure {
  color: #c53030;
}

/* 404: código grande y icono neutro */
.result-box__code {
  font-size: 4rem;
  font-weight: 700;
  color: var(--color-text-muted);
  line-height: 1;
  margin-bottom: var(--space-sm);
}

.result-box__icon--404 {
  color: var(--color-text-muted);
  font-size: 2.5rem;
  margin-bottom: var(--space-md);
}

.result-box__title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-md);
}

.result-box__text {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: var(--space-xl);
}

.result-box__cta {
  display: inline-block;
  padding: var(--space-md) var(--space-xl);
  background: var(--color-primary);
  color: var(--color-white) !important;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-button);
  transition: background var(--transition-fast), box-shadow var(--transition-fast);
}

.result-box__cta:hover {
  background: var(--color-primary-dark);
  box-shadow: var(--shadow-button-hover);
}

/* ==========================================================================
   UTILIDADES Y RESPONSIVE
   ========================================================================== */
@media (max-width: 640px) {
  .hero {
    padding: var(--space-2xl) var(--space-md);
  }

  .payments__grid {
    grid-template-columns: 1fr;
  }

  .footer__content {
    flex-direction: column;
    text-align: center;
  }
}
