/* ============================================================
   HClinica · Sistema de diseño moderno (v2)
   Archivo único reutilizable por todas las pantallas.
   Servido directamente por nginx: <link href="/css/hclinica-ui.css">
   Cambios visibles recargando (no requiere recompilar).
   ============================================================ */

:root{
  --hc-brand:#0d9488;        /* teal principal */
  --hc-brand-ink:#0f766e;
  --hc-brand-weak:#ccfbf1;
  --hc-accent:#2563eb;
  --hc-bg:#eef2f6;
  --hc-surface:#ffffff;
  --hc-surface-2:#f1f5f9;
  --hc-text:#0f172a;
  --hc-muted:#64748b;
  --hc-faint:#94a3b8;
  --hc-border:#e2e8f0;
  --hc-danger:#b91c1c;
  --hc-danger-weak:#fee2e2;
  --hc-success:#15803d;
  --hc-success-weak:#dcfce7;
  --hc-radius:14px;
  --hc-radius-sm:10px;
  --hc-shadow:0 1px 2px rgba(15,23,42,.04), 0 12px 30px rgba(15,23,42,.08);
  --hc-font:'Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;
}

*{box-sizing:border-box}

/* --- Tipografía y base --- */
.hc-body{
  margin:0;
  font-family:var(--hc-font);
  color:var(--hc-text);
  background:var(--hc-bg);
  -webkit-font-smoothing:antialiased;
  line-height:1.5;
}

/* --- Botones --- */
.hc-btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  width:100%;
  padding:12px 16px;
  border:1px solid var(--hc-border);
  border-radius:var(--hc-radius-sm);
  background:var(--hc-surface);
  color:var(--hc-text);
  font-family:inherit; font-size:15px; font-weight:600;
  cursor:pointer; transition:.15s ease;
}
.hc-btn:hover{ background:var(--hc-surface-2); }
.hc-btn--primary{
  background:var(--hc-brand); border-color:var(--hc-brand); color:#fff;
  box-shadow:0 6px 16px rgba(13,148,136,.28);
}
.hc-btn--primary:hover{ filter:brightness(1.06); background:var(--hc-brand); }
.hc-btn--primary:active{ transform:translateY(1px); }

/* --- Campos de formulario --- */
.hc-field{ margin-bottom:18px; }
.hc-label{
  display:block; margin-bottom:7px;
  font-size:13.5px; font-weight:600; color:var(--hc-text);
}
.hc-input{
  width:100%;
  padding:12px 14px;
  border:1px solid var(--hc-border);
  border-radius:var(--hc-radius-sm);
  background:var(--hc-surface);
  font-family:inherit; font-size:15px; color:var(--hc-text);
  transition:.15s ease;
}
.hc-input::placeholder{ color:var(--hc-faint); }
.hc-input:focus{
  outline:none;
  border-color:var(--hc-brand);
  box-shadow:0 0 0 4px var(--hc-brand-weak);
}

/* --- Campo con botón mostrar/ocultar contraseña --- */
.hc-pw{ position:relative; }
.hc-pw .hc-input{ padding-right:48px; }
.hc-pw__toggle{
  position:absolute; right:8px; top:50%; transform:translateY(-50%);
  width:36px; height:36px; display:flex; align-items:center; justify-content:center;
  border:0; background:transparent; cursor:pointer; color:var(--hc-muted);
  border-radius:8px; font-size:18px; line-height:1;
}
.hc-pw__toggle:hover{ background:var(--hc-surface-2); color:var(--hc-text); }

/* --- Avisos --- */
.hc-alert{
  padding:12px 14px; border-radius:var(--hc-radius-sm);
  font-size:14px; margin-bottom:18px; border:1px solid transparent;
}
.hc-alert--error{ background:var(--hc-danger-weak); color:var(--hc-danger); border-color:#fecaca; }
.hc-alert--success{ background:var(--hc-success-weak); color:var(--hc-success); border-color:#bbf7d0; }

/* --- Enlaces --- */
.hc-link{ color:var(--hc-brand-ink); text-decoration:none; font-weight:600; }
.hc-link:hover{ text-decoration:underline; }

/* ============================================================
   Layout de acceso (login / portal)
   ============================================================ */
.hc-auth{
  min-height:100vh;
  display:grid;
  grid-template-columns:1.1fr 1fr;
}
.hc-auth__brandside{
  position:relative;
  background-color:#1e293b;
  background-image:
    linear-gradient(180deg, rgba(15,23,42,.62) 0%, rgba(15,23,42,.26) 42%, rgba(15,23,42,.80) 100%),
    url('/img/clinica-portada.jpg');
  background-size:cover;
  background-position:center;
  color:#eaf1f8;
  padding:56px 60px;
  display:flex; flex-direction:column; justify-content:space-between;
}
.hc-auth__logo{ display:flex; align-items:center; gap:12px; font-size:20px; font-weight:700; }
.hc-auth__logo .mark{
  width:42px; height:42px; border-radius:12px;
  background:rgba(255,255,255,.18); display:grid; place-items:center;
  font-size:20px; font-weight:800;
}
.hc-auth__pitch h2{ font-size:30px; font-weight:700; line-height:1.2; margin:0 0 14px;
  text-shadow:0 2px 12px rgba(0,0,0,.35); }
.hc-auth__pitch p{ font-size:16px; color:#dbe4ef; margin:0; max-width:34ch;
  text-shadow:0 1px 8px rgba(0,0,0,.3); }
.hc-auth__foot{ font-size:13px; color:#aab7c7; }

.hc-auth__formside{
  display:flex; align-items:center; justify-content:center; padding:40px 24px;
  background:var(--hc-bg);
  background-image:radial-gradient(var(--hc-border) 1px, transparent 1px);
  background-size:22px 22px;
}
.hc-auth__card{
  width:100%; max-width:460px;
  background:var(--hc-surface);
  border-radius:18px;
  box-shadow:var(--hc-shadow);
  padding:44px 44px;
}
.hc-auth__title{ font-size:30px; font-weight:700; margin:0 0 6px; letter-spacing:-.4px; }
.hc-auth__sub{ color:var(--hc-muted); font-size:15.5px; margin:0 0 30px; }

/* Elementos de acceso más grandes */
.hc-auth__card .hc-input{ padding:14px 16px; font-size:16px; }
.hc-auth__card .hc-label{ font-size:14px; margin-bottom:8px; }
.hc-auth__card .hc-field{ margin-bottom:22px; }
.hc-auth__card .hc-btn{ padding:15px 18px; font-size:16.5px; }

/* Nota de espacio por rol + chips informativos */
.hc-note{
  display:flex; gap:10px; align-items:flex-start;
  background:var(--hc-brand-weak); color:var(--hc-brand-ink);
  border-radius:12px; padding:12px 14px; font-size:13.5px; margin-top:24px;
}
.hc-note svg{ width:18px; height:18px; flex-shrink:0; margin-top:1px; }
.hc-chips{ display:flex; flex-wrap:wrap; gap:8px; margin-top:12px; }
.hc-chips__label{ font-size:13px; color:var(--hc-muted); margin-top:18px; font-weight:600; }
.hc-chip{
  font-size:13px; font-weight:600; color:var(--hc-muted);
  background:var(--hc-surface-2); border:1px solid var(--hc-border);
  border-radius:20px; padding:7px 14px;
}
.hc-chip.is-selectable{ cursor:pointer; transition:.12s ease; user-select:none; }
.hc-chip.is-selectable:hover{ border-color:var(--hc-brand); color:var(--hc-brand-ink); }
.hc-chip.is-active{
  background:var(--hc-brand); border-color:var(--hc-brand); color:#fff;
}

/* Ilustración del lado de marca */
.hc-auth__illus{ position:relative; margin:8px 0; }
.hc-auth__illus svg{ width:100%; max-width:380px; height:auto; }

@media (max-width:860px){
  .hc-auth{ grid-template-columns:1fr; }
  .hc-auth__brandside{ display:none; }
}

/* ============================================================
   Portal de selección de área (roles)
   ============================================================ */
.hc-portal{ min-height:100vh; display:flex; flex-direction:column; align-items:center;
  padding:56px 24px; }
.hc-portal__logo{ display:flex; align-items:center; gap:12px; font-size:22px; font-weight:700;
  color:var(--hc-brand-ink); margin-bottom:6px; }
.hc-portal__logo .mark{ width:40px; height:40px; border-radius:12px; background:var(--hc-brand);
  color:#fff; display:grid; place-items:center; font-size:20px; font-weight:800; }
.hc-portal__sub{ color:var(--hc-muted); font-size:15px; margin:0 0 34px; }
.hc-portal__grid{ display:grid; grid-template-columns:repeat(2, minmax(240px,1fr)); gap:20px;
  width:100%; max-width:720px; }
.hc-rolecard{ display:flex; align-items:center; gap:16px; text-decoration:none;
  background:var(--hc-surface); border:1px solid var(--hc-border); border-radius:var(--hc-radius);
  padding:22px 22px; box-shadow:0 1px 2px rgba(15,23,42,.04);
  transition:transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
.hc-rolecard:hover{ transform:translateY(-2px); box-shadow:var(--hc-shadow);
  border-color:var(--hc-brand); }
.hc-rolecard__icon{ width:52px; height:52px; border-radius:14px; flex-shrink:0;
  display:grid; place-items:center; }
.hc-rolecard__icon svg{ width:26px; height:26px; stroke-width:1.9; }
.hc-rolecard__name{ font-size:18px; font-weight:700; color:var(--hc-text); }
.hc-rolecard__desc{ font-size:13px; color:var(--hc-muted); margin-top:2px; }
.hc-rolecard--director .hc-rolecard__icon{ background:#e0e7ff; color:#4338ca; }
.hc-rolecard--medico   .hc-rolecard__icon{ background:var(--hc-brand-weak); color:var(--hc-brand-ink); }
.hc-rolecard--admin    .hc-rolecard__icon{ background:#fef3c7; color:#b45309; }
.hc-rolecard--config   .hc-rolecard__icon{ background:#f3e8ff; color:#7e22ce; }
@media (max-width:640px){ .hc-portal__grid{ grid-template-columns:1fr; } }
