/* ==========================================================
   Tokens de diseño
   ========================================================== */
:root {
    --ink: #1A1B29;
    --ink-soft: #5B5D74;
    --bg: #F4F5FA;
    --surface: #FFFFFF;
    --border: #E3E5EF;
    --primary: #5B4FE9;
    --primary-dark: #4438C7;
    --primary-soft: #EEECFD;
    --success-bg: #E8F8EE;
    --success-text: #1FAA59;
    --error-bg: #FDEDED;
    --error-text: #E14B4B;
    --radius: 14px;
    --font-display: 'Space Grotesk', 'Segoe UI', sans-serif;
    --font-body: 'Inter', 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font-body);
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .brand {
    font-family: var(--font-display);
}

a { color: inherit; }

button, input {
    font-family: inherit;
}

/* ==========================================================
   Pantalla de login / registro (panel dividido)
   ========================================================== */
.auth-screen {
    display: flex;
    min-height: 100vh;
}

.auth-panel {
    flex: 1 1 42%;
    background: linear-gradient(155deg, var(--primary) 0%, #8477F0 60%, #B6ACFF 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px;
    position: relative;
    overflow: hidden;
}

.auth-panel-inner {
    max-width: 380px;
    position: relative;
    z-index: 2;
}

.auth-panel h1 {
    font-size: 2.1rem;
    line-height: 1.2;
    margin: 20px 0 14px;
}

.panel-text {
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.6;
    font-size: 0.98rem;
}

.panel-decor {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.panel-decor .dot {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
}

.dot-1 { width: 260px; height: 260px; right: -80px; top: -60px; }
.dot-2 { width: 160px; height: 160px; left: -50px; bottom: 60px; }
.dot-3 { width: 90px;  height: 90px;  right: 60px;  bottom: -30px; background: rgba(255,255,255,0.18); }

.form-panel {
    flex: 1 1 58%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
}

.form-card {
    width: 100%;
    max-width: 380px;
}

.form-card h2 {
    font-size: 1.6rem;
    margin: 0 0 6px;
}

.form-subtitle {
    color: var(--ink-soft);
    margin: 0 0 24px;
    font-size: 0.94rem;
}

.brand{

    height:90px;

    width:auto;

    display:block;

}

.sidebar .brand-mark { background: var(--primary-soft); color: var(--primary); }

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

label {
    display: block;
    font-size: 0.86rem;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--ink-soft);
}

input[type="text"],
input[type="email"],
input[type="password"] {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    font-size: 0.95rem;
    color: var(--ink);
    transition: border-color .15s ease, box-shadow .15s ease;
}

input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

input.invalid {
    border-color: var(--error-text);
}

.password-field {
    position: relative;
}

.password-field input {
    padding-right: 42px;
}

.toggle-password {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    opacity: 0.6;
    padding: 4px;
}

.field-error {
    display: block;
    min-height: 16px;
    color: var(--error-text);
    font-size: 0.78rem;
    margin-top: 4px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 16px;
    border-radius: 10px;
    border: 1px solid transparent;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s ease, transform .05s ease;
}

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

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover { background: var(--primary-dark); }

.btn-google {
    background: var(--surface);
    color: var(--ink);
    border-color: var(--border);
}

.btn-google:hover { background: #FAFAFD; }

.btn-logout {
    background: var(--surface);
    color: var(--ink-soft);
    border-color: var(--border);
    margin-top: auto;
}

.divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--ink-soft);
    font-size: 0.82rem;
    margin: 20px 0;
}

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

.divider span { padding: 0 12px; }

.switch-auth {
    text-align: center;
    margin-top: 22px;
    font-size: 0.9rem;
    color: var(--ink-soft);
}

.switch-auth a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

.alert {
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.88rem;
    margin-bottom: 18px;
}

.alert-success { background: var(--success-bg); color: var(--success-text); }
.alert-error   { background: var(--error-bg);   color: var(--error-text); }

/* ==========================================================
   Dashboard (lo que se ve tras iniciar sesión)
   ========================================================== */
.dashboard {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 220px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 24px 18px;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-nav a {
    padding: 10px 12px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--ink-soft);
    font-size: 0.92rem;
    font-weight: 500;
}

.sidebar-nav a.active,
.sidebar-nav a:hover {
    background: var(--primary-soft);
    color: var(--primary);
}

.dashboard-content {
    flex: 1;
    padding: 36px 44px;
}

.dashboard-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 32px;
}

.dashboard-header h1 {
    font-size: 1.7rem;
    margin: 0 0 6px;
}

.dashboard-header p {
    color: var(--ink-soft);
    margin: 0;
    max-width: 420px;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 8px 14px 8px 8px;
    border-radius: 999px;
    font-size: 0.86rem;
    color: var(--ink-soft);
    white-space: nowrap;
}

.user-chip img, .avatar-placeholder {
    width: 30px;
    height: 30px;
    border-radius: 50%;
}

.avatar-placeholder {
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 18px;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}

.card h3 {
    margin: 0 0 8px;
    font-size: 1rem;
}

.card p {
    margin: 0;
    color: var(--ink-soft);
    font-size: 0.9rem;
    line-height: 1.5;
}

.card code {
    background: var(--bg);
    padding: 2px 5px;
    border-radius: 5px;
    font-size: 0.85em;
}

/* ==========================================================
   Responsive
   ========================================================== */
@media (max-width: 860px) {
    .auth-screen { flex-direction: column; }
    .auth-panel { padding: 36px 28px; }
    .auth-panel h1 { font-size: 1.6rem; }
    .form-panel { padding: 28px; }
    .dashboard { flex-direction: column; }
    .sidebar { width: 100%; flex-direction: row; align-items: center; justify-content: space-between; }
    .sidebar-nav { flex-direction: row; }
    .dashboard-content { padding: 24px; }
    .dashboard-header { flex-direction: column; }
}
