html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: #eef4fb;
  color: #0f172a;
}

body {
  min-height: 100vh;
}

.portal-shell {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at 15% 18%, rgba(14, 165, 233, 0.14), transparent 24%),
    radial-gradient(circle at 85% 12%, rgba(37, 99, 235, 0.12), transparent 22%),
    linear-gradient(180deg, #f8fbff 0%, #eef4fb 56%, #edf3fb 100%);
}

.portal-backdrop {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(37, 99, 235, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 99, 235, 0.028) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at center, black 56%, transparent 100%);
}

.portal-shell::before,
.portal-shell::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
  filter: blur(10px);
}

.portal-shell::before {
  width: 280px;
  height: 280px;
  top: -80px;
  left: -90px;
  background: rgba(34, 199, 238, 0.12);
}

.portal-shell::after {
  width: 240px;
  height: 240px;
  right: -70px;
  bottom: -70px;
  background: rgba(59, 130, 246, 0.1);
}

.portal-layout {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px 16px;
  box-sizing: border-box;
  max-width: 100%;
  margin: 0 auto;
}

.portal-panel {
  width: min(100%, 356px);
  padding: 18px 18px 16px;
  border: 1px solid rgba(148, 163, 184, 0.17);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
  box-shadow:
    0 24px 54px rgba(15, 23, 42, 0.08),
    0 2px 10px rgba(15, 23, 42, 0.04);
}

.panel-header {
  margin-bottom: 10px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #0fb8ff, #2058ff);
  box-shadow: 0 10px 20px rgba(32, 88, 255, 0.18);
}

.brand-icon.has-logo {
  padding: 4px;
  color: transparent;
  background-color: rgba(255, 255, 255, 0.98);
  background-image: none;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
  border: 1px solid rgba(191, 219, 254, 0.95);
}

.brand-lockup h2 {
  margin: 0 0 1px;
  font-size: 18px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.brand-lockup p {
  margin: 0;
  font-size: 11.5px;
  color: #64748b;
}

.portal-alert {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 12.5px;
  line-height: 1.45;
}

.portal-alert.error {
  background: #fff0f0;
  border: 1px solid #ffc7c7;
  color: #c91b1b;
}

.portal-alert.success {
  background: #effcf6;
  border: 1px solid #bdeed1;
  color: #167b49;
}

.auth-form {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.auth-form.hidden,
.portal-alert.hidden {
  display: none;
}

.auth-form label {
  display: grid;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 500;
  color: #29415f;
}

.auth-form input {
  border: 1px solid #d4e2f0;
  background: #fbfdff;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13.5px;
  color: #0f172a;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.auth-form input:focus {
  border-color: #139fff;
  box-shadow: 0 0 0 3px rgba(19, 159, 255, 0.14);
  background: #fff;
}

.checkbox-row {
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 7px;
  margin-top: 1px;
}

.checkbox-row input {
  width: 15px;
  height: 15px;
  padding: 0;
  margin: 0;
}

.checkbox-row span {
  font-size: 12.5px;
}

.primary-action {
  border: 0;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 13.5px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(90deg, #1797d2, #2563eb);
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.14);
  transition: transform 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease;
}

.primary-action:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 12px 22px rgba(37, 99, 235, 0.18);
}

.primary-action:disabled {
  cursor: wait;
  opacity: 0.72;
}

.panel-footer {
  margin-top: 10px;
  text-align: center;
}

.secondary-link {
  display: inline-block;
  font-size: 11.5px;
  color: #64748b;
}

@media (max-width: 960px) {
  .portal-layout {
    padding: 16px;
  }

  .portal-panel {
    width: min(100%, 344px);
    padding: 16px 16px 14px;
  }
}
