/* ------------------------------------------------------------------
   Portal de Clientes SGE4 — estilos
   Reutiliza la paleta y la tipografia del sitio (styles.css) y del
   backoffice. Shell con prefijo pc- (portal cliente).
------------------------------------------------------------------ */

:root {
    --primary-color: #0094FF;
    --secondary-color: #808080;
    --accent-color: #f59e0b;
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --white: #ffffff;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --danger: #dc2626;
    --success: #16a34a;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

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

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-dark);
    background: var(--gray-50);
    line-height: 1.5;
}

.hidden { display: none !important; }

/* ---------- Botones ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 18px;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-weight: 500;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}
.btn-primary { background: linear-gradient(135deg, var(--primary-color), var(--secondary-color)); color: var(--white); box-shadow: var(--shadow-sm); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-secondary { background: var(--gray-100); color: var(--gray-700); }
.btn-secondary:hover { background: var(--gray-200); }
.btn-danger { background: var(--danger); color: var(--white); }
.btn-danger:hover { filter: brightness(0.93); }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 6px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }

/* ---------- Login ---------- */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    padding: 20px;
}
.login-card {
    width: 100%;
    max-width: 380px;
    background: var(--white);
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
    padding: 36px 32px;
}
.login-card h1 { font-size: 20px; color: var(--text-dark); margin-bottom: 4px; }
.login-card p.sub { color: var(--text-light); font-size: 14px; margin-bottom: 24px; }
.login-card .field { margin-bottom: 16px; }
.login-card .btn { width: 100%; }
.login-foot { font-size: 12.5px; color: var(--text-light); margin-top: 18px; text-align: center; }
.login-foot a { color: var(--primary-color); text-decoration: none; }
.login-foot a:hover { text-decoration: underline; }

/* ---------- App shell ---------- */
.pc-header {
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 10;
}
.pc-header .brand { font-size: 17px; font-weight: 600; letter-spacing: .2px; }
.pc-header .user { display: flex; align-items: center; gap: 14px; font-size: 14px; }

.pc-body { display: flex; min-height: calc(100vh - 60px); }

.pc-side {
    width: 220px;
    background: var(--white);
    border-right: 1px solid var(--gray-200);
    padding: 16px 12px;
    flex-shrink: 0;
}
.pc-side button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 11px 14px;
    margin-bottom: 4px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--gray-700);
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}
.pc-side button:hover { background: var(--gray-100); }
.pc-side button.active { background: rgba(0, 148, 255, 0.1); color: var(--primary-color); }

.pc-content { flex: 1; padding: 28px 32px; overflow-x: auto; }
.pc-content h2 { font-size: 22px; margin-bottom: 4px; }
.pc-content .page-sub { color: var(--text-light); font-size: 14px; margin-bottom: 22px; }
.pc-content h3 { font-size: 16px; margin: 24px 0 12px; }

/* ---------- Tarjetas (Mi licencia) ---------- */
.card {
    background: var(--white);
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
    padding: 22px 24px;
    margin-bottom: 18px;
    max-width: 820px;
}
.data-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px 24px; }
.data-grid .k { font-size: 12px; text-transform: uppercase; letter-spacing: .3px; color: var(--text-light); font-weight: 600; }
.data-grid .v { font-size: 15px; color: var(--text-dark); }

.code-pill { font-family: 'Courier New', monospace; font-weight: 700; letter-spacing: 2px; background: var(--gray-100); padding: 4px 10px; border-radius: 6px; display: inline-block; }

/* Badges de estado */
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge.ACTIVA { background: #dcfce7; color: #166534; }
.badge.SUSPENDIDA { background: #fef9c3; color: #854d0e; }
.badge.CANCELADA { background: #fee2e2; color: #991b1b; }
.badge.warn { background: #fef9c3; color: #854d0e; }
.badge.ok { background: #dcfce7; color: #166534; }

/* ---------- Catalogos contratado / no contratado (upsell) ---------- */
.cat-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; max-width: 820px; }
.cat-item {
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 12px 14px;
    background: var(--white);
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.cat-item .cat-name { font-weight: 600; font-size: 14px; }
.cat-item .cat-code { font-size: 12px; color: var(--text-light); }
.cat-item .cat-desc { font-size: 13px; color: var(--gray-600); margin-top: 4px; }
.cat-item.has { border-color: rgba(0,148,255,.35); }
.cat-item.has .tick { color: var(--success); font-weight: 700; }
.cat-item.no { opacity: .6; background: var(--gray-50); }
.cat-item.no .cat-cta { font-size: 12px; color: var(--primary-color); margin-top: 6px; text-decoration: none; }
.cat-item.no .cat-cta:hover { text-decoration: underline; }

/* ---------- Descargas ---------- */
.dl-list { display: flex; flex-direction: column; gap: 10px; max-width: 820px; }
.dl-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 14px 16px;
    background: var(--white);
}
.dl-item .dl-meta { font-size: 12.5px; color: var(--text-light); }

/* ---------- Avisos ---------- */
.notice { border-radius: 8px; padding: 14px 16px; font-size: 14px; margin-bottom: 18px; max-width: 820px; }
.notice.warn { background: #fef9c3; color: #854d0e; border: 1px solid #fde68a; }
.notice.info { background: #e0f2fe; color: #075985; border: 1px solid #bae6fd; }

/* ---------- Formularios ---------- */
.pc-form { background: var(--white); border-radius: 10px; box-shadow: var(--shadow-sm); padding: 22px 24px; max-width: 560px; margin-bottom: 18px; }
.pc-form .field { margin-bottom: 16px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
label { display: block; font-size: 13px; font-weight: 600; color: var(--gray-700); margin-bottom: 6px; }
input[type=text], input[type=password], input[type=email], input[type=tel], select, textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    color: var(--text-dark);
    background: var(--white);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(0,148,255,0.12); }
input:disabled { background: var(--gray-100); color: var(--text-light); }
.hint { font-size: 12.5px; color: var(--text-light); margin-top: 4px; }
.form-actions { display: flex; gap: 10px; margin-top: 22px; }

/* ---------- Toast ---------- */
#toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 13px 20px;
    border-radius: 10px;
    color: var(--white);
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    z-index: 100;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.25s ease;
    pointer-events: none;
}
#toast.show { opacity: 1; transform: translateY(0); }
#toast.ok { background: var(--success); }
#toast.err { background: var(--danger); }

.error-msg { color: var(--danger); font-size: 13.5px; margin-top: 10px; min-height: 18px; }

.loading { color: var(--text-light); font-size: 14px; padding: 20px 0; }

@media (max-width: 760px) {
    .pc-side { width: 60px; }
    .pc-side button { font-size: 0; padding: 11px 0; text-align: center; }
    .grid2 { grid-template-columns: 1fr; }
}
