* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 6px;
  font-size: clamp(28px, 3vw, 36px);
  line-height: 1.08;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 8px;
  font-size: 21px;
  line-height: 1.2;
  letter-spacing: 0;
}

p {
  line-height: 1.48;
}

label {
  display: grid;
  gap: 8px;
  font-size: 13px;
  font-weight: 760;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  border-radius: var(--radius);
  padding: 11px 12px;
  outline: none;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent-dark);
  box-shadow: 0 0 0 3px rgba(0, 207, 109, 0.13);
}

.hidden {
  display: none !important;
}

.muted {
  color: var(--muted);
}

@view-transition {
  navigation: auto;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: .18s;
  animation-timing-function: ease-out;
}

.app-main,
.inbox-shell {
  animation: page-content-in .18s ease-out both;
  transition: opacity .16s ease, transform .16s ease, filter .16s ease;
}

body.is-leaving .app-main,
body.is-leaving .inbox-shell {
  opacity: .58;
  transform: translateY(4px);
  filter: saturate(.92);
}

@keyframes page-content-in {
  from {
    opacity: .62;
    transform: translateY(4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-main,
  .inbox-shell {
    animation: none;
    transition: none;
  }

  body.is-leaving .app-main,
  body.is-leaving .inbox-shell {
    opacity: 1;
    transform: none;
    filter: none;
  }
}

.eyebrow {
  margin-bottom: 8px;
  color: var(--primary);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.auth-body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 10% 5%, rgba(0, 207, 109, .13), transparent 26%),
    linear-gradient(135deg, #f8fcfd 0%, #eef7f8 100%);
}

.auth-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(390px, .55fr);
  min-height: 100vh;
  width: 100%;
  padding: 24px;
  gap: 24px;
}

.auth-showcase {
  min-height: calc(100vh - 48px);
  border: 1px solid rgba(6, 43, 85, .08);
  border-radius: 24px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.auth-showcase img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.auth-panel {
  display: grid;
  place-items: center;
  min-width: 0;
}

.auth-card {
  width: min(100%, 480px);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: clamp(28px, 4vw, 44px);
  box-shadow: var(--shadow);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 34px;
}

.auth-brand img {
  width: 58px;
  height: 58px;
}

.auth-brand div {
  display: grid;
  gap: 2px;
}

.auth-brand strong {
  color: var(--primary-dark);
  font-size: 30px;
  line-height: 1;
  letter-spacing: -.04em;
}

.auth-brand span {
  color: var(--muted);
  font-size: 12px;
}

.auth-form {
  display: grid;
  gap: 18px;
  margin-top: 28px;
}

.form-message {
  min-height: 20px;
  margin: 0;
  color: var(--danger);
  font-size: 14px;
}

.auth-trust {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 26px;
}

.auth-trust span {
  border: 1px solid #cfeee0;
  border-radius: 999px;
  padding: 6px 9px;
  color: #087547;
  background: var(--accent-soft);
  font-size: 11px;
  font-weight: 750;
}

@media (max-width: 980px) {
  .auth-layout {
    grid-template-columns: 1fr;
  }

  .auth-showcase {
    min-height: 300px;
  }
}

@media (max-width: 640px) {
  .auth-layout {
    padding: 14px;
  }

  .auth-showcase {
    display: none;
  }

  .auth-panel {
    min-height: calc(100vh - 28px);
  }
}


/* V1.18C · Login integrado en claro y oscuro */
@media (min-width: 981px) {
  .auth-layout {
    align-items: center;
  }

  .auth-showcase {
    min-height: 0;
    aspect-ratio: 2033 / 774;
    align-self: center;
  }

  .auth-showcase img {
    object-fit: cover;
  }
}


/* V1.18D.1 · Login unificado y pulido visual general */
:where(button, input, textarea, select, a):focus-visible {
  outline: 0;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}

html {
  scrollbar-color: color-mix(in srgb, var(--muted) 54%, transparent) transparent;
  scrollbar-width: thin;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted) 48%, transparent);
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--muted) 68%, transparent);
  background-clip: padding-box;
}

.auth-layout {
  position: relative;
  isolation: isolate;
}

.auth-showcase {
  position: relative;
}

.auth-showcase::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent 55%, rgba(6, 29, 59, .05)),
    linear-gradient(180deg, transparent 72%, rgba(6, 29, 59, .04));
}

.auth-showcase img {
  position: relative;
  z-index: 0;
}

.auth-card h1 {
  text-wrap: balance;
}

.auth-form input {
  min-height: 48px;
  padding-inline: 14px;
  transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}

.auth-form .button {
  min-height: 48px;
  margin-top: 2px;
}

@media (min-width: 981px) {
  .auth-body {
    display: grid;
    place-items: center;
  }

  .auth-layout {
    width: min(100%, 1720px);
    min-height: 100vh;
    grid-template-columns: minmax(0, 1.48fr) minmax(410px, .52fr);
    align-items: stretch;
    gap: 0;
    padding: clamp(18px, 2.3vw, 36px);
  }

  .auth-showcase {
    min-height: calc(100vh - clamp(36px, 4.6vw, 72px));
    aspect-ratio: auto;
    border-radius: 26px 0 0 26px;
    border-right: 0;
    box-shadow: none;
  }

  .auth-panel {
    min-height: calc(100vh - clamp(36px, 4.6vw, 72px));
    place-items: center;
    padding: clamp(28px, 3.2vw, 58px);
    border: 1px solid var(--border);
    border-left: 0;
    border-radius: 0 26px 26px 0;
    background: color-mix(in srgb, var(--panel) 96%, var(--bg));
    box-shadow: var(--shadow);
  }

  .auth-card {
    width: min(100%, 460px);
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .auth-brand {
    margin-bottom: 30px;
  }
}

@media (max-width: 980px) {
  .auth-layout {
    gap: 16px;
  }

  .auth-showcase,
  .auth-panel {
    border-radius: 22px;
  }

  .auth-card {
    width: min(100%, 560px);
  }
}

@media (max-width: 640px) {
  .auth-body {
    min-height: 100dvh;
  }

  .auth-layout {
    min-height: 100dvh;
    padding: 12px;
  }

  .auth-panel {
    min-height: calc(100dvh - 24px);
    padding: 18px;
    border: 1px solid var(--border);
    background: var(--panel);
  }

  .auth-card {
    padding: 8px 2px;
    border: 0;
    box-shadow: none;
  }

  .auth-brand {
    margin-bottom: 26px;
  }

  .auth-brand img {
    width: 52px;
    height: 52px;
  }

  .auth-brand strong {
    font-size: 27px;
  }
}


/* V1.18D.2 · Login sin recortes y sin elementos decorativos innecesarios */
.auth-showcase {
  background: #f0f5f4;
}

.auth-showcase img {
  object-position: center;
}

.auth-card > .muted {
  max-width: 36ch;
}

@media (min-width: 1181px) {
  .auth-layout {
    width: min(calc(100% - 48px), 1500px);
    min-height: 0;
    grid-template-columns: minmax(0, 1fr) minmax(380px, 420px);
    align-items: stretch;
    padding: 0;
  }

  .auth-showcase {
    min-height: 0;
    aspect-ratio: 16 / 10;
  }

  .auth-showcase img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .auth-panel {
    min-height: 0;
    padding: clamp(30px, 3vw, 48px);
  }

  .auth-brand {
    margin-bottom: 26px;
  }

  .auth-form {
    margin-top: 24px;
  }
}

@media (max-width: 1180px) and (min-width: 641px) {
  .auth-body {
    display: block;
  }

  .auth-layout {
    width: min(100%, 920px);
    min-height: 100vh;
    grid-template-columns: 1fr;
    align-items: start;
    gap: 14px;
    padding: 18px;
    margin-inline: auto;
  }

  .auth-showcase {
    min-height: 0;
    aspect-ratio: 16 / 10;
    border: 1px solid var(--border);
    border-radius: 22px;
  }

  .auth-showcase img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .auth-panel {
    min-height: 0;
    padding: 32px;
    border: 1px solid var(--border);
    border-radius: 22px;
  }
}
