/* ==========================================================================
   Estilos de Terminal y Kiosko Táctil para Tablets - Industrias Algama
   ========================================================================== */

/* Contenedor principal de pantalla completa para tablet */
.tablet-kiosk-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1rem;
}

/* Logo corporativo en cabecera de la tablet */
.tablet-header-logo-link {
    text-decoration: none !important;
    display: inline-flex;
    align-items: center;
}

.tablet-header-logo-badge {
    background: #ffffff;
    padding: 0.35rem 0.85rem;
    border-radius: 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.6);
}

.tablet-header-logo-badge:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
}

.tablet-header-logo-badge:active {
    transform: scale(0.96);
}

.tablet-header-logo-badge img {
    height: 32px;
    width: auto;
    display: block;
    object-fit: contain;
}

/* Tarjeta central del kiosko */
.tablet-card {
    background: #ffffff;
    border-radius: 28px;
    border: 1px solid rgba(226, 232, 240, 0.9);
    box-shadow: 0 20px 45px -12px rgba(15, 23, 42, 0.08), 0 2px 6px rgba(0, 0, 0, 0.03);
    overflow: hidden;
    width: 100%;
    max-width: 980px;
    transition: transform 0.25s ease;
}

/* Cabecera del terminal */
.tablet-header {
    background: linear-gradient(135deg, #134a7b 0%, #1e6091 100%);
    color: #ffffff;
    padding: 1.75rem 2.25rem 1.6rem;
    position: relative;
    overflow: hidden;
}

.tablet-header::after {
    content: '';
    position: absolute;
    top: -40%;
    right: -15%;
    width: 260px;
    height: 260px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0) 70%);
    border-radius: 50%;
    pointer-events: none;
}

.tablet-header-title {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.3px;
    margin-bottom: 0.35rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.tablet-header-subtitle {
    font-size: 0.98rem;
    color: rgba(241, 245, 249, 0.88);
    margin: 0;
    font-weight: 400;
}

/* Reloj digital en vivo */
.tablet-live-clock {
    font-size: 0.88rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(8px);
    padding: 0.35rem 0.9rem;
    border-radius: 50px;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: #ffffff;
    letter-spacing: 0.5px;
}

/* Cuerpo de la tarjeta */
.tablet-body {
    padding: 2.25rem 2rem 2.25rem;
}

/* Entrada de DNI centralizada */
.dni-input-wrapper {
    position: relative;
    max-width: 460px;
    margin: 0 auto 2.25rem;
}

.dni-label {
    display: block;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: #64748b;
    margin-bottom: 0.65rem;
}

.dni-input-container {
    position: relative;
    display: flex;
    align-items: center;
}

.dni-icon-left {
    position: absolute;
    left: 1.25rem;
    font-size: 1.35rem;
    color: #94a3b8;
    pointer-events: none;
    transition: color 0.2s ease;
}

.dni-input {
    width: 100%;
    height: 66px;
    padding: 0 3.25rem;
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    text-align: center;
    background-color: #f8fafc;
    border: 2px solid #cbd5e1;
    border-radius: 20px;
    color: #0f172a;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

.dni-input:focus {
    background-color: #ffffff;
    border-color: #134a7b;
    box-shadow: 0 0 0 5px rgba(19, 74, 123, 0.16), 0 6px 16px rgba(19, 74, 123, 0.08);
    outline: none;
}

.dni-input-container:focus-within .dni-icon-left {
    color: #134a7b;
}

/* Botón de borrado rápido de DNI */
.dni-clear-btn {
    position: absolute;
    right: 0.75rem;
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 1.35rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    opacity: 0;
    pointer-events: none;
}

.dni-clear-btn.visible {
    opacity: 1;
    pointer-events: auto;
}

.dni-clear-btn:hover,
.dni-clear-btn:active {
    background-color: #e2e8f0;
    color: #475569;
}

/* Separador de instrucción */
.step-instruction {
    text-align: center;
    margin-bottom: 1.5rem;
}

.step-instruction-badge {
    background: #f1f5f9;
    color: #475569;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.4px;
    padding: 0.45rem 1.25rem;
    border-radius: 30px;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

/* Cuadrícula táctil adaptable */
.actions-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
}

@media (max-width: 991px) {
    .actions-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.15rem;
    }
    .kiosk-btn {
        min-height: 150px;
    }
}

@media (max-width: 540px) {
    .actions-grid {
        grid-template-columns: 1fr;
        gap: 0.9rem;
    }
}

/* Botones táctiles estilo tarjeta */
.kiosk-btn {
    position: relative;
    border: none;
    border-radius: 22px;
    padding: 1.6rem 1rem 1.4rem;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 165px;
    cursor: pointer;
    box-shadow: 0 10px 22px -6px rgba(0, 0, 0, 0.12);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none !important;
    text-decoration: none !important;
    overflow: hidden;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.kiosk-btn::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0) 100%);
    pointer-events: none;
}

.kiosk-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 16px 30px -4px rgba(0, 0, 0, 0.2);
    color: #ffffff;
}

.kiosk-btn:active {
    transform: scale(0.96) translateY(0);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.kiosk-icon-box {
    width: 62px;
    height: 62px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.24);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.85rem;
    margin-bottom: 0.85rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.25s ease;
}

.kiosk-btn:hover .kiosk-icon-box {
    transform: scale(1.08);
}

.kiosk-btn-title {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 0.25rem;
    color: #ffffff;
}

.kiosk-btn-subtitle {
    font-size: 0.78rem;
    opacity: 0.9;
    font-weight: 500;
    letter-spacing: 0.2px;
    color: rgba(255, 255, 255, 0.95);
}

/* Paletas con degradados modernos */
.btn-safety {
    background: linear-gradient(135deg, #1e40af 0%, #2563eb 50%, #3b82f6 100%);
}

.btn-visits {
    background: linear-gradient(135deg, #0284c7 0%, #0ea5e9 50%, #38bdf8 100%);
}

.btn-carriers {
    background: linear-gradient(135deg, #d97706 0%, #f59e0b 50%, #fbbf24 100%);
}

.btn-workers {
    background: linear-gradient(135deg, #047857 0%, #10b981 50%, #34d399 100%);
}

/* Animación de temblor en caso de input vacío */
@keyframes shakeDni {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-9px); }
    40%, 80% { transform: translateX(9px); }
}

.shake-input {
    animation: shakeDni 0.4s ease-in-out;
}

/* ==========================================================================
   Variantes de Cabecera por Tipo de Flujo
   ========================================================================== */
.tablet-header-safety {
    background: linear-gradient(135deg, #1e40af 0%, #2563eb 50%, #3b82f6 100%) !important;
}

.tablet-header-visits {
    background: linear-gradient(135deg, #0284c7 0%, #0ea5e9 50%, #38bdf8 100%) !important;
}

.tablet-header-carriers {
    background: linear-gradient(135deg, #d97706 0%, #f59e0b 50%, #fbbf24 100%) !important;
}

.tablet-header-workers {
    background: linear-gradient(135deg, #047857 0%, #10b981 50%, #34d399 100%) !important;
}

/* Botón de retorno en cabecera */
.tablet-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 1.1rem;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    color: #ffffff !important;
    border-radius: 50px;
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none !important;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.tablet-back-btn:hover {
    background: rgba(255, 255, 255, 0.35);
    color: #ffffff !important;
    transform: translateX(-2px);
}

.tablet-back-btn:active {
    transform: scale(0.96);
}

/* ==========================================================================
   Pantalla de Estado / Confirmación (action-info)
   ========================================================================== */
.tablet-status-wrapper {
    text-align: center;
    padding: 2.5rem 1.5rem;
}

.tablet-status-icon-box {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

.tablet-status-icon-success {
    background: #dcfce7;
    color: #10b981;
}

.tablet-status-icon-danger {
    background: #fee2e2;
    color: #ef4444;
}

.tablet-status-title {
    font-size: 1.85rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 0.75rem;
}

.tablet-status-text {
    font-size: 1.25rem;
    color: #475569;
    max-width: 600px;
    margin: 0 auto 2rem;
    line-height: 1.5;
}

.tablet-countdown-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: #f1f5f9;
    color: #64748b;
    padding: 0.4rem 1rem;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

/* ==========================================================================
   Formularios Táctiles (register-external)
   ========================================================================== */
.tablet-form-label {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.95rem;
    font-weight: 700;
    color: #334155;
    margin-bottom: 0.45rem;
}

.tablet-form-control {
    height: 56px;
    border-radius: 16px;
    border: 2px solid #e2e8f0;
    padding: 0.6rem 1.25rem;
    font-size: 1.15rem;
    color: #0f172a;
    background-color: #f8fafc;
    transition: all 0.2s ease;
}

.tablet-form-control:focus {
    background-color: #ffffff;
    border-color: #134a7b;
    box-shadow: 0 0 0 4px rgba(19, 74, 123, 0.14);
    outline: none;
}

.tablet-form-control[readonly] {
    background-color: #e2e8f0;
    color: #475569;
    font-weight: 600;
    cursor: default;
}

.tablet-legal-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    padding: 1.25rem 1.5rem;
    margin: 1.5rem 0 2rem;
}

.tablet-legal-card .form-check-input {
    width: 24px;
    height: 24px;
    margin-top: 0.15rem;
    margin-left: -2rem;
    cursor: pointer;
}

.tablet-legal-card .form-check-label {
    font-size: 1.05rem;
    font-weight: 600;
    color: #334155;
    padding-left: 0.5rem;
    cursor: pointer;
}

.tablet-action-btn {
    min-height: 62px;
    border-radius: 18px;
    font-size: 1.25rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.8rem 2.25rem;
    box-shadow: 0 10px 22px -5px rgba(0, 0, 0, 0.15);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    color: #ffffff !important;
}

.tablet-action-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 28px -4px rgba(0, 0, 0, 0.2);
}

.tablet-action-btn:active {
    transform: scale(0.97);
}

.tablet-action-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* ==========================================================================
   Catálogo de Selección de EPIs (select-epi)
   ========================================================================== */
.tablet-card-lg {
    max-width: 1040px !important;
}

.tablet-worker-badge {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    padding: 0.35rem 0.9rem;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    backdrop-filter: blur(4px);
}

.tablet-accordion-card {
    border: 1px solid #e2e8f0;
    border-radius: 20px !important;
    margin-bottom: 1.25rem;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.tablet-accordion-btn {
    width: 100%;
    padding: 1.1rem 1.4rem;
    background: #f8fafc;
    border: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 1.15rem;
    font-weight: 700;
    color: #1e293b;
    text-align: left;
    transition: background 0.2s ease;
    outline: none !important;
}

.tablet-accordion-btn:hover {
    background: #f1f5f9;
}

.tablet-accordion-btn .chevron-icon {
    transition: transform 0.25s ease;
}

.tablet-accordion-btn[aria-expanded="true"] {
    background: #ecfdf5;
    color: #047857;
}

.tablet-accordion-btn[aria-expanded="true"] .chevron-icon {
    transform: rotate(180deg);
}

.tablet-epi-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #f1f5f9;
    border-radius: 14px;
    margin-bottom: 0.4rem;
    transition: all 0.2s ease;
}

.tablet-epi-row:last-child {
    border-bottom: none;
}

.tablet-epi-row.selected {
    background-color: #f0fdf4;
    border: 1px solid #86efac;
}

.tablet-epi-img-box {
    width: 68px;
    height: 68px;
    border-radius: 14px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    margin-right: 1rem;
    flex-shrink: 0;
}

.tablet-epi-img-box img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.tablet-epi-info {
    flex-grow: 1;
}

.tablet-epi-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.15rem;
}

.tablet-epi-controls {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.tablet-stepper {
    display: inline-flex;
    align-items: center;
    background: #ffffff;
    border: 2px solid #cbd5e1;
    border-radius: 14px;
    overflow: hidden;
}

.tablet-stepper-btn {
    width: 42px;
    height: 42px;
    border: none;
    background: #f1f5f9;
    color: #334155;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s;
}

.tablet-stepper-btn:hover,
.tablet-stepper-btn:active {
    background: #e2e8f0;
}

.tablet-stepper-input {
    width: 48px;
    height: 42px;
    border: none;
    text-align: center;
    font-size: 1.15rem;
    font-weight: 700;
    color: #0f172a;
    background: transparent;
    outline: none;
}

.tablet-checkbox-btn {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    border: 2px solid #cbd5e1;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    color: transparent;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tablet-checkbox-btn.checked {
    background: #10b981;
    border-color: #10b981;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* Modales para tablet */
.tablet-modal-content {
    border-radius: 26px !important;
    border: none !important;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25) !important;
}

.tablet-modal-header {
    background: linear-gradient(135deg, #134a7b 0%, #1e6091 100%);
    color: #ffffff;
    padding: 1.25rem 1.75rem;
    border-bottom: none;
}

.tablet-modal-header .close {
    color: #ffffff;
    opacity: 0.85;
    font-size: 1.75rem;
    outline: none;
}

.tablet-modal-header .close:hover {
    opacity: 1;
}

.tablet-modal-body {
    padding: 1.75rem;
}

.tablet-modal-footer {
    padding: 1.25rem 1.75rem;
    border-top: 1px solid #f1f5f9;
}
