/* =============================================================================
   OLO Correo — tokens y pantalla de acceso (skin "olo", hija de Elastic)
   -----------------------------------------------------------------------------
   Único para todos los clientes. La marca de cada institución entra SOLO por
   variables CSS en /data/tenants/<slug>/tenant.css (lo genera OloTenant).
   La aplicación vive en olo-app.css y los íconos en olo-iconos.css.
   ============================================================================= */

/* ---------- 1. Tokens (valores por defecto = marca OLO) ---------- */
:root {
  --olo-marca:          #0b5fd1;
  --olo-marca-oscuro:   #0a2f6e;
  --olo-acento:         #f7941d;
  --olo-marca-texto:    #ffffff;
  --olo-panel-fondo:    #f3f5f8;
  --olo-fondo-app:      color-mix(in srgb, var(--olo-marca) 6%, #f8f9fb);
  --olo-separador:      #dfe3ea;
  --olo-tarjeta:        #ffffff;
  --olo-texto:          #16202a;
  --olo-texto-suave:    #5a6573;
  --olo-borde:          #e3e7ed;
  --olo-radio:          18px;
  --olo-radio-sm:       12px;
  --olo-sombra:         0 30px 70px -30px rgba(15, 30, 60, .35), 0 2px 8px rgba(15, 30, 60, .06);
  --olo-fuente:         -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --olo-fuente-titulos: var(--olo-fuente);
  --olo-brand-ancho:    54%;
  --olo-marca-legible:  color-mix(in srgb, var(--olo-marca) 80%, #000);
}

/* ---------- 2. Acceso: piezas comunes a todas las plantillas ---------- */
.task-login #layout-content.olo-login {
  position: relative; display: flex; flex-direction: row; text-align: left;
  width: 100%; height: 100%; min-height: 100vh; overflow: auto;
  font-family: var(--olo-fuente); color: var(--olo-texto); background: var(--olo-panel-fondo);
}
.olo-login h2, .olo-login h3 { font-family: var(--olo-fuente-titulos); }
.olo-sello { display: none; }

/* Panel de marca */
.olo-brand {
  position: relative; flex: 0 0 var(--olo-brand-ancho);
  display: flex; flex-direction: column; justify-content: space-between;
  padding: clamp(28px, 5vw, 72px); overflow: hidden; isolation: isolate;
  color: var(--olo-marca-texto);
  background:
    radial-gradient(900px 520px at 0% 0%, color-mix(in srgb, var(--olo-marca) 55%, #ffffff) 0%, transparent 60%),
    linear-gradient(155deg, var(--olo-marca-oscuro) 0%, var(--olo-marca) 100%);
}
.olo-brand-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .22; filter: saturate(.85); z-index: -1; }
.olo-brand-veil { position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(5,12,28,0) 30%, rgba(5,12,28,.45) 100%); }
.olo-brand-inner { position: relative; max-width: 560px; margin: auto 0; padding: 24px 0; }
.olo-brand-logo-wrap {
  display: inline-flex; align-items: center; justify-content: center; padding: 16px 20px; margin-bottom: 30px;
  background: #fff; border-radius: 16px; box-shadow: 0 16px 40px -18px rgba(0,0,0,.55);
}
.task-login .olo-brand-logo, .task-login #logo.olo-brand-logo { position: static; top: auto; display: block; max-height: 92px; max-width: 250px; width: auto; }
.olo-brand-kicker { margin: 0 0 8px; font-size: .95rem; font-weight: 500; opacity: .82; }
.olo-brand-name { margin: 0 0 14px; font-size: clamp(1.8rem, 2.8vw, 2.7rem); line-height: 1.08; font-weight: 800; letter-spacing: -.015em; text-wrap: balance; }
.olo-brand-regla { display: none; }
.olo-brand-lema { margin: 0 0 30px; font-size: 1.08rem; line-height: 1.55; opacity: .9; max-width: 42ch; }
.olo-brand-feats { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; font-size: .97rem; }
.olo-brand-feats li { display: flex; align-items: center; gap: 12px; opacity: .94; }
.olo-dot { position: relative; flex: 0 0 22px; width: 22px; height: 22px; border-radius: 50%; background: color-mix(in srgb, var(--olo-marca-texto) 16%, transparent); }
.olo-dot:after {
  content: ""; position: absolute; inset: 5px; background: var(--olo-marca-texto);
  -webkit-mask: var(--oi-check) center / contain no-repeat; mask: var(--oi-check) center / contain no-repeat;
}
.olo-brand-foot { position: relative; font-size: .82rem; opacity: .7; }

/* Panel de acceso */
.olo-panel {
  position: relative; flex: 1 1 auto; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px; padding: clamp(24px, 4vw, 56px);
}
.olo-card {
  width: 100%; max-width: 432px; padding: clamp(26px, 3vw, 40px);
  background: var(--olo-tarjeta); border: 1px solid var(--olo-borde); border-radius: var(--olo-radio);
  box-shadow: var(--olo-sombra); color: var(--olo-texto);
}
.olo-card-head { margin-bottom: 24px; }
.olo-card-marca { display: none; }
.olo-card-title { margin: 0 0 6px; font-size: 1.75rem; line-height: 1.15; font-weight: 750; letter-spacing: -.012em; color: var(--olo-texto); }
.olo-card-sub { margin: 0; color: var(--olo-texto-suave); font-size: .95rem; line-height: 1.5; }
.olo-card-sub strong { color: var(--olo-marca-legible); font-weight: 650; }

/* Formulario: componentes de Elastic */
.olo-login #login-form { position: static; top: auto; width: 100%; max-width: none; margin: 0; }
.olo-login #login-form .input-group-text {
  min-width: 46px; justify-content: center; background: var(--olo-panel-fondo); border-color: var(--olo-borde); color: var(--olo-texto-suave);
  border-radius: var(--olo-radio-sm) 0 0 var(--olo-radio-sm);
}
.olo-login #login-form .form-control { border-color: var(--olo-borde); border-radius: 0 var(--olo-radio-sm) var(--olo-radio-sm) 0; min-height: 3.05rem; font-size: 1rem; }
.olo-login #login-form .form-control:focus { border-color: var(--olo-marca); box-shadow: 0 0 0 3px color-mix(in srgb, var(--olo-marca) 20%, transparent); }
.olo-login #rcmloginsubmit, .olo-login #rcmloginsubmit.btn-primary {
  margin-top: 8px; min-height: 3.1rem; border-radius: var(--olo-radio-sm); border: 0;
  font-weight: 700; font-size: 1rem; letter-spacing: .01em; text-transform: none !important;
  background: var(--olo-marca); color: var(--olo-marca-texto);
  box-shadow: 0 12px 26px -14px var(--olo-marca), inset 0 -1px 0 rgba(0,0,0,.15);
  transition: filter .12s ease, transform .12s ease;
}
.olo-login #rcmloginsubmit:hover { filter: brightness(1.07); }
.olo-login #rcmloginsubmit:active { transform: translateY(1px); }
.olo-login #login-footer { margin-top: 16px; text-align: center; font-size: .9rem; color: var(--olo-texto-suave); }
.olo-login #login-footer > div { background: transparent; }
.task-login #messagestack { z-index: 10; }

/* Accesos rápidos bajo el formulario */
.olo-accesos { display: flex; flex-wrap: wrap; gap: 6px 14px; justify-content: center; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--olo-borde); }
.olo-acceso { display: inline-flex; align-items: center; gap: 6px; font-size: .86rem; font-weight: 600; color: var(--olo-marca-legible); text-decoration: none; padding: 4px 2px; }
.olo-acceso:hover { text-decoration: underline; color: var(--olo-marca-legible); }
.olo-acceso:before { content: ""; width: 1.05em; height: 1.05em; background: currentColor; -webkit-mask: var(--oi) center / contain no-repeat; mask: var(--oi) center / contain no-repeat; }
.olo-acceso--movil  { --oi: var(--oi-smartphone); }
.olo-acceso--ayuda  { --oi: var(--oi-circle-help); }
.olo-acceso--portal { --oi: var(--oi-house); }

.olo-provider { display: flex; flex-wrap: wrap; gap: 4px 12px; justify-content: center; font-size: .8rem; color: var(--olo-texto-suave); text-align: center; }
.olo-provider strong { color: var(--olo-texto); font-weight: 600; }
.olo-provider-inst { display: none; }

/* Aviso institucional (mantenimiento, comunicados) */
.olo-aviso {
  --olo-aviso-c: var(--olo-marca);
  display: flex; align-items: flex-start; gap: 10px; width: 100%; max-width: 432px;
  padding: 12px 14px; border-radius: var(--olo-radio-sm); font-size: .9rem; line-height: 1.45; color: var(--olo-texto);
  background: color-mix(in srgb, var(--olo-aviso-c) 9%, #fff);
  border: 1px solid color-mix(in srgb, var(--olo-aviso-c) 30%, transparent);
}
.olo-aviso--alerta { --olo-aviso-c: #d97706; }
.olo-aviso--exito  { --olo-aviso-c: #0e9f6e; }
.olo-aviso-ico { flex: 0 0 18px; width: 18px; height: 18px; margin-top: 1px; background: var(--olo-aviso-c); -webkit-mask: var(--oi-info) center / contain no-repeat; mask: var(--oi-info) center / contain no-repeat; }
.olo-aviso--alerta .olo-aviso-ico { -webkit-mask-image: var(--oi-triangle-alert); mask-image: var(--oi-triangle-alert); }
.olo-aviso--exito .olo-aviso-ico { -webkit-mask-image: var(--oi-circle-check); mask-image: var(--oi-circle-check); }
.olo-aviso-texto { flex: 1 1 auto; }
.olo-aviso-cerrar { border: 0; background: none; font-size: 1.2rem; line-height: 1; color: var(--olo-texto-suave); cursor: pointer; padding: 0 2px; }
.olo-aviso--webmail { position: fixed; z-index: 1050; left: 50%; bottom: 18px; transform: translateX(-50%); max-width: min(680px, calc(100vw - 24px)); box-shadow: var(--olo-sombra); background: #fff; }

/* ---------- 3. Plantilla «Centrada»: la tarjeta sola, como Workspace o 365 ---------- */
.olo-login--centrado .olo-brand { display: none; }
.olo-login--centrado .olo-panel {
  background:
    radial-gradient(1000px 420px at 50% 0%, color-mix(in srgb, var(--olo-marca) 12%, transparent), transparent 70%),
    var(--olo-panel-fondo);
}
.olo-login--centrado .olo-card { max-width: 440px; border-top: 4px solid var(--olo-marca); }
.olo-login--centrado .olo-card-marca { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; margin-bottom: 22px; }
.olo-login--centrado .olo-card-logo { max-height: 68px; max-width: 220px; width: auto; }
.olo-login--centrado .olo-card-inst { font-family: var(--olo-fuente-titulos); font-weight: 650; font-size: 1.02rem; color: var(--olo-texto-suave); line-height: 1.3; }
.olo-login--centrado .olo-provider-inst { display: inline; }

/* ---------- 4. Plantilla «Foto»: imagen a pantalla completa, tarjeta flotante ---------- */
.task-login #layout-content.olo-login--foto { background: var(--olo-marca-oscuro); }
.olo-login--foto .olo-brand { position: absolute; inset: 0; flex: none; justify-content: flex-end; padding-right: calc(500px + 6vw); background: var(--olo-marca-oscuro); }
.olo-login--foto .olo-brand-bg { opacity: 1; filter: none; }
.olo-login--foto .olo-brand-veil { background: linear-gradient(90deg, rgba(5,10,24,.78) 0%, rgba(5,10,24,.42) 55%, rgba(5,10,24,.2) 100%), linear-gradient(0deg, rgba(5,10,24,.55), transparent 50%); }
.olo-login--foto .olo-brand-inner { margin: 0; }
.olo-login--foto .olo-brand-name { font-size: clamp(2.2rem, 3.6vw, 3.6rem); }
.olo-login--foto .olo-brand-feats { display: none; }
.olo-login--foto .olo-brand-logo-wrap { padding: 12px 16px; }
.olo-login--foto .olo-brand-logo { max-height: 64px; }
.olo-login--foto .olo-panel { position: relative; z-index: 2; margin-left: auto; flex: 0 0 auto; width: min(560px, 100%); }
.olo-login--foto .olo-card { background: color-mix(in srgb, var(--olo-tarjeta) 92%, transparent); backdrop-filter: blur(14px); border-color: rgba(255,255,255,.4); }
.olo-login--foto .olo-provider, .olo-login--foto .olo-provider strong { color: rgba(255,255,255,.85); }

/* ---------- 5. Plantilla «Editorial»: el nombre como protagonista ---------- */
.task-login #layout-content.olo-login--editorial { background: #fff; border-left: 12px solid var(--olo-marca); }
.olo-login--editorial .olo-brand { background: #fff; color: var(--olo-texto); flex-basis: 56%; padding-left: clamp(28px, 6vw, 96px); }
.olo-login--editorial .olo-brand-bg, .olo-login--editorial .olo-brand-veil, .olo-login--editorial .olo-brand-feats { display: none; }
.olo-login--editorial .olo-brand-logo-wrap { padding: 0; background: none; box-shadow: none; margin-bottom: 40px; }
.olo-login--editorial .olo-brand-logo { max-height: 76px; }
.olo-login--editorial .olo-brand-kicker { color: var(--olo-marca-legible); font-weight: 600; opacity: 1; }
.olo-login--editorial .olo-brand-name { font-size: clamp(2.6rem, 4.6vw, 4.6rem); line-height: 1.02; letter-spacing: -.025em; max-width: 13ch; color: var(--olo-texto); }
.olo-login--editorial .olo-brand-regla { display: block; width: 72px; height: 5px; border-radius: 3px; background: var(--olo-acento); margin: 6px 0 22px; }
.olo-login--editorial .olo-brand-lema { color: var(--olo-texto-suave); opacity: 1; font-size: 1.15rem; }
.olo-login--editorial .olo-brand-foot { color: var(--olo-texto-suave); opacity: 1; }
.olo-login--editorial .olo-panel { background: var(--olo-panel-fondo); }
.olo-login--editorial .olo-card { box-shadow: 0 1px 2px rgba(15,30,60,.05); }

/* ---------- 6. Plantilla «Sello»: franja oficial con el escudo ---------- */
.task-login #layout-content.olo-login--sello { flex-direction: column; }
.olo-login--sello .olo-sello {
  display: flex; align-items: center; gap: 16px; padding: 16px clamp(18px, 4vw, 48px);
  background: var(--olo-marca); color: var(--olo-marca-texto); box-shadow: inset 0 -4px 0 var(--olo-acento);
}
.olo-sello-logo { flex: 0 0 auto; display: grid; place-items: center; width: 64px; height: 64px; border-radius: 14px; background: #fff; padding: 7px; }
.olo-sello-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.olo-sello-texto { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.olo-sello-texto strong { font-family: var(--olo-fuente-titulos); font-size: clamp(1.05rem, 2vw, 1.35rem); font-weight: 750; }
.olo-sello-texto small { font-size: .88rem; opacity: .85; }
.olo-login--sello .olo-brand {
  flex: 0 0 auto; min-height: 220px; justify-content: center; align-items: center; text-align: center;
  padding: 40px 20px 110px; background: linear-gradient(180deg, color-mix(in srgb, var(--olo-marca) 92%, #000), var(--olo-marca-oscuro));
}
.olo-login--sello .olo-brand-bg { opacity: .3; }
.olo-login--sello .olo-brand-inner { margin: 0 auto; padding: 0; }
.olo-login--sello .olo-brand-logo-wrap, .olo-login--sello .olo-brand-name, .olo-login--sello .olo-brand-feats, .olo-login--sello .olo-brand-foot { display: none; }
.olo-login--sello .olo-brand-kicker { font-size: 1.5rem; font-family: var(--olo-fuente-titulos); font-weight: 700; opacity: 1; margin-bottom: 6px; }
.olo-login--sello .olo-brand-lema { margin: 0 auto; }
.olo-login--sello .olo-panel { justify-content: flex-start; margin-top: -90px; padding-top: 0; }
.olo-login--sello .olo-provider-inst { display: inline; }

/* ---------- 7. Celular y tablet ---------- */
@media screen and (max-width: 900px) {
  .task-login #layout-content.olo-login { flex-direction: column; }
  .olo-brand { flex: 0 0 auto; padding: 24px 22px 56px; justify-content: flex-start; }
  .olo-brand-feats, .olo-brand-foot { display: none; }
  .olo-brand-logo-wrap { padding: 10px 14px; margin-bottom: 16px; border-radius: 12px; }
  .task-login #logo.olo-brand-logo, .task-login .olo-brand-logo { max-height: 56px; }
  .olo-brand-inner { margin: 0; padding: 0; }
  .olo-brand-name { font-size: 1.5rem; margin-bottom: 6px; }
  .olo-brand-lema { font-size: .95rem; margin: 0; }
  .olo-panel { justify-content: flex-start; padding: 0 14px 28px; margin-top: -34px; gap: 14px; }
  .olo-card { padding: 24px 20px; }
  .olo-card-title { font-size: 1.45rem; }

  .olo-login--centrado .olo-panel { margin-top: 0; padding-top: 28px; }
  .olo-login--foto .olo-brand { position: relative; padding: 28px 22px 64px; }
  .olo-login--foto .olo-panel { width: 100%; margin-left: 0; }
  .task-login #layout-content.olo-login--editorial { border-left: 0; border-top: 8px solid var(--olo-marca); }
  .olo-login--editorial .olo-brand { padding: 28px 22px 20px; }
  .olo-login--editorial .olo-brand-logo-wrap { margin-bottom: 18px; }
  .olo-login--editorial .olo-brand-name { font-size: 2.1rem; }
  .olo-login--editorial .olo-brand-regla { margin: 4px 0 12px; }
  .olo-login--editorial .olo-panel { margin-top: 0; padding-top: 22px; }
  .olo-login--sello .olo-sello-logo { width: 52px; height: 52px; }
  .olo-login--sello .olo-brand { min-height: 0; padding: 26px 20px 84px; }
  .olo-login--sello .olo-brand-kicker { font-size: 1.15rem; }
  .olo-login--sello .olo-panel { margin-top: -62px; }
}

/* Modo oscuro (Elastic lo activa con html.dark-mode) */
html.dark-mode .task-login #layout-content.olo-login { background: #12171b; }
html.dark-mode .olo-card { background: #1b2226; border-color: #2a343a; color: #e4e9ec; }
html.dark-mode .olo-card-title { color: #e4e9ec; }
html.dark-mode .olo-card-sub, html.dark-mode .olo-provider { color: #a3afb8; }
html.dark-mode .olo-provider strong { color: #e4e9ec; }
html.dark-mode .olo-login #login-form .input-group-text { background: #161c20; border-color: #2a343a; }
html.dark-mode .olo-login #login-form .form-control { border-color: #2a343a; }
html.dark-mode .olo-aviso { background: #1b2226; color: #e4e9ec; }
html.dark-mode .olo-acceso { color: #9cc3ff; }
html.dark-mode .task-login #layout-content.olo-login--editorial, html.dark-mode .olo-login--editorial .olo-brand { background: #12171b; }
html.dark-mode .olo-login--editorial .olo-brand-name { color: #e4e9ec; }
