/* =========================================================
   Base (Mobile First) - Look app nativa
   ========================================================= */

:root{
    --bg: #000000;
    --card: #097237;
    --btn: #0b3d1f;
    --btnHover: #062713;
    --text: #ffffff;
    --error: #ffcccc;
    --success: #d4ffd4;
}

html, body {
    height: 100%;
}

body {
    margin: 0;
    padding: 0;
    font-family: Arial, Helvetica, sans-serif;

    background-color: var(--bg);

    /* Mejor altura real en mobile */
    min-height: 100vh;
    min-height: 100dvh;

    /* Centrado tipo app */
    display: flex;
    align-items: center;
    justify-content: center;

    /* Evita que el contenido toque bordes en móviles con notch */
    padding: env(safe-area-inset-top) env(safe-area-inset-right)
             env(safe-area-inset-bottom) env(safe-area-inset-left);
}

/* =========================================================
   Caja principal (formulario) - Mobile por defecto
   ========================================================= */

.container {
    /* Más “pantalla” (app) */
    width: calc(100% - 24px);
    margin: 12px;
    padding: 28px 22px;

    background-color: var(--card);

    border-radius: 16px;

    /* Sombra más “soft” (menos caja flotante) */
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.45);

    text-align: center;

    /* Ayuda a que el contenido se vea centrado verticalmente cuando hay espacio */
    display: flex;
    flex-direction: column;
    justify-content: center;

    /* Sensación de “pantalla” */
    min-height: 72dvh;
}

/* =========================================================
   Logo / títulos
   ========================================================= */

.logo img {
    max-width: 190px;
    margin: 0 auto 18px auto;
    display: block;
}

h1 {
    margin: 0 0 22px 0;
    font-size: 22px;
    line-height: 1.2;
    color: var(--text);
}

/* =========================================================
   Formulario
   ========================================================= */

.formulario {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: stretch; /* full-width */
    gap: 14px;            /* espaciado tipo app */
}

.grupo-campo {
    width: 100%;
    display: flex;
    flex-direction: column;
    margin: 0;
}

.grupo-campo label {
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    text-align: left;
    opacity: 0.95;
}

.formulario .campo {
    width: 100%;
    box-sizing: border-box;

    /* App-like / táctil */
    font-size: 16px;      /* evita zoom iOS */
    padding: 14px 14px;

    border: none;
    border-radius: 12px;
    outline: none;

    /* Micro estética tipo app */
    background: rgba(255, 255, 255, 0.95);
}

.formulario .campo:focus {
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.18);
}

/* =========================================================
   Botón
   ========================================================= */

.formulario .btn-validar {
    width: 100%;
    box-sizing: border-box;

    /* CTA tipo app */
    font-size: 17px;
    font-weight: 800;
    padding: 16px 14px;

    background-color: var(--btn);
    color: var(--text);

    border: none;
    border-radius: 14px;
    cursor: pointer;

    /* sensación “botón app” */
    box-shadow: 0 8px 18px rgba(0,0,0,0.25);
}

.formulario .btn-validar:hover {
    background-color: var(--btnHover);
}

/* =========================================================
   Estados
   ========================================================= */

.error {
    color: var(--error);
    margin-top: 10px;
    font-weight: 800;
}

.success {
    color: var(--success);
    margin-top: 10px;
    font-weight: 800;
}

/* =========================================================
   Mejoras para pantallas grandes (Tablet/Desktop)
   Mantiene el look de “caja centrada”
   ========================================================= */

@media (min-width: 768px) {

    .container {
        width: 420px;
        padding: 30px;
        border-radius: 12px;
        min-height: auto; /* en desktop no hace falta “pantalla” */
        box-shadow: 0 12px 35px rgba(0, 0, 0, 0.6);
        display: block;   /* vuelve a modo normal */
    }

    .logo img {
        max-width: 220px;
        margin-bottom: 20px;
    }

    h1 {
        font-size: 24px;
        margin-bottom: 25px;
    }

    .formulario {
        gap: 12px;
        align-items: center; /* como lo tenías, centrado visualmente */
    }

    .grupo-campo {
        width: 100%;
    }

    .grupo-campo label {
        font-size: 14px;
    }

    .formulario .campo {
        font-size: 14px;
        padding: 10px 10px;
        border-radius: 10px;
    }

    .formulario .btn-validar {
        font-size: 15px;
        padding: 12px;
        border-radius: 10px;
        box-shadow: none;
    }
}


/* =========================================================
   Animación suave al tocar el logo (mobile / touch)
   ========================================================= */

.logo a {
    display: inline-block;
    transition: transform 0.15s ease, opacity 0.15s ease;
}

/* Efecto al tocar (mobile) o clickear (desktop) */
.logo a:active {
    transform: scale(0.95);
    opacity: 0.85;
}


@media (hover: hover) {
    .logo a:hover {
        transform: scale(1.03);
    }
}


/* =========================================================
   Animación suave al tocar el logo (desktop )
   ========================================================= */

@media (hover: hover) {
    .logo a:hover {
        transform: scale(1.03);
    }
}






/* =========================================================
   Ripple effect tipo Material (CSS puro)
   ========================================================= */

/* Elementos que tendrán ripple */
.logo a,
.formulario .btn-validar {
    position: relative;
    overflow: hidden; /* clave para cortar la onda */
}

/* Onda */
.logo a::after,
.formulario .btn-validar::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;

    width: 20px;
    height: 20px;
    background: rgba(255, 255, 255, 0.4);

    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;

    transition: transform 0.4s ease, opacity 0.6s ease;
    pointer-events: none;
}

/* Activación al touch / click */
.logo a:active::after,
.formulario .btn-validar:active::after {
    transform: translate(-50%, -50%) scale(12);
    opacity: 1;
}

/* Ajustes específicos */

/* Logo: ripple más sutil */
.logo a::after {
    background: rgba(255, 255, 255, 0.35);
}

/* Botón: ripple un poco más fuerte */
.formulario .btn-validar::after {
    background: rgba(255, 255, 255, 0.45);
}




.estado-paga {
  color: #0b3d1f;
  font-weight: 800;
}

.estado-atrasada {
  color: #b00020;
  font-weight: 800;
}

.estado-pendiente {
  color: #c77700;
  font-weight: 800;
}




/* =========================================================
   Tabla de resultados (SP)
   ========================================================= */

/* Contenedor de la tabla */
.container table {
    background-color: #0b5e2e; /* verde más oscuro */
    color: #ffffff;
    font-size: 14px;           /* tipografía un poco más chica */
}

/* Encabezados */
.container table thead th {
    background-color: #084d25;
    color: #ffffff;
    font-weight: 700;
    font-size: 13px;
}

/* Celdas */
.container table td {
    font-size: 14px;
    padding: 8px 10px;
}

/* Líneas divisorias */
.container table th,
.container table td {
    border-bottom: 1px solid rgba(255,255,255,0.15);
}

/* Hover suave (desktop) */
@media (hover: hover) {
    .container table tbody tr:hover {
        background-color: rgba(0,0,0,0.15);
    }
}



.estado-paga {
  color: #b9f6ca; /* verde claro, legible sobre fondo oscuro */
  font-weight: 700;
}

.estado-atrasada {
  color: #ff8a80;
  font-weight: 700;
}

.estado-pendiente {
  color: #ffd180;
  font-weight: 700;
}



/* =========================================================
   Tabla deuda (app-like + responsive)
   ========================================================= */

.deuda-wrap {
  width: 100%;
  overflow-x: auto;
  margin-top: 16px;
  border-radius: 14px;
  box-shadow: 0 10px 22px rgba(0,0,0,0.25);
  background: rgba(0,0,0,0.15);
}

/* Tabla base */
.deuda-table {
  width: 100%;
  min-width: 820px; /* evita que se rompa en pantallas angostas */
  border-collapse: collapse;
  background: #0b5e2e;
  color: #ffffff;
  font-size: 13px;
}

/* Encabezado sticky (queda visible al scrollear) */
.deuda-table thead th {
  position: sticky;
  top: 0;
  background: #084d25;
  color: #ffffff;
  text-align: left;
  padding: 10px 12px;
  font-weight: 800;
  border-bottom: 1px solid rgba(255,255,255,0.18);
  white-space: nowrap;
}

/* Celdas */
.deuda-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.14);
  vertical-align: top;
}

/* Filas */
.deuda-table tbody tr:nth-child(even) {
  background: rgba(255,255,255,0.06);
}

@media (hover: hover) {
  .deuda-table tbody tr:hover {
    background: rgba(0,0,0,0.18);
  }
}

/* Columnas numéricas alineadas a la derecha (importe/abonado/saldo) */
.deuda-table td:nth-child(4),
.deuda-table td:nth-child(6),
.deuda-table td:nth-child(7) {
  text-align: right;
  white-space: nowrap;
}

/* Mantener Cupón y Cuota # sin quebrar */
.deuda-table td:nth-child(3),
.deuda-table td:nth-child(8) {
  white-space: nowrap;
}

/* Viaje: permitir wrap pero con límite */
.deuda-table td:nth-child(1) {
  max-width: 280px;
  word-break: break-word;
}

/* Estado */
.estado-paga {
  color: #b9f6ca;
  font-weight: 800;
}
.estado-atrasada {
  color: #ff8a80;
  font-weight: 800;
}
.estado-pendiente {
  color: #ffd180;
  font-weight: 800;
}

/* Fila total */
.deuda-table tfoot td {
  background: rgba(0,0,0,0.20);
  font-weight: 900;
  border-top: 2px solid rgba(255,255,255,0.22);
}



/* =========================================================
   Si NO querés tocar el PHP y siguen existiendo inline styles,
   esto los anula igual.
   ========================================================= */
.container table {
  background: #0b5e2e !important;
  color: #ffffff !important;
  border-collapse: collapse !important;
  font-size: 13px !important;
}
.container table th {
  background: #084d25 !important;
  color: #ffffff !important;
  padding: 10px 12px !important;
  border-bottom: 1px solid rgba(255,255,255,0.18) !important;
}
.container table td {
  padding: 10px 12px !important;
  border-bottom: 1px solid rgba(255,255,255,0.14) !important;
}




/* =========================================================
   Tabla deuda (scroll horizontal prolijo)
   ========================================================= */

.deuda-wrap {
  width: 100%;
  overflow-x: auto;
  margin-top: 12px;
  border-radius: 12px;
  background: rgba(0,0,0,0.18);
  -webkit-overflow-scrolling: touch;
}

.deuda-table {
  width: 100%;
  min-width: 820px; /* fuerza scroll en pantallas chicas */
  border-collapse: collapse;
  background: rgba(255,255,255,0.06);
  color: #ffffff;
  font-size: 13px;
}

.deuda-table thead th {
  position: sticky;
  top: 0;
  background: rgba(0,0,0,0.25);
  text-align: left;
  padding: 10px 12px;
  font-weight: 700;
  border-bottom: 1px solid rgba(255,255,255,0.14);
  white-space: nowrap;
}

.deuda-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.10);
  white-space: nowrap;
}

.deuda-table tbody tr:nth-child(even) {
  background: rgba(255,255,255,0.04);
}

@media (hover: hover) {
  .deuda-table tbody tr:hover {
    background: rgba(0,0,0,0.18);
  }
}

/* Total */
.deuda-total-label {
  text-align: right;
  font-weight: 700;
  border-top: 2px solid rgba(255,255,255,0.18);
  background: rgba(0,0,0,0.18);
}

.deuda-total-value {
  font-weight: 800;
  border-top: 2px solid rgba(255,255,255,0.18);
  background: rgba(0,0,0,0.18);
}

/* Estados */
.estado-paga { color: #2ee07a; font-weight: 800; }
.estado-atrasada { color: #ff4d4d; font-weight: 800; }
.estado-pendiente { color: #ffb020; font-weight: 800; }




/* =========================================================
   Mobile: primera columna sticky (Viaje)
   ========================================================= */

.deuda-table th:first-child,
.deuda-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
}

/* Fondo para que no “trasluzca” cuando scrolleás */
.deuda-table th:first-child {
  z-index: 3; /* header por encima de celdas */
  background: rgba(0,0,0,0.35);
}

.deuda-table td:first-child {
  background: rgba(0,0,0,0.22);
  max-width: 240px;
  white-space: normal;     /* permite que “Viaje” envuelva */
  word-break: break-word;
}

/* Línea separadora visual entre columna sticky y el resto */
.deuda-table th:first-child,
.deuda-table td:first-child {
  box-shadow: 10px 0 12px rgba(0,0,0,0.18);
}
