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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #f5f7fb;
    color: #1a1f2e;
    line-height: 1.5;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* TEMA OSCURO */
body.dark {
    background: #0f172a;
    color: #e2e8f0;
}

body.dark .header {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-bottom-color: #334155;
}

body.dark .header h1 {
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
    -webkit-background-clip: text;
    background-clip: text;
}

body.dark .demo-badge {
    background: #1e293b;
    color: #94a3b8;
}

body.dark .nav {
    background: #1e293b;
    border-bottom-color: #334155;
}

body.dark .nav-btn {
    color: #94a3b8;
}

body.dark .nav-btn:hover {
    background: #334155;
    color: #f1f5f9;
}

body.dark .nav-btn.active {
    background: #3b82f6;
    color: white;
}

body.dark .info-bar {
    background: #1e293b;
    border-color: #334155;
}

body.dark .badge {
    background: #1e3a5f;
    color: #93c5fd;
}

body.dark .timestamp {
    color: #64748b;
}

body.dark .refresh-btn {
    background: #334155;
    border-color: #475569;
    color: #cbd5e1;
}

body.dark .refresh-btn:hover {
    background: #475569;
}

body.dark .match-card {
    background: #1e293b;
    border-color: #334155;
}

body.dark .match-card:hover {
    border-color: #475569;
    box-shadow: 0 12px 24px -12px rgba(0,0,0,0.4);
}

body.dark .match-score {
    color: #93c5fd;
}

body.dark .group-table {
    background: #1e293b;
    border-color: #334155;
}

body.dark .group-title {
    background: #0f172a;
    color: #93c5fd;
    border-bottom-color: #334155;
}

body.dark .group-table th {
    background: #1e293b;
    color: #94a3b8;
}

body.dark .group-table td {
    border-bottom-color: #334155;
}

body.dark .group-table tr:hover td {
    background: #2d3748;
}

body.dark .search-box input {
    background: #1e293b;
    border-color: #334155;
    color: #f1f5f9;
}

body.dark .search-box input:focus {
    border-color: #3b82f6;
}

body.dark .search-box input::placeholder {
    color: #64748b;
}

body.dark .player-card {
    background: #1e293b;
    border-color: #334155;
}

body.dark .player-card:hover {
    border-color: #475569;
}

body.dark .calendar-day {
    background: #1e293b;
    border-color: #334155;
}

body.dark .calendar-day-header {
    background: #0f172a;
    color: #93c5fd;
    border-bottom-color: #334155;
}

body.dark .calendar-time {
    color: #93c5fd;
}

body.dark .loading, body.dark .error-message {
    background: #1e293b;
    border-color: #334155;
}

body.dark .status-live {
    background: #14532d;
    color: #4ade80;
}

body.dark .status-finished {
    background: #451a03;
    color: #fbbf24;
}

body.dark .status-scheduled {
    background: #1e3a5f;
    color: #93c5fd;
}

/* Estilos para bracket vertical */
.bracket-vertical {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.bracket-round-vertical {
    background: #ffffff;
    border-radius: 20px;
    border: 1px solid #eef2f6;
    overflow: hidden;
    transition: all 0.3s ease;
}

body.dark .bracket-round-vertical {
    background: #1e293b;
    border-color: #334155;
}

.bracket-round-vertical h3 {
    background: #f8fafc;
    color: #1e3a5f;
    padding: 14px 20px;
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0;
    border-bottom: 1px solid #eef2f6;
}

body.dark .bracket-round-vertical h3 {
    background: #0f172a;
    color: #93c5fd;
    border-bottom-color: #334155;
}

.bracket-matches-vertical {
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.bracket-match-vertical {
    background: #f8fafc;
    border-radius: 14px;
    padding: 14px;
    transition: all 0.2s;
    border: 1px solid #eef2f6;
}

body.dark .bracket-match-vertical {
    background: #0f172a;
    border-color: #334155;
}

.bracket-match-vertical:hover {
    transform: translateY(-2px);
    border-color: #cbd5e1;
}

body.dark .bracket-match-vertical:hover {
    border-color: #475569;
}

.final-match-vertical {
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    border: 2px solid #e2e8f0;
}

body.dark .final-match-vertical {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-color: #3b82f6;
}

.bracket-teams-vertical {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bracket-team-vertical {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid #e2e8f0;
}

body.dark .bracket-team-vertical {
    border-bottom-color: #334155;
}

.bracket-team-vertical:last-child {
    border-bottom: none;
}

.bracket-team-info-vertical {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    font-weight: 500;
    flex: 1;
}

.bracket-score-vertical {
    font-weight: 700;
    color: #1e3a5f;
    min-width: 35px;
    text-align: right;
    font-size: 0.85rem;
}

body.dark .bracket-score-vertical {
    color: #93c5fd;
}

.bracket-date-vertical {
    font-size: 0.65rem;
    color: #8a99b0;
    text-align: center;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid #eef2f6;
}

body.dark .bracket-date-vertical {
    border-top-color: #334155;
}

.centered-match {
    grid-column: span 2;
    max-width: 400px;
    margin: 0 auto;
    width: 100%;
}

/* Toggle Tema */
.theme-toggle {
    position: fixed;
    top: 16px;
    right: 20px;
    z-index: 1000;
    cursor: pointer;
    font-size: 1.2rem;
    background: transparent;
    border: none;
    padding: 0;
}

.theme-toggle button {
    background: transparent;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.light-icon, .dark-icon {
    font-size: 1.2rem;
}

body.dark .light-icon {
    display: none;
}

body:not(.dark) .dark-icon {
    display: none;
}

.header {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    padding: 24px 24px 20px 24px;
    text-align: center;
    border-bottom: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.header h1 {
    font-size: 1.6rem;
    font-weight: 700;
    background: linear-gradient(135deg, #1e3a5f, #2c5f8a);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    letter-spacing: -0.3px;
}

.header p {
    font-size: 0.8rem;
    color: #5b6e8c;
    margin-top: 4px;
}

body.dark .header p {
    color: #94a3b8;
}

.demo-badge {
    background: #eef2ff;
    color: #1e3a5f;
    padding: 3px 12px;
    border-radius: 30px;
    font-size: 0.65rem;
    font-weight: 500;
    display: inline-block;
    margin-top: 8px;
}

.nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    padding: 12px 20px;
    background: #ffffff;
    border-bottom: 1px solid #eef2f6;
    position: sticky;
    top: 0;
    z-index: 99;
    transition: all 0.3s ease;
}

.nav-btn {
    background: transparent;
    border: none;
    color: #5b6e8c;
    padding: 8px 18px;
    border-radius: 40px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
    text-decoration: none;
}

.nav-btn:hover {
    background: #f1f5f9;
    color: #1e3a5f;
}

.nav-btn.active {
    background: #1e3a5f;
    color: white;
    box-shadow: 0 2px 8px rgba(30,58,95,0.2);
}

body.dark .nav-btn.active {
    background: #3b82f6;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 24px 24px 32px 24px;
}

.info-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    background: #ffffff;
    padding: 12px 18px;
    border-radius: 14px;
    margin-bottom: 24px;
    border: 1px solid #eef2f6;
    transition: all 0.3s ease;
}

.badge {
    background: #eef2ff;
    color: #1e3a5f;
    padding: 5px 14px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 0.75rem;
}

.timestamp {
    font-size: 0.7rem;
    color: #8a99b0;
}

.refresh-btn {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #1e3a5f;
    padding: 5px 14px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 0.7rem;
    font-weight: 500;
    transition: 0.2s;
}

.refresh-btn:hover {
    background: #e2e8f0;
}

.matches-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.match-card {
    background: #ffffff;
    border-radius: 18px;
    padding: 18px;
    transition: all 0.25s ease;
    border: 1px solid #eef2f6;
    transition: all 0.3s ease;
}

.match-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px -10px rgba(0,0,0,0.1);
    border-color: #e2e8f0;
}

.match-teams {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 14px;
    flex-wrap: wrap;
    gap: 6px;
}

.team-home, .team-away {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.team-away {
    justify-content: flex-end;
}

.vs {
    color: #8a99b0;
    font-size: 0.65rem;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.match-score {
    font-size: 1.8rem;
    font-weight: 700;
    text-align: center;
    font-family: 'Inter', monospace;
    margin: 10px 0;
    color: #1e3a5f;
    letter-spacing: 2px;
}

.match-status {
    text-align: center;
    font-size: 0.65rem;
    padding: 4px 10px;
    border-radius: 30px;
    display: inline-block;
    width: auto;
    margin: 0 auto;
    font-weight: 500;
}

.status-live {
    background: #dcfce7;
    color: #15803d;
}

.status-finished {
    background: #fef3c7;
    color: #b45309;
}

.status-scheduled {
    background: #eef2ff;
    color: #1e3a5f;
}

.match-date {
    font-size: 0.65rem;
    text-align: center;
    margin-top: 12px;
    color: #8a99b0;
    font-weight: 500;
}

.fi {
    display: inline-block;
    margin-right: 5px;
    vertical-align: middle;
    border-radius: 2px;
}

.groups-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.group-table {
    background: #ffffff;
    border-radius: 18px;
    overflow-x: auto;
    border: 1px solid #eef2f6;
    transition: all 0.3s ease;
}

.group-title {
    background: #f8fafc;
    color: #1e3a5f;
    padding: 12px 18px;
    font-weight: 700;
    font-size: 0.9rem;
    border-bottom: 1px solid #eef2f6;
}

.group-table table {
    width: 100%;
    border-collapse: collapse;
    min-width: 480px;
}

.group-table th, .group-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #f0f2f5;
    font-size: 0.75rem;
}

.group-table th {
    background: #ffffff;
    color: #5b6e8c;
    font-weight: 600;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.group-table tr:hover td {
    background: #fafcff;
}

.search-box {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.search-box input {
    flex: 1;
    padding: 12px 18px;
    border-radius: 48px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #1a1f2e;
    font-size: 0.85rem;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s;
}

.search-box input:focus {
    outline: none;
    border-color: #1e3a5f;
    box-shadow: 0 0 0 2px rgba(30,58,95,0.1);
}

.search-box button {
    background: #1e3a5f;
    border: none;
    padding: 0 24px;
    border-radius: 48px;
    font-weight: 600;
    color: white;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: 0.2s;
    font-size: 0.85rem;
}

.search-box button:hover {
    background: #2c4e7a;
}

.player-card {
    background: #ffffff;
    border-radius: 14px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid #eef2f6;
}

.player-card:hover {
    border-color: #cbd5e1;
    transform: translateY(-2px);
}

.calendar-day {
    background: #ffffff;
    border-radius: 18px;
    margin-bottom: 18px;
    overflow: hidden;
    border: 1px solid #eef2f6;
}

.calendar-day-header {
    background: #f8fafc;
    color: #1e3a5f;
    padding: 12px 18px;
    font-weight: 600;
    border-bottom: 1px solid #eef2f6;
    font-size: 0.85rem;
}

.calendar-time {
    color: #1e3a5f;
    font-weight: 500;
    font-size: 0.8rem;
}

.loading, .error-message {
    text-align: center;
    padding: 50px 20px;
    background: #ffffff;
    border-radius: 20px;
    border: 1px solid #eef2f6;
}

.error-message {
    color: #dc2626;
}

@media (max-width: 700px) {
    .bracket-matches-vertical {
        grid-template-columns: 1fr;
    }
    .centered-match {
        grid-column: span 1;
    }
    .container {
        padding: 18px 16px;
    }
    .nav-btn {
        padding: 6px 12px;
        font-size: 0.7rem;
    }
    .matches-grid {
        grid-template-columns: 1fr;
    }
    .group-table th, .group-table td {
        font-size: 0.65rem;
        padding: 6px 4px;
    }
    .team-home, .team-away {
        font-size: 0.8rem;
    }
    .match-score {
        font-size: 1.3rem;
    }
    .header h1 {
        font-size: 1.2rem;
    }
    .theme-toggle {
        top: 12px;
        right: 16px;
    }
}


/* ============================================
   FORMULARIOS (para crear empresa, unirse, etc)
   ============================================ */
/* ============================================
   LOGIN - TRES PESTAÑAS
   ============================================ */

/* Contenedor de pestañas en línea */
.tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 25px;
    border-bottom: 1px solid #e2e8f0;
    flex-wrap: nowrap;
    justify-content: center;
}

/* Botones de pestaña */
.tab-btn {
    background: none;
    border: none;
    padding: 10px 20px;
    font-size: 0.9rem;
    cursor: pointer;
    color: #5b6e8c;
    transition: all 0.2s;
    white-space: nowrap;
}

.tab-btn:hover {
    color: #1e3a5f;
}

.tab-btn.active {
    color: #1e3a5f;
    border-bottom: 2px solid #1e3a5f;
    font-weight: bold;
}

/* Modo oscuro */
body.dark .tab-btn {
    color: #94a3b8;
}

body.dark .tab-btn:hover {
    color: #93c5fd;
}

body.dark .tab-btn.active {
    color: #93c5fd;
    border-bottom-color: #93c5fd;
}

/* Tarjeta de formulario */
.form-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    border: 1px solid #eef2f6;
    margin-bottom: 20px;
}

body.dark .form-card {
    background: #1e293b;
    border-color: #334155;
}

.form-card h3 {
    margin-bottom: 16px;
    font-size: 1.1rem;
    color: #1e3a5f;
}

body.dark .form-card h3 {
    color: #93c5fd;
}

.form-card p {
    margin-bottom: 16px;
    font-size: 0.85rem;
    color: #5b6e8c;
}

body.dark .form-card p {
    color: #94a3b8;
}

/* Grupos de formulario */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 0.85rem;
    color: #1a1f2e;
}

body.dark .form-group label {
    color: #cbd5e1;
}

.form-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.2s;
    box-sizing: border-box;
}

body.dark .form-group input {
    background: #0f172a;
    border-color: #334155;
    color: #f1f5f9;
}

.form-group input:focus {
    outline: none;
    border-color: #1e3a5f;
    box-shadow: 0 0 0 2px rgba(30, 58, 95, 0.1);
}

body.dark .form-group input:focus {
    border-color: #3b82f6;
}

/* Botón principal */
.btn-primary {
    width: 100%;
    background: #1e3a5f;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: #2c4e7a;
}

body.dark .btn-primary {
    background: #3b82f6;
}

body.dark .btn-primary:hover {
    background: #2563eb;
}

/* Mensajes de alerta */
.alert {
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.85rem;
}

.alert.error {
    background: #fee2e2;
    color: #dc2626;
    border-left: 3px solid #dc2626;
}

body.dark .alert.error {
    background: #7f1a1a;
    color: #fecaca;
}

.alert.success {
    background: #dcfce7;
    color: #15803d;
    border-left: 3px solid #15803d;
}

body.dark .alert.success {
    background: #14532d;
    color: #4ade80;
}

/* Separador */
.separador {
    text-align: center;
    margin: 20px 0;
    color: #cbd5e1;
}

/* Contenedor del login */
.login-container {
    max-width: 550px;
    margin: 40px auto;
}