@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

:root {
  --brand: #0d7ff2;
  --brand-dark: #0a5fb8;
  --ink: #1c1c1e;
  --muted: #6b7280;
  --line: #e2e5ea;
  --bg: #f6f7f9;
  --danger: #b42318;
  --danger-bg: #fdecec;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  font-family: Poppins, 'Segoe UI', Roboto, Arial, sans-serif;
  font-size: 14px;
  color: var(--ink);
  background: var(--bg);
}

svg {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

[hidden] {
  display: none !important;
}

.page {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  min-height: 100vh;
}

/* ── Panel de marca ─────────────────────────────── */

.brand {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
  padding: 48px 56px;
  overflow: hidden;
  color: #ffffff;
  background: linear-gradient(140deg, var(--brand) 0%, var(--brand-dark) 100%);
}

.brand::before,
.brand::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}

.brand::before {
  width: 420px;
  height: 420px;
  top: -160px;
  right: -140px;
}

.brand::after {
  width: 300px;
  height: 300px;
  bottom: -120px;
  left: -90px;
}

.brand > * {
  position: relative;
  z-index: 1;
}

.brand__top {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand__logo {
  display: inline-grid;
  place-items: center;
  padding: 6px 12px;
  border: 2px solid #ffffff;
  border-radius: 8px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1;
}

.brand__logo--dark {
  border-color: var(--brand);
  color: var(--brand);
}

.brand__divider {
  width: 1px;
  height: 24px;
  background: rgba(255, 255, 255, 0.5);
}

.brand__product {
  font-weight: 500;
  opacity: 0.95;
}

.brand__title {
  max-width: 440px;
  margin: 0 0 14px;
  font-size: 34px;
  font-weight: 700;
  line-height: 1.2;
}

.brand__text {
  max-width: 440px;
  margin: 0 0 32px;
  line-height: 1.6;
  opacity: 0.9;
}

.brand__list {
  display: grid;
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.brand__list li {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 13px;
  opacity: 0.95;
}

.brand__list strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
}

.brand__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.16);
}

.brand__footer {
  margin: 0;
  font-size: 12px;
  opacity: 0.8;
}

/* ── Formulario ─────────────────────────────────── */

.panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 32px 24px;
}

.card {
  width: 100%;
  max-width: 400px;
  padding: 36px 32px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 12px 32px rgba(17, 24, 39, 0.06);
}

.card__mobile-logo {
  display: none;
  margin-bottom: 20px;
}

.card__title {
  margin: 0 0 4px;
  font-size: 24px;
  font-weight: 600;
}

.card__subtitle {
  margin: 0 0 24px;
  color: var(--muted);
}

.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 18px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--danger-bg);
  color: var(--danger);
  font-size: 13px;
  line-height: 1.45;
}

.alert svg {
  width: 18px;
  height: 18px;
  margin-top: 1px;
}

.field {
  display: block;
  margin-bottom: 16px;
}

.field__label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 500;
}

.field__control {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 46px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}

.field__control:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(13, 127, 242, 0.16);
}

.field--invalid .field__control {
  border-color: var(--danger);
}

.field__icon {
  color: #9ca3af;
}

.field__control:focus-within .field__icon {
  color: var(--brand);
}

.field input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: inherit;
  font: inherit;
}

.field input::placeholder {
  color: #a8adb7;
}

.field__toggle {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin-right: -6px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #9ca3af;
  cursor: pointer;
}

.field__toggle:hover {
  background: var(--bg);
  color: var(--ink);
}

.field__toggle:focus-visible,
.submit:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.field__toggle .icon-hide,
.field__toggle[aria-pressed='true'] .icon-show {
  display: none;
}

.field__toggle[aria-pressed='true'] .icon-hide {
  display: block;
}

.field__hint {
  display: block;
  min-height: 0;
  margin-top: 4px;
  color: var(--danger);
  font-size: 12px;
}

.caps {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: -6px 0 16px;
  color: #b45309;
  font-size: 12px;
}

.caps svg {
  width: 16px;
  height: 16px;
}

.submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 46px;
  margin-top: 8px;
  border: 0;
  border-radius: 10px;
  background: var(--brand);
  color: #ffffff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.15s,
    transform 0.05s;
}

.submit:hover {
  background: var(--brand-dark);
}

.submit:active {
  transform: translateY(1px);
}

.submit:disabled {
  cursor: progress;
  opacity: 0.85;
}

.submit__spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.submit--loading .submit__arrow {
  display: none;
}

.submit--loading .submit__spinner {
  display: block;
}

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

.card__help {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 22px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.card__help svg {
  width: 16px;
  height: 16px;
  margin-top: 1px;
}

.panel__footer {
  margin: 0;
  color: #9ca3af;
  font-size: 12px;
}

/* ── Pantallas pequeñas ─────────────────────────── */

@media (max-width: 860px) {
  .page {
    grid-template-columns: minmax(0, 1fr);
  }

  .brand {
    display: none;
  }

  .card__mobile-logo {
    display: block;
  }

  .card {
    padding: 28px 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .submit__spinner {
    animation-duration: 2s;
  }
}
