@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&family=Outfit:wght@100..900&display=swap');

:root {
    /* Paleta Light Minimalist */
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --primary: #2d5a27;
    --primary-light: #44803b;
    --accent: #d4994a;
    --accent-hover: #b9843a;
    --text-main: #1a202c;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --error: #ef4444;
    --success: #22c55e;

    /* Tipografía */
    --font-display: 'Outfit', sans-serif;
    --font-body: 'DM Sans', sans-serif;

    /* Curvas de animación (Emil Kowalski) */
    --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
    --radius: 12px;
}

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

body {
    background-color: var(--bg-main);
    font-family: var(--font-body);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
    font-family: var(--font-display);
    font-weight: 600;
}

/* --- Layout Mobile First --- */
.container {
    padding: 12px; /* Espacio mínimo en móvil */
    width: 100%;
}

@media (min-width: 640px) {
    .container {
        padding: 24px;
        max-width: 1200px;
        margin: 0 auto;
    }
}

/* --- Módulo Login Rediseñado --- */
.login-wrapper {
    min-height: 100vh;
    background-color: var(--bg-main);
    overflow-x: hidden;
}

.login-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
}

.login-image {
    display: none; /* Móvil: Sólo formulario */
    position: relative;
    height: 300px;
    background-color: var(--primary);
}

.login-image .bg-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.login-image-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.2), rgba(0,0,0,0.4));
    z-index: 1;
}

.login-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
    background: radial-gradient(circle at top right, #f1f5f9, #f8fafc);
    z-index: 2;
}

.login-card {
    background: var(--bg-card);
    width: 100%;
    max-width: 420px;
    padding: 40px 32px;
    border-radius: var(--radius);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border);
    opacity: 0;
    transform: translateY(15px);
    animation: fadeIn 0.6s var(--ease-out) forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Vista Tablet (768px a 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
    .login-container {
        flex-direction: column;
    }
    
    .login-content {
        order: 1;
        padding-bottom: 60px;
    }
    
    .login-image {
        display: block;
        height: 350px;
        order: 2;
    }
}

/* Vista Desktop (1024px+) */
@media (min-width: 1024px) {
    .login-container {
        flex-direction: row;
    }
    
    .login-image {
        display: block;
        flex: 1.2;
        height: 100vh;
        order: 1;
    }
    
    .login-content {
        flex: 1;
        height: 100vh;
        order: 2;
        background: var(--bg-card);
    }
    
    .login-card {
        box-shadow: none;
        border: none;
        max-width: 480px;
        padding: 0 40px;
    }
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo {
    max-width: 240px;
    height: auto;
    margin-bottom: 24px;
    display: inline-block;
}

.login-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.login-footer {
    margin-top: 24px;
    text-align: center;
}

.forgot-password {
    color: var(--text-muted);
    font-size: 0.875rem;
    text-decoration: none;
    transition: color 0.2s var(--ease-out);
}

.forgot-password:hover {
    color: var(--primary);
    text-decoration: underline;
}

/* --- Modales --- */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s var(--ease-out);
}

.modal.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: var(--bg-card);
    width: 90%;
    max-width: 450px;
    padding: 32px;
    border-radius: var(--radius);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    transform: scale(0.95);
    transition: transform 0.3s var(--ease-out);
}

.modal.active .modal-content {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.modal-header h3 {
    margin: 0;
}

.btn-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    transition: color 0.2s;
}

.btn-close:hover {
    color: var(--text-main);
}

/* --- Formulario --- */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.875rem;
    font-weight: 500;
}

.form-control {
    width: 100%;
    height: 48px;
    padding: 0 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: all 0.2s var(--ease-out);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(45, 90, 39, 0.1);
}

.password-wrapper {
    position: relative;
    width: 100%;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
    z-index: 10;
}

.password-toggle:hover {
    color: var(--text-main);
}

.password-wrapper .form-control {
    padding-right: 46px;
}

.btn {
    width: 100%;
    height: 50px;
    background-color: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.1s var(--ease-out), background 0.2s;
    margin-top: 12px;
}

.btn:hover {
    background-color: var(--accent-hover);
}

.btn:active {
    transform: scale(0.97);
}

.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background-color: white;
    color: #444;
    border: 1px solid var(--border);
    margin-top: 12px;
    transition: all 0.2s var(--ease-out);
    text-decoration: none;
    height: 50px;
    border-radius: var(--radius);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    width: 100%;
}

.btn-google:hover {
    background-color: #f8fafc;
    border-color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.google-icon {
    width: 20px;
    height: 20px;
}

.login-divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin: 24px 0;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border);
}

.login-divider::before {
    margin-right: 12px;
}

.login-divider::after {
    margin-left: 12px;
}

.alert {
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.alert-danger {
    background-color: #fef2f2;
    color: var(--error);
    border: 1px solid #fee2e2;
}

/* Dashboard Skeleton */
.dashboard-wrapper {
    display: grid;
    grid-template-columns: 1fr;
    min-height: 100vh;
}

@media (min-width: 1024px) {
    .dashboard-wrapper {
        grid-template-columns: 260px 1fr;
    }
}

.sidebar {
    background-color: var(--primary);
    color: white;
    padding: 24px;
}

.main-content {
    padding: 24px;
}
