/* ============================================================
   ABOGIX — Estilos principales
   Paleta corporativa: marino oscuro + dorado
   ============================================================ */

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

:root {
    /* Paleta Abogix */
    --dark:        #0f1923;
    --dark-2:      #1a2635;
    --dark-3:      #243040;
    --gold:        #c9a227;
    --gold-light:  #e8c250;
    --gold-bg:     rgba(201,162,39,.12);

    /* Panel / UI claro */
    --blue:        #1a56db;
    --blue-dark:   #1447b8;
    --blue-light:  #eff4ff;
    --text:        #111827;
    --text-muted:  #6b7280;
    --border:      #e5e7eb;
    --bg:          #f9fafb;
    --white:       #ffffff;
    --radius:      8px;
    --radius-lg:   12px;
    --shadow:      0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
    --shadow-md:   0 4px 12px rgba(0,0,0,.12);
    --success-bg:  #f0fdf4;
    --success-txt: #166534;
    --error-bg:    #fef2f2;
    --error-txt:   #991b1b;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
}

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

/* ── Header público (oscuro con dorado) ── */
.site-header {
    background: var(--dark);
    border-bottom: 1px solid rgba(201,162,39,.2);
    padding: 14px 0;
}
.site-header .inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.site-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    font-size: 20px;
    font-weight: 700;
    color: var(--white);
    letter-spacing: -.3px;
}
.site-logo span { color: var(--gold); }
.site-logo img { height: 32px; width: auto; }

.site-nav { display: flex; align-items: center; gap: 20px; }
.site-nav a {
    color: rgba(255,255,255,.75);
    font-size: 14px;
    text-decoration: none;
    transition: color .15s;
}
.site-nav a:hover { color: var(--white); }
.site-nav .btn-gold {
    background: var(--gold);
    color: var(--dark);
    font-weight: 600;
    padding: 8px 18px;
    border-radius: var(--radius);
    font-size: 14px;
    transition: background .15s;
}
.site-nav .btn-gold:hover { background: var(--gold-light); }

/* ── Footer oscuro ── */
.site-footer {
    background: var(--dark);
    color: rgba(255,255,255,.7);
    padding: 48px 0 0;
    margin-top: 60px;
}
.site-footer .footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 40px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.site-footer .footer-brand .site-logo { margin-bottom: 12px; }
.site-footer .footer-brand p { font-size: 13px; line-height: 1.6; }
.site-footer h4 {
    color: var(--white);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    margin-bottom: 14px;
}
.site-footer ul { list-style: none; }
.site-footer ul li { margin-bottom: 8px; }
.site-footer ul a {
    color: rgba(255,255,255,.6);
    font-size: 13px;
    text-decoration: none;
    transition: color .15s;
}
.site-footer ul a:hover { color: var(--gold); }
.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    font-size: 12px;
    color: rgba(255,255,255,.4);
    flex-wrap: wrap;
    gap: 8px;
}
.footer-bottom a { color: rgba(255,255,255,.4); text-decoration: none; }
.footer-bottom a:hover { color: rgba(255,255,255,.7); }
.footer-legal {
    background: rgba(0,0,0,.2);
    padding: 12px 0;
    text-align: center;
    font-size: 11px;
    color: rgba(255,255,255,.3);
    line-height: 1.5;
}

/* ── Auth pages ── */
.auth-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
}
.auth-page .auth-header {
    background: var(--dark);
    padding: 16px 0;
    text-align: center;
    border-bottom: 1px solid rgba(201,162,39,.2);
}
.auth-page .auth-body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 16px;
}

.auth-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 40px;
    width: 100%;
    max-width: 420px;
}

.auth-logo {
    font-size: 20px;
    margin-bottom: 28px;
}
.auth-logo a { color: var(--text); }
.auth-logo strong { color: var(--gold); }

.auth-card h1 {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 6px;
}

.auth-subtitle {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 24px;
}

.auth-footer {
    text-align: center;
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 20px;
}

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

label {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text);
}

.label-link {
    font-weight: 400;
    color: var(--blue);
    font-size: 13px;
}

.hint {
    font-weight: 400;
    color: var(--text-muted);
    font-size: 13px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="url"],
textarea,
select {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 15px;
    color: var(--text);
    background: var(--white);
    transition: border-color .15s, box-shadow .15s;
    outline: none;
}

input:focus, textarea:focus, select:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(26,86,219,.12);
}

textarea { resize: vertical; min-height: 100px; }

/* ── Botones ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 500;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background .15s, opacity .15s;
    text-decoration: none;
}

.btn-primary {
    background: var(--gold);
    color: var(--dark);
    border-color: var(--gold);
    font-weight: 600;
}
.btn-primary:hover { background: var(--gold-light); border-color: var(--gold-light); text-decoration: none; }

.btn-secondary {
    background: var(--white);
    color: var(--text);
    border-color: var(--border);
}
.btn-secondary:hover { background: var(--bg); }

.btn-danger {
    background: #dc2626;
    color: #fff;
    border-color: #dc2626;
}
.btn-danger:hover { background: #b91c1c; }

.btn-block { width: 100%; }

.btn-sm { padding: 6px 14px; font-size: 13px; }

/* ── Alertas ── */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 14px;
    margin-bottom: 20px;
    line-height: 1.5;
}
.alert-success { background: var(--success-bg); color: var(--success-txt); }
.alert-error   { background: var(--error-bg);   color: var(--error-txt);   }
.alert-info    { background: var(--blue-light);  color: var(--blue-dark);   }

/* ── Layout principal (panel y directorio) ── */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

.page-header {
    background: var(--dark);
    border-bottom: 1px solid rgba(201,162,39,.2);
    padding: 14px 0;
}

.page-header .inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.logo { font-size: 18px; font-weight: 700; color: var(--gold); }
.logo span { color: var(--white); }

.nav { display: flex; align-items: center; gap: 20px; font-size: 14px; }
.nav a { color: rgba(255,255,255,.75); text-decoration: none; }
.nav a:hover { color: var(--white); }

/* ── Panel lateral ── */
.panel-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 32px;
    padding: 32px 0;
    min-height: calc(100vh - 60px);
}

.sidebar {
    font-size: 14px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border-radius: var(--radius);
    color: var(--text-muted);
    transition: background .12s, color .12s;
    margin-bottom: 2px;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: var(--blue-light);
    color: var(--blue);
    text-decoration: none;
}

/* ── Tarjetas de panel ── */
.card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 20px;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

/* ── Directorio público ── */
.despacho-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 28px;
}

.despacho-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow);
    transition: box-shadow .15s, transform .15s;
}

.despacho-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    text-decoration: none;
}

.despacho-card h3 { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.despacho-card .provincia { font-size: 13px; color: var(--text-muted); margin-bottom: 10px; }

.tag {
    display: inline-block;
    background: var(--blue-light);
    color: var(--blue-dark);
    font-size: 12px;
    padding: 3px 9px;
    border-radius: 20px;
    margin: 2px 2px 2px 0;
}

/* ── Estado de suscripción ── */
.badge {
    display: inline-block;
    font-size: 12px;
    font-weight: 500;
    padding: 3px 10px;
    border-radius: 20px;
}
.badge-active    { background: #dcfce7; color: #166534; }
.badge-pending   { background: #fef9c3; color: #854d0e; }
.badge-canceled  { background: #fee2e2; color: #991b1b; }
.badge-past-due  { background: #ffedd5; color: #9a3412; }

/* ── Utilidades ── */
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 13px; }
.flex { display: flex; align-items: center; gap: 10px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.w-full { width: 100%; }

/* ── Hero del directorio ── */
.dir-hero {
    background: var(--dark);
    padding: 52px 0 44px;
    color: #fff;
}
.dir-hero h1 { font-size: 30px; font-weight: 700; margin-bottom: 8px; color: #fff; }
.dir-hero p  { opacity: .8; margin-bottom: 28px; font-size: 16px; }
.dir-hero input,
.dir-hero select {
    background: rgba(255,255,255,.12);
    border-color: rgba(255,255,255,.25);
    color: #fff;
}
.dir-hero input::placeholder { color: rgba(255,255,255,.5); }
.dir-hero select option { background: var(--dark-2); color: #fff; }
.dir-hero .btn-search {
    background: var(--gold);
    color: var(--dark);
    font-weight: 600;
    border: none;
    white-space: nowrap;
}
.dir-hero .btn-search:hover { background: var(--gold-light); }

@media (max-width: 768px) {
    .panel-layout { grid-template-columns: 1fr; }
    .auth-card { padding: 28px 20px; }
    .despacho-grid { grid-template-columns: 1fr; }
    .site-footer .footer-grid { grid-template-columns: 1fr; gap: 24px; }
    .dir-hero h1 { font-size: 22px; }
}
