/* =========================================================
   SISTEMA DE DISEÑO PROPIO — VARIABLES GLOBALES
   ========================================================= */
:root {
    --primary: #1d6f42;
    --primary-dark: #14502f;
    --secondary: #0f4c81;
    --success: #1d8a4e;
    --danger: #c62828;
    --warning: #b8860b;
    --background: #f4f6f5;
    --surface: #ffffff;
    --text: #1c2321;
    --muted: #6b7570;
    --border: #e1e5e2;
    --radius: 10px;
    --radius-sm: 6px;
    --shadow: 0 2px 10px rgba(20, 30, 25, 0.08);
    --shadow-md: 0 6px 24px rgba(20, 30, 25, 0.12);
    --font: 'Segoe UI', Roboto, -apple-system, BlinkMacSystemFont, sans-serif;
    --transition: 180ms ease;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font);
    background: var(--background);
    color: var(--text);
    line-height: 1.5;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* =========================================================
   LAYOUT DE AUTENTICACIÓN
   ========================================================= */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-dark), var(--secondary));
    padding: 20px;
}

.auth-card {
    background: var(--surface);
    width: 100%;
    max-width: 400px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 40px 32px;
    animation: fadeInUp 300ms ease;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.auth-logo {
    text-align: center;
    margin-bottom: 24px;
}

.auth-logo .badge-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.auth-logo h1 {
    font-size: 1.25rem;
    margin: 0;
    color: var(--text);
}

.auth-logo p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 0.875rem;
}

/* =========================================================
   FORMULARIOS
   ========================================================= */
.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text);
}

.form-control {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-family: inherit;
    background: var(--surface);
    color: var(--text);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(29, 111, 66, 0.15);
}

.form-control.is-invalid {
    border-color: var(--danger);
}

.form-error {
    color: var(--danger);
    font-size: 0.8rem;
    margin-top: 4px;
    display: none;
}

.form-error.show { display: block; }

.form-hint {
    color: var(--muted);
    font-size: 0.8rem;
    margin-top: 4px;
}

/* =========================================================
   BOTONES
   ========================================================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 18px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition), transform var(--transition), opacity var(--transition);
}

.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-primary {
    background: var(--primary);
    color: #fff;
}
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); }

.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-secondary:hover:not(:disabled) { background: var(--background); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-block { width: 100%; }

/* =========================================================
   ALERTAS / NOTIFICACIONES
   ========================================================= */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    border: 1px solid transparent;
}

.alert-success { background: #e7f6ec; color: var(--success); border-color: #b9e4c6; }
.alert-danger  { background: #fdecec; color: var(--danger);  border-color: #f5c2c2; }
.alert-warning { background: #fdf3e0; color: var(--warning); border-color: #f0dca3; }

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    min-width: 260px;
    max-width: 340px;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    background: var(--surface);
    border-left: 4px solid var(--primary);
    font-size: 0.875rem;
    animation: slideIn 220ms ease;
}

.toast.toast-success { border-left-color: var(--success); }
.toast.toast-danger  { border-left-color: var(--danger); }
.toast.toast-warning { border-left-color: var(--warning); }

@keyframes slideIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* =========================================================
   LOADER
   ========================================================= */
.loader {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 700ms linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* =========================================================
   UTILIDADES
   ========================================================= */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--muted); }
.mt-16 { margin-top: 16px; }
.small { font-size: 0.8rem; }
