/* Marca AI Society — portal de correo (Roundcube 1.7, skin elastic).
   Paleta del manual: Synapse Purple #764FF9, Data Flow Lilac #B19BFC, Algorithm Black #0E0628. */

@font-face {
  font-family: "Montserrat AIS";
  src: url("fonts/montserrat.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}

/* ---------- Pantalla de entrada ---------- */

html body.task-login {
  background: #F6F4FF !important;
  min-height: 100vh;
}

body.task-login #layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(420px, 1fr);
  min-height: 100vh;
  height: auto;
  background: transparent;
}

#aisoc-panel {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 40px;
  padding: 56px 64px 48px;
  color: #fff;
  background: linear-gradient(145deg, #7C57FA 0%, #6038EE 48%, #3C1DB4 100%);
}

/* Luz ambiental: dos resplandores que se desplazan despacio. */
#aisoc-panel::before,
#aisoc-panel::after {
  content: "";
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  filter: blur(70px);
  pointer-events: none;
}

#aisoc-panel::before {
  width: 540px;
  height: 540px;
  top: -170px;
  right: -150px;
  background: radial-gradient(circle, rgba(177, 155, 252, .8), rgba(177, 155, 252, 0) 70%);
  animation: aisoc-deriva-a 18s ease-in-out infinite alternate;
}

#aisoc-panel::after {
  width: 480px;
  height: 480px;
  bottom: -190px;
  left: -130px;
  background: radial-gradient(circle, rgba(14, 6, 40, .55), rgba(14, 6, 40, 0) 70%);
  animation: aisoc-deriva-b 22s ease-in-out infinite alternate;
}

.aisoc-marca-agua {
  position: absolute;
  z-index: -1;
  right: -90px;
  bottom: -130px;
  width: 440px;
  height: 548px;
  background: url("img/isotipo-blanco.png") no-repeat center / contain;
  opacity: .08;
  pointer-events: none;
}

.aisoc-logo {
  width: 200px;
  height: 37px;
  background: url("img/logo-blanco.png") no-repeat left center / contain;
}

.aisoc-texto {
  max-width: 540px;
}

.aisoc-texto h2 {
  font-family: "Montserrat AIS", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-weight: 800;
  font-size: clamp(2.2rem, 3.6vw, 3.6rem);
  line-height: 1.05;
  letter-spacing: -.025em;
  margin: 0 0 20px;
  color: #fff;
  text-wrap: balance;
}

.aisoc-texto p {
  font-size: 1.125rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, .9);
  margin: 0;
  max-width: 36ch;
}

/* Mision: leyenda debajo del parrafo principal, separada por una linea. */
.aisoc-mision {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, .18);
  max-width: 44ch;
}


.aisoc-texto .aisoc-mision p {
  font-size: 1rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, .92);
  max-width: none;
}

.aisoc-mision strong {
  font-family: "Montserrat AIS", system-ui, sans-serif;
  font-weight: 700;
  color: #fff;
}

.aisoc-pie {
  font-family: "Montserrat AIS", system-ui, sans-serif;
  font-weight: 600;
  font-size: .8rem;
  letter-spacing: .02em;
  color: rgba(255, 255, 255, .72);
}

/* Lado del formulario */
body.task-login #layout-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: auto;
  min-width: 0;
  padding: 48px 40px;
  text-align: left;
  background: transparent !important;
}

body.task-login #logo,
body.task-login #login-footer {
  display: none !important;
}

.aisoc-encabezado,
body.task-login #login-form {
  width: 100%;
  max-width: 380px;
}

body.task-login #login-form {
  top: auto;
  margin: 0;
}

.aisoc-encabezado h2 {
  font-family: "Montserrat AIS", system-ui, sans-serif;
  font-weight: 700;
  font-size: 1.9rem;
  letter-spacing: -.02em;
  color: #0E0628;
  margin: 0 0 8px;
}

.aisoc-encabezado p {
  margin: 0 0 28px;
  color: #5C5670;
  font-size: 1rem;
  line-height: 1.5;
}

#login-form .form-group {
  margin-bottom: 14px;
}

#login-form .input-group-lg > .form-control {
  height: 52px;
  padding-left: 14px;
  font-size: 1rem;
  color: #0E0628;
  background: #fff;
  border: 1px solid #E0D9F7;
  border-left: 0;
  border-radius: 0 12px 12px 0;
}

#login-form .input-group-prepend .input-group-text {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  color: #764FF9;
  background: #F2EEFF;
  border: 1px solid #E0D9F7;
  border-right: 0;
  border-radius: 12px 0 0 12px;
}

/* El halo de foco envuelve el campo entero (icono + texto), no solo la caja del texto. */
#login-form .input-group {
  border-radius: 12px;
  transition: box-shadow .15s ease;
}

#login-form .input-group:focus-within {
  box-shadow: 0 0 0 4px rgba(118, 79, 249, .16);
}

#login-form .form-control:focus {
  border-color: #764FF9;
  box-shadow: none;
}

#login-form .input-group:focus-within .input-group-text {
  color: #5C35EC;
  border-color: #764FF9;
}

body.task-login #rcmloginsubmit {
  height: 52px;
  margin-top: 8px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #7C57FA 0%, #5C35EC 100%) !important;
  font-family: "Montserrat AIS", system-ui, sans-serif;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: .01em;
  text-transform: none !important;
  box-shadow: 0 12px 28px -10px rgba(92, 53, 236, .6);
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

body.task-login #rcmloginsubmit:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
  box-shadow: 0 16px 34px -12px rgba(92, 53, 236, .7);
}

body.task-login #rcmloginsubmit:active {
  transform: translateY(0);
}

body.task-login #rcmloginsubmit:focus-visible {
  outline: 3px solid rgba(118, 79, 249, .35);
  outline-offset: 3px;
}

/* Entrada escalonada */
.aisoc-logo,
.aisoc-texto,
.aisoc-encabezado,
body.task-login #login-form {
  animation: aisoc-sube .7s cubic-bezier(.2, .7, .2, 1) both;
}

.aisoc-texto { animation-delay: .08s; }
.aisoc-encabezado { animation-delay: .12s; }
body.task-login #login-form { animation-delay: .2s; }

@keyframes aisoc-sube {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

@keyframes aisoc-deriva-a {
  to { transform: translate(-90px, 70px) scale(1.12); }
}

@keyframes aisoc-deriva-b {
  to { transform: translate(80px, -60px) scale(1.08); }
}

@media (prefers-reduced-motion: reduce) {
  #aisoc-panel::before,
  #aisoc-panel::after,
  .aisoc-logo,
  .aisoc-texto,
  .aisoc-encabezado,
  body.task-login #login-form {
    animation: none !important;
  }
}

/* Celular y tableta: el panel pasa a ser una franja arriba del formulario. */
@media (max-width: 860px) {
  body.task-login #layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  #aisoc-panel {
    padding: 28px 24px 30px;
    gap: 22px;
    justify-content: flex-start;
  }

  .aisoc-logo {
    width: 170px;
    height: 32px;
  }

  .aisoc-texto h2 {
    font-size: 1.75rem;
    margin: 0;
    max-width: 16ch;
  }

  .aisoc-texto > p,
  .aisoc-pie {
    display: none;
  }

  .aisoc-mision {
    margin-top: 18px;
    padding-top: 16px;
  }

  .aisoc-texto .aisoc-mision p {
    font-size: .92rem;
  }

  .aisoc-marca-agua {
    width: 240px;
    height: 300px;
    right: -60px;
    bottom: -110px;
  }

  body.task-login #layout-content {
    justify-content: flex-start;
    padding: 32px 20px 48px;
  }

  .aisoc-encabezado h2 {
    font-size: 1.5rem;
  }
}

/* ---------- Color de marca dentro del correo ---------- */

.btn-primary,
.btn-primary.disabled,
.btn-primary:disabled {
  background: #764FF9;
  border-color: #764FF9;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:not(:disabled):not(.disabled):active {
  background: #6440F0;
  border-color: #6440F0;
}

#taskmenu .action-buttons a,
#taskmenu .action-buttons a:hover {
  color: #B19BFC;
}

.folderlist li.mailbox.recent > a > .unreadcount,
.floating-action-buttons a.button,
.quota-widget .value,
#messagestack .alert-info.information {
  background-color: #764FF9;
}

.popover .menu li a:not(.disabled):hover,
.popover .menu .dropbutton a.dropdown:hover,
.popupmenu .listing li > a:not(.disabled):hover,
.popupmenu .listing li.selected,
.ui-menu .ui-state-active {
  background-color: #764FF9 !important;
}

.form-control:focus,
.recipient-input.focus,
.multi-input > .content.focused {
  border-color: #764FF9;
  box-shadow: 0 0 0 .2rem rgba(118, 79, 249, .22);
}

.custom-switch .custom-control-input:checked ~ .custom-control-label::before {
  border-color: #764FF9;
  background-color: #764FF9;
}

.folderlist li.mailbox .unreadcount {
  background: #764FF9;
}

.listing li.selected,
.listing tr.selected td,
ul.treelist li.selected > a,
ul.treelist li.selected > div > a,
.table-widget table.options-table tr.selected td {
  background-color: #F1EDFF;
}

html:not(.touch) .listing li > a:focus,
html:not(.touch) .listing.focus tbody tr.focused > td:first-child,
html:not(.touch) .listing.focus:not(.withselection) tbody tr.focused > td.selection + td {
  border-left-color: #B19BFC;
}

/* Enlaces: morado en modo claro (contraste ~6:1 sobre blanco) y lila en modo oscuro.
   Especificidad minima (:where) para no pisar reglas de listas y menus. */
a {
  color: #6440F0;
}

a:hover {
  color: #4B2BC9;
}

:where(html.dark-mode) a {
  color: #B19BFC;
}

:where(html.dark-mode) a:hover {
  color: #CDBEFD;
}

.ui.alert a:not(.btn) {
  color: #6440F0;
}

/* Modo oscuro: los acentos azules de elastic pasan a lila de marca. */
html.dark-mode #taskmenu .action-buttons a {
  color: #B19BFC;
}

html.dark-mode .listing li.selected,
html.dark-mode .listing li.selected > a,
html.dark-mode .listing li.selected > div > a,
html.dark-mode .listing tr.selected td,
html.dark-mode .messagelist tr:not(.flagged):not(.deleted).selected td.subject a,
html.dark-mode .messagelist tr:not(.flagged):not(.deleted).selected td.subject span.msgicon.status {
  color: #B19BFC;
}

/* Isotipo de la barra lateral: mas chico y centrado; el encabezado conserva su altura
   para que el menu siga alineado con la columna de carpetas. */
html:not(.layout-phone) #layout-menu .popover-header {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 58px;
}

html:not(.layout-phone) #layout-menu .popover-header img {
  max-width: 30px;
  max-height: 30px;
  padding: 0;
}
