/* assets/css/equipos-style.css */

/* --- VISTA 1: LOGIN / REGISTRO --- */
.auth-wrapper { max-width: 450px; margin: 50px auto; font-family: 'Segoe UI', system-ui, sans-serif; padding: 0 20px; position: relative; z-index: 1; }

.auth-box { background: rgba(255, 255, 255, 0.95); padding: 40px 35px; border-radius: 20px; box-shadow: 0 15px 35px rgba(0,0,0,0.08); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,0.7); }
.auth-box h2 { color: #1e293b; margin-top: 0; font-weight: 800; font-size: 26px; margin-bottom: 8px; text-align: center;}
.auth-box p.subtitle { color: #64748b; font-size: 15px; margin-bottom: 30px; line-height: 1.5; text-align: center; }

.form-input-wrapper { position: relative; margin-bottom: 18px; }
.form-input-wrapper .form-input { margin-bottom: 0; padding-right: 45px; }
.form-input-wrapper .toggle-password { position: absolute; right: 18px; top: 50%; transform: translateY(-50%); cursor: pointer; color: #94a3b8; font-size: 16px; transition: color 0.2s; }
.form-input-wrapper .toggle-password:hover { color: #fb6b25; }

.form-input { width: 100%; padding: 15px 18px; border: 1.5px solid #e2e8f0; font-size: 15px; box-sizing: border-box; margin-bottom: 18px; background: #f8fafc; transition: all 0.3s ease; border-radius: 12px; color: #334155; font-weight: 500;}
.form-input::placeholder { color: #94a3b8; opacity: 1; font-weight: 500; }
.form-input:focus { border-color: #fb6b25; outline: none; background: #ffffff; box-shadow: 0 0 0 4px rgba(251, 107, 37, 0.1); }

.btn-auth { background: #fb6b25; color: white; border: none; width: 100%; padding: 16px; font-size: 16px; font-weight: 700; cursor: pointer; transition: all 0.3s ease; border-radius: 12px; text-transform: uppercase; letter-spacing: 0.5px; margin-top: 5px;}
.btn-auth:hover { background: #e85d1c; transform: translateY(-2px); box-shadow: 0 8px 20px rgba(251, 107, 37, 0.3); }

.btn-auth-alt { background: #1e293b; }
.btn-auth-alt:hover { background: #0f172a; box-shadow: 0 8px 20px rgba(15, 23, 42, 0.3); }

.msg-alert { padding: 14px; margin-bottom: 20px; border-radius: 10px; font-size: 14px; display: none; font-weight: 500; text-align: center; }
.msg-error { background: #fef2f2; color: #ef4444; border: 1px solid #fca5a5; }
.msg-success { background: #f0fdf4; color: #22c55e; border: 1px solid #86efac; }

.auth-toggle-link { display: block; text-align: center; margin-top: 25px; color: #64748b; text-decoration: none; font-weight: 600; font-size: 15px; transition: color 0.2s;}
.auth-toggle-link span { color: #fb6b25; }
.auth-toggle-link:hover span { color: #e85d1c; text-decoration: underline; }

@media (max-width: 480px) {
    .auth-box { padding: 30px 20px; }
}

/* --- VISTA 2: FORMULARIO ESTILO EXCEL (MULTI-PESTAÑA) --- */
:root { --excel-green: #217346; --border-color: #d4d4d4; --header-bg: #f8f9fa; --bg-color: #ffffff; }
.excel-wrapper { max-width: 100%; margin: 0 auto; background: var(--bg-color); font-family: 'Segoe UI', Arial, sans-serif; border: 1px solid var(--border-color); }

.excel-top-bar { background: var(--excel-green); color: white; padding: 12px 20px; display: flex; justify-content: space-between; align-items: center; }
.excel-title { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.save-status { font-size: 12px; background: rgba(0,0,0,0.15); padding: 4px 10px; border: 1px solid rgba(255,255,255,0.2); }

/* Formatting Rules */
input[data-field="nombre_equipo"], input[data-field="ciudad"], input[data-field="delegado_nombre"], 
input[data-field="entrenador"], input[data-field="asistente"], input[data-field="fisioterapeuta"], 
input[data-field="medico"], input[data-field="pais_otro"],
input[data-col="nombre"], input[data-col="apellido"] { text-transform: capitalize; }
input[data-col="pasaporte_num"] { text-transform: uppercase; }

/* Excel Tabs */
.excel-tabs { display: flex; align-items: center; background: #e9e9e9; padding: 6px 10px 0 10px; border-bottom: 1px solid var(--border-color); overflow-x: auto; }
.excel-tab { padding: 8px 20px; font-size: 13px; color: #555; background: #ddd; border: 1px solid #ccc; border-bottom: none; margin-right: 3px; border-radius: 4px 4px 0 0; cursor: pointer; text-decoration: none; white-space: nowrap; transition: 0.2s; }
.excel-tab:hover { background: #eee; color: #333; }
.excel-tab.active { background: #fff; color: var(--excel-green); font-weight: bold; border-top: 3px solid var(--excel-green); border-bottom: 1px solid #fff; margin-bottom: -1px; }

/* Botón Añadir Equipo más explícito */
.excel-tab-add { padding: 8px 15px; font-size: 13px; color: var(--excel-green); cursor: pointer; border-radius: 4px 4px 0 0; display: flex; align-items: center; gap: 6px; font-weight: 600; margin-left: 10px; border: none; background: transparent; }
.excel-tab-add:hover { background: #d4d4d4; color: #185a36; }

/* Progress Section */
.progress-section { background: #fff; border-bottom: 1px solid var(--border-color); padding: 15px 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
.prog-box { display: flex; flex-direction: column; gap: 5px; }
.prog-labels { display: flex; justify-content: space-between; font-size: 12px; font-weight: 600; color: #555; text-transform: uppercase; }
.prog-track { width: 100%; height: 6px; background: #eee; }
.prog-fill { height: 100%; background: var(--excel-green); width: 0%; transition: width 0.4s ease; }

/* Header Info */
.excel-header-form { padding: 20px; background: var(--header-bg); border-bottom: 1px solid var(--border-color); display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 15px; }
.form-group-ex label { display: block; font-size: 11px; font-weight: 600; color: #555; text-transform: uppercase; margin-bottom: 4px; }
.form-control { width: 100%; padding: 8px; border: 1px solid #ccc; font-size: 13px; background: #fff; transition: border 0.3s; box-sizing: border-box; }
.form-control:focus { border-color: var(--excel-green); outline: none; }
.form-control.is-valid { border-color: var(--excel-green); border-width: 2px; }
.form-control[readonly] { background: #e9ecef; color: #6c757d; border-color: #ddd; cursor: not-allowed; }

/* Table Area */
.excel-table-container { overflow-x: auto; background: #fff; min-height: 400px;}
.excel-table { width: 100%; border-collapse: collapse; table-layout: fixed; min-width: 1600px; }
.excel-table th { background: var(--header-bg); color: #333; font-weight: 600; font-size: 11px; text-align: left; padding: 10px; border: 1px solid var(--border-color); text-transform: uppercase; }
.excel-table td { border: 1px solid var(--border-color); padding: 0; position: relative; }

.cell-input { width: 100%; height: 100%; border: none; padding: 10px; font-size: 13px; box-sizing: border-box; background: transparent; }
.cell-input:focus { outline: 1px solid var(--excel-green); outline-offset: -1px; background: #f0fdf4; z-index: 10; position: relative; }

.cell-file-upload { display: flex; align-items: center; justify-content: center; padding: 5px; height: 100%; }
.file-btn { background: #eee; color: #333; border: 1px solid #ccc; padding: 6px; font-size: 11px; cursor: pointer; width: 100%; text-align: center; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-sizing: border-box; }
.file-btn:hover { background: #e2e2e2; }
.file-btn.uploaded { background: #d1e7dd; color: #0f5132; font-weight: 600; border-color: #166534; }
.hidden-file { display: none; }

/* Loading Spinner */
#accvs-loader { text-align: center; padding: 100px 20px; font-family: sans-serif; }
#accvs-loader i { font-size: 40px; color: #fb6b25; margin-bottom: 20px; }

/* Ocultos por defecto, visibles al imprimir */
.print-header, .print-footer { display: none; }

.mobile-scroll-hint { display: none; background: #e0f2fe; color: #0369a1; padding: 10px; text-align: center; font-size: 13px; font-weight: 600; border-bottom: 1px solid #bae6fd; }

@media (max-width: 768px) {
    .excel-top-bar { flex-direction: column; align-items: flex-start; gap: 12px; }
    .excel-top-bar > div:last-child { flex-wrap: wrap; width: 100%; justify-content: flex-start; gap: 10px !important; }
    .mobile-scroll-hint { display: block; }
    .progress-section { grid-template-columns: 1fr; gap: 15px; }
}

@media print {
    @page { margin: 0; }
    body { background: #fff !important; padding: 15mm !important; }
    header, footer, nav, aside, .site-header, .site-footer, .wpadminbar { display: none !important; }
    
    .excel-top-bar, .excel-tabs, .progress-section, .cell-file-upload { display: none !important; }
    
    .print-header { display: flex !important; align-items: center; justify-content: center; gap: 15px; margin-bottom: 10px; border-bottom: 2px solid #000; padding-bottom: 10px; }
    .print-header img { max-width: 60px; }
    .print-header h2 { margin: 0; font-size: 18px; color: #000; text-transform: uppercase; }
    
    .print-footer { display: flex !important; justify-content: space-around; margin-top: 20px; }
    .print-footer-box { width: 200px; text-align: center; padding-top: 5px; }
    .print-footer-stamp { border: 2px dashed #999; width: 100px; height: 100px; display: flex; align-items: center; justify-content: center; color: #666; border-radius: 50%; margin: 0 auto; font-weight: bold; text-transform: uppercase; font-size: 10px; }
    
    .excel-wrapper { display: flex !important; flex-direction: column !important; border: none !important; box-shadow: none !important; margin: 0 !important; width: 100% !important; max-width: 100% !important; padding: 0 !important; }
    .print-header { order: 1; }
    .excel-header-form { order: 2; }
    .excel-table-container { order: 3; }
    .excel-footer-form { order: 4; margin-top: 15px !important; margin-bottom: 0 !important; }
    .print-footer { order: 5; }
    .print-logos { display: flex !important; justify-content: center; align-items: center; margin-top: 20px; order: 6; gap: 20px; }
    
    .excel-header-form, .excel-footer-form { grid-template-columns: repeat(4, 1fr) !important; padding: 0 !important; border: none !important; background: transparent !important; gap: 5px !important; display: grid !important; }
    .excel-header-form { margin-bottom: 10px !important; }
    .form-group-ex label { font-size: 9px !important; color: #000 !important; margin-bottom: 0 !important; }
    .form-control { padding: 0 !important; border: none !important; font-size: 11px !important; color: #000 !important; font-weight: bold !important; height: auto !important; background: transparent !important; -webkit-appearance: none; appearance: none;}
    
    .excel-table-container { overflow: hidden !important; min-height: 0 !important; }
    .excel-table { min-width: 100% !important; width: 100% !important; border: 1px solid #000 !important; }
    .excel-table th { background: #eee !important; color: #000 !important; border: 1px solid #000 !important; padding: 3px !important; font-size: 9px !important; }
    .excel-table td { border: 1px solid #000 !important; padding: 0 !important; height: 16px !important; }
    .cell-input { padding: 1px 3px !important; font-size: 10px !important; color: #000 !important; border: none !important; background: transparent !important; height: 100% !important; }

    /* Ocultar elementos no necesarios para imprimir */
    .no-print { display: none !important; }

    /* Ocultar columnas: Pasaporte (9), Foto (10), Pasaporte Doc (11), Descargo (12) */
    .excel-table th:nth-child(9), .excel-table td:nth-child(9),
    .excel-table th:nth-child(10), .excel-table td:nth-child(10),
    .excel-table th:nth-child(11), .excel-table td:nth-child(11),
    .excel-table th:nth-child(12), .excel-table td:nth-child(12) {
        display: none !important;
    }

    /* Forzar anchos correctos en impresión para que no se expanda la primera columna */
    .excel-table th:nth-child(1) { width: 30px !important; }
    .excel-table th:nth-child(2) { width: 23% !important; }
    .excel-table th:nth-child(3) { width: 23% !important; }
    .excel-table th:nth-child(4) { width: 10% !important; }
    .excel-table th:nth-child(5) { width: 15% !important; }
}
