body.arsuve-auth-page,
body.arsuve-auth-account-page,
body.arsuve-first-login-page {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background: var(--background);
}

/* Login y acceso a adjuntos */
.arsuve-auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, 0.95fr) minmax(460px, 1.05fr);
  background: var(--surface);
}

.arsuve-auth-visual {
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  padding: clamp(34px, 5vw, 72px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background:
    radial-gradient(circle at 18% 16%, rgba(164, 212, 92, 0.32), transparent 30%),
    linear-gradient(145deg, #071f4e 0%, var(--primary) 55%, #173f7f 100%);
}

.arsuve-auth-visual::before,
.arsuve-auth-visual::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.arsuve-auth-visual::before {
  width: 430px;
  height: 430px;
  left: -160px;
  bottom: -210px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  box-shadow: 0 0 0 55px rgba(255, 255, 255, 0.025), 0 0 0 110px rgba(255, 255, 255, 0.018);
}

.arsuve-auth-visual::after {
  width: 240px;
  height: 240px;
  right: -110px;
  top: -80px;
  background: rgba(164, 212, 92, 0.13);
}

.arsuve-auth-brand {
  position: relative;
  z-index: 1;
  width: min(440px, 100%);
  display: grid;
  gap: 26px;
  justify-items: center;
  text-align: center;
}

.arsuve-auth-brand-logo {
  width: min(390px, 88%);
  height: auto;
  max-height: 190px;
  padding: 24px 30px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 22px;
  box-shadow: 0 28px 65px rgba(0, 0, 0, 0.2);
}

.arsuve-auth-brand-accent {
  width: 94px;
  height: 5px;
  background: var(--secondary);
  border-radius: 999px;
}

.arsuve-auth-panel {
  min-height: 100vh;
  padding: 36px clamp(24px, 6vw, 88px);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
}

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

.arsuve-auth-mobile-logo {
  display: none;
  width: 210px;
  height: auto;
  margin: 0 auto 30px;
  object-fit: contain;
}

.arsuve-auth-card h1 {
  margin: 0 0 26px;
  color: var(--text);
  font-size: clamp(1.65rem, 3vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.025em;
}

.arsuve-auth-form {
  display: grid;
  gap: 18px;
}

.arsuve-auth-field {
  display: grid;
  gap: 8px;
}

.arsuve-auth-field > label,
.arsuve-auth-field > span {
  margin: 0;
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 800;
}

.arsuve-auth-input {
  position: relative;
  min-height: 50px;
  display: flex;
  align-items: center;
  color: var(--text-muted);
}

.arsuve-auth-input > .arsuve-icon:first-child {
  position: absolute;
  left: 15px;
  z-index: 2;
  pointer-events: none;
}

.arsuve-auth-input input {
  width: 100%;
  min-height: 50px;
  padding: 0 46px;
  color: var(--text);
  font-size: 0.9rem;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.arsuve-auth-input input::placeholder { color: var(--text-subtle); }

.arsuve-auth-input input:hover { border-color: #aebbd0; }

.arsuve-auth-input input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--focus-ring);
}

.arsuve-password-toggle {
  position: absolute;
  right: 7px;
  z-index: 2;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--text-muted);
  background: transparent;
  cursor: pointer;
}

.arsuve-password-toggle:hover {
  color: var(--primary);
  background: var(--primary-soft);
}

.arsuve-auth-links {
  margin-top: -3px;
  display: flex;
  justify-content: flex-end;
}

.arsuve-auth-link-button,
.arsuve-auth-back-link {
  border: 0;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--primary);
  background: transparent;
  font-size: 0.8rem;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.arsuve-auth-link-button:hover,
.arsuve-auth-back-link:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

.arsuve-auth-submit {
  width: 100%;
  min-height: 50px;
  margin-top: 4px;
}

.arsuve-auth-footer {
  margin-top: 28px;
  color: var(--text-muted);
  font-size: 0.72rem;
  text-align: center;
}

/* Pantallas de recuperación y bienvenida */
.arsuve-auth-account-shell {
  min-height: 100vh;
  padding: 32px 20px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 20px;
  background:
    radial-gradient(circle at 15% 10%, rgba(164, 212, 92, 0.16), transparent 28%),
    radial-gradient(circle at 90% 88%, rgba(12, 44, 108, 0.11), transparent 30%),
    var(--background);
}

.arsuve-auth-account-brand {
  display: flex;
  align-items: center;
  justify-content: center;
}

.arsuve-auth-account-brand img {
  width: min(230px, 65vw);
  height: auto;
  max-height: 108px;
  object-fit: contain;
}

.arsuve-auth-account-card {
  width: min(480px, 100%);
  padding: clamp(26px, 5vw, 42px);
  color: var(--text);
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-card), 0 28px 70px rgba(12, 44, 108, 0.08);
}

.arsuve-auth-account-icon {
  width: 48px;
  height: 48px;
  margin-bottom: 19px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: var(--primary);
  background: var(--primary-soft);
  border: 1px solid var(--primary-border);
}

.arsuve-auth-account-icon.is-success {
  color: #397b20;
  background: var(--secondary-soft);
  border-color: var(--secondary-border);
}

.arsuve-auth-account-card h1 {
  margin: 0 0 10px;
  color: var(--text);
  font-size: clamp(1.45rem, 4vw, 1.85rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.22;
}

.arsuve-auth-account-card > p {
  margin: 0 0 24px;
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.6;
}

.arsuve-auth-account-form {
  display: grid;
  gap: 17px;
}

.arsuve-auth-account-footer {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.72rem;
  text-align: center;
}

.arsuve-auth-account-card .arsuve-auth-back-link {
  margin-top: 20px;
}

.arsuve-first-login-card {
  text-align: center;
}

.arsuve-first-login-card .arsuve-auth-account-icon {
  margin-left: auto;
  margin-right: auto;
}

.arsuve-first-login-card .arsuve-button {
  width: 100%;
  text-decoration: none;
}

/* Cambio de contraseña dentro del layout */
.arsuve-auth-inline {
  width: min(520px, 100%);
  margin: 20px auto;
}

.arsuve-auth-inline .arsuve-auth-account-card {
  width: 100%;
}

/* Cargador */
.modalDialog.arsuve-loading-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  padding: 20px;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(4px);
}

.modalDialog.arsuve-loading-modal.is-open,
.modalDialog.arsuve-loading-modal:target {
  display: flex;
  opacity: 1;
  pointer-events: auto;
}

.arsuve-loading-card {
  width: min(290px, 100%);
  padding: 24px;
  display: grid;
  justify-items: center;
  gap: 8px;
  color: var(--text);
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-popover);
}

.arsuve-loading-card strong { font-size: 0.9rem; }
.arsuve-loading-card span { color: var(--text-muted); font-size: 0.76rem; }

.arsuve-loading-spinner {
  width: 38px;
  height: 38px;
  margin-bottom: 6px;
  border: 3px solid var(--primary-soft);
  border-top-color: var(--primary);
  border-right-color: var(--secondary);
  border-radius: 50%;
  animation: arsuve-spin 0.75s linear infinite;
}

@keyframes arsuve-spin { to { transform: rotate(360deg); } }

@media (max-width: 900px) {
  .arsuve-auth-shell {
    grid-template-columns: 1fr;
  }

  .arsuve-auth-visual {
    display: none;
  }

  .arsuve-auth-panel {
    min-height: 100vh;
    padding: 28px 20px;
    background:
      radial-gradient(circle at 15% 8%, rgba(164, 212, 92, 0.15), transparent 28%),
      var(--background);
  }

  .arsuve-auth-card {
    padding: 28px clamp(20px, 6vw, 36px);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow-card);
  }

  .arsuve-auth-mobile-logo {
    display: block;
  }
}

@media (max-width: 575px) {
  .arsuve-auth-account-shell { padding: 20px 14px; }
  .arsuve-auth-account-card { padding: 25px 20px; border-radius: 14px; }
  .arsuve-auth-card h1 { font-size: 1.55rem; }
}
