/* ==========================================================================
   Acceso del Portal del Cliente — diseno de la duena.

   OJO: es SOLO el acceso del portal. El ingreso del sistema (panel interno)
   es otra pantalla y usa public/css/auth.css; no se tocan entre si.
   ========================================================================== */

/* Design Tokens */
:root {
  --font-primary: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-secondary: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Color Palette matching design */
  --color-bg-base: #FAF7F2;
  --color-bg-gradient-top: #FAF6F0;
  --color-bg-gradient-bottom: #F5EFE8;

  --color-text-heading: #12100E;
  --color-text-terracotta: #7A524A;
  --color-text-body: #5A4E47;
  --color-text-muted: #7E6D64;
  --color-text-subtle: #846B67;
  --color-text-copyright: #776E69;

  --color-accent-green: #27604A;
  --color-accent-green-hover: #1f4f3c;
  --color-accent-green-light: rgba(39, 96, 74, 0.12);

  --color-card-bg: #FFFFFF;
  --color-card-border: rgba(225, 218, 210, 0.7);
  --color-input-border: #E3DCD5;
  --color-input-icon: #8C7E77;
  --color-input-placeholder: #9B8F89;
  --color-input-text: #1C1816;

  --color-btn-dark: #242220;
  --color-btn-dark-hover: #363230;

  /* Shadows */
  --shadow-card: 0 20px 48px -12px rgba(110, 90, 82, 0.12),
                 0 6px 18px -4px rgba(110, 90, 82, 0.05);
  --shadow-btn: 0 4px 12px rgba(36, 34, 32, 0.15);
  --shadow-btn-hover: 0 6px 16px rgba(36, 34, 32, 0.25);

  /* Transitions */
  --transition-smooth: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Reset & Base Setup */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  height: 100%;
}

body {
  font-family: var(--font-primary);
  background-color: var(--color-bg-base);
  color: var(--color-text-body);
  line-height: 1.5;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

/* Origami Faceted Ambient Background + User Background Layer */
.origami-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  /* El original venia en PNG de 1,4 MB. Es la primera pantalla que carga
     una clienta, muchas veces con datos: va en JPG de 15 KB. Como la
     textura es difusa y ademas se ve al 50%, estirada no se nota. */
  background-image: url('../img/portal-fondo.jpg');
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  opacity: 0.5;
  pointer-events: none;
}

.origami-bg {
  position: fixed;
  inset: 0;
  background-image: url('../img/portal-origami.svg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  pointer-events: none;
  z-index: 0;
}


/* Main Layout Wrapper */
.page-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  padding: 24px 20px 32px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0 16px;
  width: 100%;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.brand-link:hover {
  opacity: 0.9;
}

.brand-logo {
  height: 39px;
  width: auto;
  object-fit: contain;
  display: block;
}

/* "Acceso seguro" Pill Badge */
.security-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px 6px 11px;
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(195, 185, 175, 0.55);
  border-radius: 9999px;
  color: var(--color-text-heading);
  font-family: var(--font-primary);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.01em;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
  user-select: none;
}

.badge-lock-icon {
  color: #2B2522;
  flex-shrink: 0;
}

/* Main Content Area */
.main-content {
  display: flex;
  flex-direction: column;
  width: 100%;
}

/* Hero Section */
.hero-section {
  position: relative;
  width: 100%;
  margin-top: 10px;
  margin-bottom: 8px;
}

.hero-text-block {
  position: relative;
  z-index: 2;
  pointer-events: auto;
  max-width: 84%;
}

.hero-heading {
  font-family: var(--font-primary);
  font-size: 38px;
  font-weight: 800;
  line-height: 1.06;
  letter-spacing: -0.035em;
  color: var(--color-text-heading);
  margin-bottom: 10px;
}

.text-terracotta {
  color: var(--color-text-terracotta);
}

.hero-description {
  font-size: 15px;
  font-weight: 450;
  line-height: 1.35;
  color: var(--color-text-body);
  letter-spacing: -0.01em;
  margin-bottom: 16px;
}

/* Stepper: PEDIDO • PREPARACIÓN • ENVÍO */
.hero-stepper {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--color-text-muted);
  user-select: none;
  margin-bottom: 0;
}

.step-item {
  display: inline-block;
}

.step-separator {
  color: var(--color-text-muted);
  font-size: 12px;
  line-height: 1;
}

/* Hero Postal Graphic */
.hero-illustration-wrapper {
  position: relative;
  width: 100%;
  margin-top: -84px;
  margin-bottom: 2px;
  z-index: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: none;
}

.hero-svg-img {
  width: 100%;
  height: auto;
  max-width: 100%;
  display: block;
  filter: drop-shadow(0 6px 14px rgba(110, 90, 82, 0.05));
  transition: transform 0.4s ease;
}

/* Authentication Card Section */
.auth-section {
  width: 100%;
  position: relative;
  z-index: 3;
}

.auth-card {
  background: var(--color-card-bg);
  border-radius: 26px;
  border: 1px solid var(--color-card-border);
  box-shadow: var(--shadow-card);
  padding: 34px 28px 30px;
  width: 100%;
  position: relative;
  transition: box-shadow 0.3s ease;
}

.card-header {
  margin-bottom: 24px;
}

.card-title {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.025em;
  color: var(--color-text-heading);
  margin-bottom: -3px;
}

.card-subtitle {
  font-size: 15px;
  font-weight: 400;
  color: var(--color-text-subtle);
  letter-spacing: -0.01em;
}

/* Auth Form */
.auth-form {
  display: flex;
  flex-direction: column;
}

.form-group {
  margin-bottom: 18px;
  position: relative;
}

.form-label {
  display: block;
  font-size: 14.5px;
  font-weight: 650;
  color: var(--color-text-heading);
  letter-spacing: -0.01em;
  margin-bottom: 8px;
}

/* Input Container */
.input-container {
  position: relative;
  display: flex;
  align-items: center;
  background: #FFFFFF;
  border: 1.2px solid var(--color-input-border);
  border-radius: 12px;
  height: 48px;
  padding: 0 14px;
  transition: var(--transition-smooth);
}

.input-container:hover {
  border-color: #D0C6BD;
}

.input-container.focused {
  border-color: var(--color-accent-green);
  box-shadow: 0 0 0 3.5px var(--color-accent-green-light);
}

.input-container.has-error {
  border-color: #D32F2F;
  box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.12);
}

.input-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-input-icon);
  margin-right: 12px;
  flex-shrink: 0;
  pointer-events: none;
}

.form-input {
  flex: 1;
  width: 100%;
  height: 100%;
  border: none;
  background: transparent;
  font-family: var(--font-primary);
  /* 16px a proposito: con menos, el iPhone hace zoom al tocar el campo. */
  font-size: 16px;
  color: var(--color-input-text);
  outline: none;
  padding: 0;
}

.form-input::placeholder {
  color: var(--color-input-placeholder);
  font-weight: 400;
  opacity: 1;
}

/* Password Toggle Button */
.password-toggle-btn {
  background: none;
  border: none;
  color: var(--color-input-icon);
  cursor: pointer;
  padding: 6px;
  margin-right: -4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: var(--transition-smooth);
}

.password-toggle-btn:hover {
  color: var(--color-text-heading);
  background-color: rgba(0, 0, 0, 0.04);
}

.password-toggle-btn:focus-visible {
  outline: 2px solid var(--color-accent-green);
  outline-offset: 1px;
}

/* Field Error */
.field-error {
  display: block;
  font-size: 12px;
  color: #D32F2F;
  margin-top: 5px;
  min-height: 16px;
  opacity: 0;
  transform: translateY(-4px);
  transition: var(--transition-smooth);
}

.field-error.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Forgot Password Link */
.forgot-wrapper {
  display: flex;
  justify-content: flex-end;
  margin-top: -8px;
  margin-bottom: 22px;
}

.forgot-link {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--color-text-terracotta);
  text-decoration: underline;
  text-underline-offset: 2.5px;
  letter-spacing: -0.01em;
  transition: var(--transition-smooth);
}

.forgot-link:hover {
  color: #5E3E37;
  text-decoration-thickness: 1.5px;
}

.forgot-link:focus-visible {
  outline: 2px solid var(--color-accent-green);
  outline-offset: 2px;
  border-radius: 3px;
}

/* Submit Button */
.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 50px;
  background-color: var(--color-btn-dark);
  color: #FFFFFF;
  border: none;
  border-radius: 14px;
  font-family: var(--font-primary);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-btn);
  transition: var(--transition-smooth);
  gap: 12px;
}

.btn-primary:hover {
  background-color: var(--color-btn-dark-hover);
  box-shadow: var(--shadow-btn-hover);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(36, 34, 32, 0.15);
}

.btn-primary:focus-visible {
  outline: 2px solid var(--color-accent-green);
  outline-offset: 2px;
}

.btn-arrow {
  color: #FFFFFF;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-primary:hover .btn-arrow {
  transform: translateX(4px);
}

/* Loading State for Button */
.btn-primary.loading {
  pointer-events: none;
  opacity: 0.9;
}

.btn-primary.loading .btn-text,
.btn-primary.loading .btn-arrow {
  opacity: 0;
}

.btn-primary.loading::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  top: 50%;
  left: 50%;
  margin: -10px 0 0 -10px;
  border: 2.5px solid rgba(255, 255, 255, 0.3);
  border-top-color: #FFFFFF;
  border-radius: 50%;
  animation: spinBtn 0.75s infinite linear;
}

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

/* Portal Footer */
.portal-footer {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

/* WhatsApp Button */
.whatsapp-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  transition: var(--transition-smooth);
  padding: 4px 8px;
  border-radius: 8px;
}

.whatsapp-button:hover {
  transform: translateY(-1px);
}

.whatsapp-button:focus-visible {
  outline: 2px solid var(--color-accent-green);
  outline-offset: 2px;
}

.whatsapp-icon-wrapper {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 24px;
  color: var(--color-accent-green);
  line-height: 1;
}

.help-text {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--color-text-terracotta);
  letter-spacing: -0.01em;
}

.help-link-underline {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Copyright Row */
.copyright-row {
  color: var(--color-text-copyright);
  font-size: 13px;
  font-weight: 450;
  letter-spacing: 0.01em;
}

/* Toast Notifications */
.toast-notification {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background-color: var(--color-btn-dark);
  color: #FFFFFF;
  padding: 12px 22px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  opacity: 0;
  pointer-events: none;
  z-index: 999;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  gap: 10px;
}

.toast-notification.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.toast-notification.success {
  border-left: 4px solid var(--color-accent-green);
}

.toast-notification.error {
  border-left: 4px solid #D32F2F;
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */

/* Tablets & Desktop (Two-column layout when screen is wide) */
@media (min-width: 880px) {
  .page-container {
    max-width: 1140px;
    padding: 36px 40px 48px;
    justify-content: flex-start;
  }

  .app-header {
    padding: 0 0 28px;
  }

  /* En el computador el logo se veía muy chico al lado del título. La dueña
     pidió agrandarlo: de 46 a 58 px de alto (≈150 px de ancho, el tamaño que
     marcó en su maqueta). En el teléfono y el tablet queda como estaba. */
  .brand-logo {
    height: 58px;
  }

  .main-content {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 56px;
    align-items: center;
    margin-top: 10px;
  }

  .hero-section {
    margin-top: 0;
    margin-bottom: 0;
  }

  .hero-heading {
    font-size: 46px;
  }

  .hero-description {
    font-size: 17px;
  }

  .hero-stepper {
    font-size: 12.5px;
    margin-bottom: 16px;
  }

  .hero-illustration-wrapper {
    margin-top: 10px;
  }

  .auth-section {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .auth-card {
    max-width: 440px;
    padding: 40px 34px 36px;
  }

  .portal-footer {
    max-width: 440px;
    width: 100%;
    margin-top: 32px;
  }
}

/* Large Screens */
@media (min-width: 1200px) {
  .page-container {
    max-width: 1240px;
    padding: 44px 48px 56px;
  }

  .main-content {
    grid-template-columns: 1.25fr 0.85fr;
    gap: 72px;
  }

  .hero-heading {
    font-size: 52px;
  }

  .hero-description {
    font-size: 18px;
  }
}

/* Small mobile devices (e.g. <= 360px) */
@media (max-width: 360px) {
  .page-container {
    padding: 18px 14px 28px;
  }

  .hero-heading {
    font-size: 33px;
  }

  .auth-card {
    padding: 26px 20px 24px;
    border-radius: 22px;
  }
}

/* ==========================================================================
   Lo que agrega el sistema sobre el diseño
   ========================================================================== */

/* Avisos del servidor: clave mala, sesión caída, clave cambiada. Van dentro
   de la tarjeta, arriba del formulario. */
.form-flash {
  border-radius: 12px;
  padding: 12px 15px;
  margin-bottom: 18px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
}
.form-flash.error   { background: #FDECEA; border: 1px solid #F3C7C1; color: #93332A; }
.form-flash.success { background: #E9F4EE; border: 1px solid #BFE3CE; color: #1F5340; }

/* Texto suelto bajo el formulario (crear clave, pedir ayuda). */
.form-note {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--color-text-subtle);
  text-align: center;
  margin-top: 18px;
}
.form-note a {
  color: var(--color-text-terracotta);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ── El teléfono ──────────────────────────────────────────────────────────
   La fila "PEDIDO • PREPARACIÓN • ENVÍO" va arriba, como en el diseño. En
   pantalla angosta queda al lado del mapa, así que ahí se achica lo justo
   para no tocarlo: medido, no a ojo. */
@media (max-width: 879px) {
  .hero-stepper { font-size: 11px; letter-spacing: 0.075em; gap: 6px; }
}
/* En un teléfono angosto el mapa empieza antes (es un porcentaje del
   ancho), así que la fila de pasos tiene que achicarse otro poco para no
   alcanzarlo. Medido: en 360 px el mapa parte en el 193 y la fila termina
   en el 183. */
@media (max-width: 399px) {
  .hero-stepper { font-size: 9.5px; letter-spacing: 0.05em; gap: 5px; }
}

/* ==========================================================================
   EL TELÉFONO
   ==========================================================================
   Dos quejas seguidas de la dueña: primero "no se alcanza a ver el botón
   Ingresar", y al apretarlo todo, "ahora quedó todo estrecho hacia arriba"
   y sobraba un hueco abajo.

   Las dos salían del mismo error: apretar siempre igual, sin mirar cuánto
   alto tiene el teléfono. Un iPhone 11 sin barras tiene 896 px y un iPhone
   14 con barras 664: con un solo tamaño, o no entra o queda apretado.

   Ahora el tamaño va por ALTURA de pantalla, en tres escalones, y lo que
   sobra se reparte entre la escena y la tarjeta en vez de dejar el hueco
   al final. Así en un teléfono grande se ve aireado como el diseño, y en
   uno chico se compacta solo.

   Si hay que ajustar, se toca UN escalón, no todo.
   ========================================================================== */
@media (max-width: 699px) {

  /* svh = el alto real con las barras del navegador puestas. Con vh a secas
     iOS miente y el botón queda tapado por la barra de abajo. */
  .page-container { min-height: 100vh; min-height: 100svh; }

  /* Lo que sobra se reparte: la escena se separa de la tarjeta en vez de
     quedar todo pegado arriba con un vacío al final. */
  .main-content { flex: 1; justify-content: center; gap: 4px; }

  /* ── Pantalla alta (iPhone sin barras, Android grande): como el diseño ── */
  .page-container  { padding: 16px 20px 16px; }
  .app-header      { padding: 4px 0 14px; }
  .brand-logo      { height: 39px; }
  .hero-section    { margin-top: 0; margin-bottom: 0; }
  .hero-heading    { font-size: 32px; margin-bottom: 8px; }
  .hero-description{ font-size: 15.5px; margin-bottom: 22px; }
  .hero-svg-img    { width: 100%; }
  .hero-illustration-wrapper { margin-top: -16px; margin-bottom: 0; }

  .auth-card    { padding: 24px 20px 20px; border-radius: 24px; }
  .card-header  { margin-bottom: 18px; }
  .card-title   { font-size: 27px; }
  .card-subtitle{ font-size: 15px; }
  .form-group   { margin-bottom: 16px; }
  .form-label   { font-size: 14.5px; margin-bottom: 8px; }
  .input-container { height: 48px; }
  .forgot-wrapper  { margin-bottom: 16px; }
  .btn-primary     { height: 50px; }
  .portal-footer   { margin-top: 18px; gap: 12px; }

  /* El hueco del mensaje de error ocupaba 21 px por campo aunque no hubiera
     ningún error: 42 px de aire invisible. Ahora aparece recién cuando hay
     algo que decir. */
  .field-error         { min-height: 0; margin-top: 0; }
  .field-error.visible { min-height: 16px; margin-top: 4px; }
}

/* ── Pantalla media ───────────────────────────────────────────────────── */
@media (max-width: 699px) and (max-height: 839px) {
  .page-container  { padding: 12px 18px 10px; }
  .app-header      { padding: 2px 0 10px; }
  .brand-logo      { height: 37px; }
  .hero-heading    { font-size: 29px; margin-bottom: 6px; }
  .hero-description{ font-size: 15px; margin-bottom: 19px; }
  .hero-illustration-wrapper { margin-top: -20px; }

  .auth-card    { padding: 17px 18px 14px; }
  .card-header  { margin-bottom: 13px; }
  .card-title   { font-size: 25px; }
  .form-group   { margin-bottom: 11px; }
  .input-container { height: 46px; }
  .forgot-wrapper  { margin-bottom: 13px; }
  .btn-primary     { height: 48px; }
  .portal-footer   { margin-top: 10px; gap: 8px; }
}

/* ── Pantalla baja (los iPhone con las barras del navegador puestas) ──── */
@media (max-width: 699px) and (max-height: 739px) {
  .page-container  { padding: 4px 18px 3px; }
  .hero-illustration-wrapper { margin-top: -48px; }
  .app-header      { padding: 2px 0 8px; }
  .brand-logo      { height: 35px; }
  .hero-heading    { font-size: 26px; margin-bottom: 3px; }
  .hero-description{ font-size: 14.5px; margin-bottom: 15px; }
  .auth-card    { padding: 13px 16px 10px; border-radius: 22px; }
  .card-header  { margin-bottom: 7px; }
  .card-title   { font-size: 24px; }
  .card-subtitle{ font-size: 14px; }
  .form-group   { margin-bottom: 8px; }
  .form-label   { font-size: 14px; margin-bottom: 6px; }
  /* 44 px es el mínimo para que el dedo le pegue bien; no bajar de ahí. */
  .input-container { height: 44px; }
  .forgot-wrapper  { margin-bottom: 9px; }
  .btn-primary     { height: 46px; }
  .portal-footer   { margin-top: 5px; gap: 3px; }
  .help-text       { font-size: 14px; }
  .copyright-row   { font-size: 12px; }
}

/* ── Pantalla muy baja (iPhone SE) ─────────────────────────────────────────
   Con 553 px útiles no entra todo ni apretándolo. Se esconde la fila de
   pasos —es decorativa y repite lo que ya dice la bajada— y se achica la
   escena, para que el botón y el WhatsApp queden a la vista. */
@media (max-width: 699px) and (max-height: 600px) {
  .hero-heading    { font-size: 23px; }
  .hero-description{ font-size: 13px; margin-bottom: 9px; }
  .hero-stepper    { display: none; }
  .hero-svg-img    { width: 82%; }

  .auth-card     { padding: 13px 14px 12px; }
  .card-title    { font-size: 20px; }
  .card-subtitle { font-size: 13px; }
  .form-group    { margin-bottom: 7px; }
  .form-label    { font-size: 13.5px; margin-bottom: 5px; }
  .forgot-wrapper{ margin-bottom: 9px; }
  .portal-footer { margin-top: 6px; }
  .copyright-row { font-size: 11px; }
}

/* ==========================================================================
   EL TABLET (700–879 px)
   ==========================================================================
   Entre el teléfono y las dos columnas no había nada: el tablet heredaba la
   caja de 440 px del teléfono, así que todo quedaba chico al centro y la
   escena —que en el teléfono se monta sobre el texto a propósito— tapaba la
   fila de pasos. "Se ve mal la resolución del tablet, todo muy pequeño, y la
   ilustración quedó corrida".

   Aquí la columna se ensancha, la letra sube al tamaño de escritorio y la
   escena baja a su propio lugar, sin montarse sobre nada.
   ========================================================================== */
@media (min-width: 700px) and (max-width: 879px) {
  .page-container { max-width: 660px; padding: 34px 32px 40px; justify-content: center; }
  .app-header     { padding: 0 0 24px; }
  .brand-logo     { height: 46px; }

  .main-content   { gap: 6px; }
  .hero-section   { margin-top: 0; margin-bottom: 10px; }
  .hero-text-block{ max-width: 100%; }
  .hero-heading   { font-size: 46px; }
  .hero-description { font-size: 17px; margin-bottom: 18px; }
  .hero-stepper   { font-size: 12.5px; letter-spacing: 0.14em; gap: 9px; }

  .hero-illustration-wrapper { margin-top: 0; margin-bottom: 6px; }
  .hero-svg-img   { width: 94%; }

  .auth-card      { padding: 34px 30px 30px; }
  .portal-footer  { margin-top: 26px; }
}

/* Tablet de pantalla más baja (iPad 768×1024 y parecidos): con los tamaños
   de arriba el botón Ingresar quedaba justo pasado el borde. Se recorta la
   escena y los aires, medido, para que entre sin scroll. */
@media (min-width: 700px) and (max-width: 879px) and (max-height: 1060px) {
  .page-container { padding: 24px 30px 28px; }
  .app-header     { padding: 0 0 16px; }
  .hero-heading   { font-size: 40px; }
  .hero-description { font-size: 16px; margin-bottom: 14px; }
  .hero-illustration-wrapper { margin-bottom: 0; }
  .hero-svg-img   { width: 80%; }
  .auth-card      { padding: 28px 26px 24px; }
  .portal-footer  { margin-top: 18px; }
}
