/* ===================================================================
   PORTAL DE ACCESO | COPIRICOH & CALCA 2
   Estructura grid:
     ┌───────────────────────────┐
     │        Bienvenido         │  ← fila 1 (ancho completo)
     ├─────────────┬─────────────┤
     │  Copiricoh  │   Calca 2   │  ← fila 2 (50% / 50%, sin separación)
     └─────────────┴─────────────┘
   =================================================================== */

:root {
  --font: 'Barlow', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --text: #111111;
  --text-soft: #333333;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html, body {
  height: 100%;
}

/* ===================================================================
   FONDO GENERAL (compartido por index.html y login.html)
   Para usar tu imagen: coloca el archivo en /assets y descomenta
   las líneas de background-image de abajo, cambiando el nombre.
   =================================================================== */
body {
  font-family: var(--font);
  color: var(--text);
  background-color: #ffffff;
  /* background-image: url('assets/fondo.jpg'); */
  /* background-size: cover; */
  /* background-position: center; */
  /* background-repeat: no-repeat; */
  /* background-attachment: fixed; */
  -webkit-font-smoothing: antialiased;
}

/* ===================================================================
   GRID PRINCIPAL
   =================================================================== */
.portal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  /* Mitad superior: bienvenida (1fr) + títulos (auto) = 50vh
     Mitad inferior: tarjetas = 50vh */
  grid-template-rows: 1fr auto 50vh;
  grid-template-areas:
    "header  header"
    "title-l title-r"
    "card-l  card-r";
  height: 100vh;
  height: 100dvh;
}

/* ---------- Fila 1: Encabezado ---------- */
.grid-header {
  grid-area: header;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.welcome {
  text-align: center;
}

.welcome-title {
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.01em;
}

.welcome-subtitle {
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  font-weight: 500;
  color: var(--text-soft);
  margin-top: 0.3rem;
}

/* Botón de usuario (esquina superior) */
.user-btn {
  position: absolute;
  top: 22px;
  right: 24px;
  width: 34px;
  height: 34px;
  display: block;
  border-radius: 50%;
  transition: opacity 0.2s ease;
}

.user-btn svg {
  width: 100%;
  height: 100%;
  display: block;
}

.user-btn:hover {
  opacity: 0.8;
}

/* ---------- Fila 2: Áreas ----------
   "display: contents" deja que el título y la tarjeta de cada
   sección se coloquen directamente en el grid principal. */
.area { display: contents; }

#area-copiricoh .area-title { grid-area: title-l; }
#area-calca2    .area-title { grid-area: title-r; }
#area-copiricoh .area-card  { grid-area: card-l; }
#area-calca2    .area-card  { grid-area: card-r; }

.area-title {
  font-size: clamp(1rem, 1.5vw, 1.2rem);
  font-weight: 400;
  color: var(--text-soft);
  text-align: center;
  padding-bottom: 0.9rem;
}

/* Tarjeta: ocupa el 100% de su celda, sin bordes ni separación */
.area-card {
  position: relative;
  min-height: 0;
  overflow: hidden;          /* el crecimiento queda dentro de la tarjeta */
  cursor: pointer;
  background-color: #f7f7f7;
}

/* Imagen de fondo de cada área */
.area-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.55;
  transition: transform 0.8s var(--ease);
}

.bg-copier   { background-image: url('assets/bg-copier.jpg'); }
.bg-printing { background-image: url('assets/bg-printing.jpg'); }

/* Contenido: logo + botón */
.area-content {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.3rem;
  padding: 2rem 1.5rem;
}

.area-logo {
  width: auto;
  max-width: 80%;
  object-fit: contain;
  transition: transform 0.6s var(--ease);
}

.logo-copiricoh { max-height: 95px; }
.logo-calca2    { max-height: 85px; }

/* Hover: el contenido crece DENTRO de la tarjeta (la tarjeta no se mueve) */
.area-card:hover .area-bg   { transform: scale(1.08); }
.area-card:hover .area-logo { transform: scale(1.06); }

/* Botón Acceder */
.btn-acceder {
  display: inline-block;
  background: #ffffff;
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  padding: 0.55rem 1.4rem;
  border-radius: 2px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
  transition: background-color 0.2s ease, color 0.2s ease;
}

.btn-acceder:hover {
  background: #111111;
  color: #ffffff;
}

/* ===================================================================
   MÓVIL: encabezado arriba y las dos áreas 50% / 50% en vertical
   =================================================================== */
@media (max-width: 768px) {
  .portal-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr 1fr;
    grid-template-areas:
      "header"
      "card-l"
      "card-r";
  }

  .grid-header {
    padding: 3.2rem 1rem 1.6rem;
  }

  .user-btn {
    top: 14px;
    right: 16px;
  }

  /* En móvil se ocultan los títulos para que las tarjetas queden juntas */
  .area-title {
    display: none;
  }

  .area-content {
    gap: 0.9rem;
    padding: 1rem;
  }

  .logo-copiricoh { max-height: 60px; }
  .logo-calca2    { max-height: 55px; }
}

/* ===================================================================
   BOTÓN DESTACADO PORTAL DE FACTURACIÓN
   =================================================================== */
.btn-portal-facturacion {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 28px;
  background: #E11D48;
  color: #ffffff !important;
  border: none;
  border-radius: 999px;
  font-size: 0.98rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(225, 29, 72, 0.45);
  transition: all 0.25s var(--ease);
  cursor: pointer;
}

.btn-portal-facturacion:hover {
  background: #BE123C;
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 6px 22px rgba(225, 29, 72, 0.6);
  color: #ffffff !important;
}

.btn-portal-facturacion:active {
  transform: translateY(0) scale(0.98);
}
