/*
* Archivo: assets/css/style.css
* Fecha y Hora: 22 de octubre de 2025, 10:25
* Propósito: Contiene todos los estilos visuales del sitio.
* Última mejora: Se añadió un estilo para el mensaje de advertencia (`.auth-message.warning`) en el dashboard.
*/

/* --- Variables de Color y Diseño --- */
:root {
    --bg-dark: #1C1C1E;
    --text-light: #F2F2F7;
    --text-secondary: #8E8E93;
    --accent-blue: #007AFF;
    --surface-dark: #2C2C2E;
    --border-dark: #3A3A3C;
    --danger-red: #FF3B30;
    --success-green: #34C759;
    --warning-yellow: #FF9500; /* Nuevo color */
    --font-main: 'Inter', sans-serif;
}

/* --- Estilos Base --- */
body {
    background-color: var(--bg-dark);
    color: var(--text-light);
    font-family: var(--font-main);
    margin: 0;
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* --- Cabecera --- */
.main-header {
    padding: 20px 0;
    border-bottom: 1px solid transparent;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}
.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-light);
    text-decoration: none;
}
.main-header nav a {
    color: var(--text-secondary);
    text-decoration: none;
    margin-left: 20px;
    vertical-align: middle;
}
.main-header nav .user-info {
    color: var(--text-light);
    margin-right: 10px;
    vertical-align: middle;
}

/* --- Sección Principal (Hero) --- */
.hero {
    text-align: center;
    padding: 80px 20px;
}
.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 10px;
}
.hero .subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 40px;
}

/* --- Formulario Generador --- */
.qr-generator-form {
    display: flex;
    justify-content: center;
    gap: 10px;
}
.qr-generator-form input[type="url"] {
    width: 60%;
    padding: 15px 20px;
    background-color: var(--surface-dark);
    border: 1px solid var(--border-dark);
    border-radius: 12px;
    color: var(--text-light);
    font-size: 1rem;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    vertical-align: middle;
}
.btn-primary {
    background-color: var(--accent-blue);
    color: white;
}
.btn-secondary {
    background-color: var(--surface-dark);
    color: var(--text-light);
}
.btn-danger {
    background-color: var(--danger-red);
    color: white;
}
.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* --- Estilos del Modal --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
}
.modal-content {
    background-color: var(--surface-dark);
    padding: 40px;
    border-radius: 16px;
    text-align: center;
    position: relative;
    width: 90%;
    max-width: 400px;
}
.close-button {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 2rem;
    cursor: pointer;
}
#qr-code-container img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 20px 0;
    background-color: white;
    padding: 10px;
    box-sizing: border-box;
}
.modal-actions {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}
.register-prompt {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
}
.register-prompt a {
    color: var(--accent-blue);
    text-decoration: none;
}

/* --- Formularios de Autenticación (Login/Registro) --- */
.auth-form {
    max-width: 450px;
    text-align: center;
    padding-top: 40px;
    padding-bottom: 40px;
}
.form-group {
    margin-bottom: 20px;
    text-align: left;
}
.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}
.form-group input {
    width: 100%;
    padding: 15px 20px;
    background-color: var(--surface-dark);
    border: 1px solid var(--border-dark);
    border-radius: 12px;
    color: var(--text-light);
    font-size: 1rem;
    box-sizing: border-box;
}
.btn-full {
    width: 100%;
}
.auth-switch {
    margin-top: 30px;
    color: var(--text-secondary);
}
.auth-switch a {
    color: var(--accent-blue);
    text-decoration: none;
    font-weight: 600;
}
.auth-links {
    margin-top: 20px;
    font-size: 0.9rem;
}
.auth-links a {
    color: var(--text-secondary);
    text-decoration: none;
}
.auth-links a:hover {
    color: var(--text-light);
}
.auth-links span {
    color: var(--border-dark);
    margin: 0 10px;
}
.auth-message {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 8px;
    font-weight: 600;
}
.auth-message.error {
    background-color: rgba(255, 59, 48, 0.2);
    color: var(--danger-red);
}
.auth-message.success {
    background-color: rgba(52, 199, 89, 0.2);
    color: var(--success-green);
}
.auth-message.warning { /* Estilo para advertencia */
    background-color: rgba(255, 149, 0, 0.2);
    color: var(--warning-yellow);
}
.password-group {
    position: relative;
}
.toggle-password {
    position: absolute;
    right: 15px;
    top: 48px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
}

/* --- Estilos del Dashboard --- */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px; /* Reducido para acercar el mensaje de advertencia */
}
/* Separar el mensaje de advertencia de la lista */
.auth-message.warning {
    margin-bottom: 40px; 
}
.qr-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.qr-item {
    background-color: var(--surface-dark);
    border: 1px solid var(--border-dark);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    gap: 20px;
    align-items: center;
}
.qr-details {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}
.qr-name {
    font-size: 1rem;
    color: var(--text-light);
    word-break: break-all;
}
.qr-date {
    font-size: 0.8rem;
    color: var(--text-secondary);
}
.qr-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background-color: var(--surface-dark);
    border-radius: 16px;
}
.empty-state h2 {
    margin-top: 0;
}
.empty-state a {
    color: var(--accent-blue);
    font-weight: 600;
}

/* --- Pie de Página --- */
.main-footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}
.copyright a {
    color: var(--text-secondary);
    text-decoration: none;
}
.copyright a:hover {
    text-decoration: underline;
}

/* --- Estilos para el Toggle Switch (Cápsula) --- */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}
.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--surface-dark);
    transition: .4s;
    border-radius: 34px;
}
.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: #FFF;
    transition: .4s;
    border-radius: 50%;
}
input:checked + .slider {
    background-color: var(--accent-blue);
}
input:checked + .slider:before {
    transform: translateX(26px);
}

/* ========= MODO CLARO ========= */
body.light-mode {
    --bg-dark: #FFFFFF;
    --text-light: #1C1C1E;
    --text-secondary: #636366;
    --surface-dark: #F2F2F7;
    --border-dark: #D1D1D6;
}