/* Variables CSS para tema consistente */
:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --accent-color: #059669;
    --warning-color: #d97706;
    --error-color: #dc2626;
    --success-color: #16a34a;

    --background-color: #f8fafc;
    --surface-color: #ffffff;
    --border-color: #e2e8f0;
    --input-border: #cbd5e1;
    --input-focus: #3b82f6;

    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;

    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md:
        0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg:
        0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);

    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;

    --spacing-xs: 0.5rem;
    --spacing-sm: 0.75rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
}

/* Reset y base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Estilos para la aplicación principal */
/* Solo aplicar este fondo cuando hay página de autenticación */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    background-color: #f4f4f5;
}

/* Estilos para la página de login usando el mismo estilo que la página principal */
#loginPage {
    background-color: #f4f4f5;
}

#loginPage h1 {
    text-align: center;
    background-color: #f9f9ff;
    padding: 20px;
    margin: 0;
}

#loginForm {
    background: #f1f1f3;
    padding: 20px;
    border-radius: 5px;
    max-width: 500px;
    margin: 20px auto;
}

#loginForm label {
    display: block;
    margin-top: 15px;
    font-weight: bold;
}

#loginForm input {
    width: 100%;
    padding: 12px;
    margin-top: 5px;
    box-sizing: border-box;
    background: #f8f6fc;
    border: 1px solid #ddd;
    border-radius: 4px;
}

#loginForm input:focus {
    outline: none;
    border-color: #100dd4;
    box-shadow: 0 0 5px rgba(16, 13, 212, 0.3);
}

#loginForm button {
    margin-top: 20px;
    padding: 10px 20px;
    background: #100dd4;
    color: #fdfdff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    width: 100%;
}

#loginForm button:hover {
    background: #0e0bb5;
}

#loginForm button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Solo aplicar este fondo cuando hay página de autenticación */
body.auth-mode {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

h1 {
    text-align: center;
    background-color: #f9f9ff;
    padding: 20px;
    margin: 0;
}

/* Estilos específicos para formularios de la aplicación principal */
#visitForm {
    background: #f1f1f3;
    padding: 20px;
    border-radius: 5px;
    max-width: 1000px;
    margin: auto;
}

#visitForm label {
    display: block;
    margin-top: 15px;
    font-weight: bold;
}

#visitForm input,
#visitForm textarea,
#visitForm select {
    width: 100%;
    padding: 12px;
    margin-top: 5px;
    box-sizing: border-box;
    background: #f8f6fc;
    border: 1px solid #ddd;
    border-radius: 4px;
}

#visitForm input:focus,
#visitForm textarea:focus,
#visitForm select:focus {
    outline: none;
    border-color: #100dd4;
    box-shadow: 0 0 5px rgba(16, 13, 212, 0.3);
}

#visitForm button {
    margin-top: 20px;
    padding: 10px 20px;
    background: #100dd4;
    color: #fdfdff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

#visitForm button:hover {
    background: #0e0bb5;
}

#visitForm button[type="button"] {
    background: #6c757d;
    margin-top: 10px;
    margin-right: 10px;
}

#visitForm button[type="button"]:hover {
    background: #5a6268;
}

canvas {
    display: block;
    margin: 10px 0;
    border: 1px solid #000;
    border-radius: 4px;
}

/* Responsive design para la aplicación principal */
@media (max-width: 768px) {
    #visitForm {
        margin: 10px;
        padding: 15px;
    }

    h1 {
        font-size: 1.5rem;
        padding: 15px;
    }

    #visitForm input,
    #visitForm textarea,
    #visitForm select {
        padding: 10px;
    }

    canvas {
        width: 100%;
        max-width: 300px;
    }
}

@media (max-width: 480px) {
    #visitForm {
        margin: 5px;
        padding: 10px;
    }

    h1 {
        font-size: 1.2rem;
        padding: 10px;
    }

    #visitForm button {
        width: 100%;
        padding: 12px;
    }
}

/* Estilos para el sistema de autenticación */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.auth-form {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
}

.auth-form h2 {
    text-align: center;
    margin-bottom: 0.5rem;
    color: #333;
    font-size: 1.5rem;
}

.auth-subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 2rem;
    font-style: italic;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #333;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s;
    background: white;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.auth-form button {
    width: 100%;
    padding: 0.75rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s;
    margin-top: 1rem;
}

.auth-form button:hover {
    transform: translateY(-2px);
}

.auth-form button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    color: #666;
    font-size: 0.9rem;
}

.error-message {
    display: none;
    background: #fee;
    color: #c33;
    padding: 0.75rem;
    border-radius: 5px;
    margin-top: 1rem;
    border: 1px solid #fcc;
    text-align: center;
}

/* Header de usuario autenticado */
.user-header {
    background: #f8f9fa;
    padding: 1rem;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-info {
    color: #495057;
}

.logout-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
}

.logout-btn:hover {
    background: #c82333;
}
