/* Variables de colores: Blanco por defecto, colores APV Services */
:root {
    --bg-color: #ffffff;
    --text-color: #333333;
    --primary-color: #003049;
    --secondary-color: #D62828;
    --accent-color: #F77F00;
    --input-bg: #f5f5f5;
    --border-color: #cccccc;
    --card-shadow: rgba(0, 48, 73, 0.1);
}

/* Variables para el Modo Oscuro */
[data-theme="dark"] {
    --bg-color: #121212;
    --text-color: #f1f1f1;
    --primary-color: #00527a; /* Un azul un poco más claro para contraste oscuro */
    --input-bg: #1e1e1e;
    --border-color: #444444;
    --card-shadow: rgba(0, 0, 0, 0.5);
}

/* Reseteo general y tipografía sobria */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

/* Contenedor tipo tarjeta (Login/Registro) */
.auth-container {
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 8px 25px var(--card-shadow);
    width: 90%;
    max-width: 400px;
    position: relative;
}

.auth-container h2 {
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 25px;
    font-weight: 600;
}

/* Campos de formulario */
.form-group {
    margin-bottom: 20px;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    background-color: var(--input-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    border-radius: 6px;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 5px rgba(247, 127, 0, 0.3);
}

/* Botones principales */
.btn {
    width: 100%;
    padding: 12px;
    background-color: var(--primary-color);
    color: #ffffff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: background 0.3s ease;
    margin-top: 10px;
}

.btn:hover {
    background-color: var(--secondary-color);
}

/* Enlaces inferiores */
.auth-links {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
}

.auth-links a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
}

.auth-links a:hover {
    text-decoration: underline;
}

/* REGLA CORREGIDA: El interruptor ahora es flexible por defecto */
.theme-switch-wrapper {
    display: flex;
    align-items: center;
    z-index: 100;
}

/* Anulamos la posición fija para que respete el contenedor central */
.auth-container .theme-switch-wrapper {
    position: relative !important;
    top: 0 !important;
    right: 0 !important;
    margin-top: 0;
}

/* Centramos el título del login/registro para mejor estética */
.auth-container h2 {
    margin-top: 0;
    font-size: 24px;
}

/* El interruptor (la parte visual) se mantiene igual */
.theme-switch {
    display: inline-block;
    height: 28px;
    position: relative;
    width: 50px;
}

.theme-switch input { display: none; }

.slider {
    background-color: var(--border-color);
    bottom: 0; cursor: pointer; left: 0;
    position: absolute; right: 0; top: 0;
    transition: .4s; border-radius: 34px;
}

.slider:before {
    background-color: #ffffff;
    bottom: 4px; content: ""; height: 20px;
    left: 4px; position: absolute;
    transition: .4s; width: 20px; border-radius: 50%;
}

input:checked + .slider { background-color: var(--primary-color); }
input:checked + .slider:before { transform: translateX(22px); }