@import url('/design/tokens.css');

body.is-login-page {
  overflow: hidden;
  margin: 0;
  font-family: var(--msp-font) !important;
  color: var(--msp-text);
  background: var(--msp-bg);
  -webkit-font-smoothing: antialiased;
}

body.is-login-page #app-root {
  min-height: 100vh;
}

.login-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 1fr;
}

@media (min-width: 960px) {
  .login-shell {
    grid-template-columns: 1.05fr 0.95fr;
  }
}

/* ── Hero ── */
.login-hero {
  display: none;
  position: relative;
  padding: clamp(2rem, 5vw, 3.5rem);
  overflow: hidden;
}

@media (min-width: 960px) {
  .login-hero {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }
}

.login-hero__media {
  position: absolute;
  inset: 0;
}

.login-hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.02);
}

.login-hero__shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(160deg, rgba(12, 14, 18, 0.92) 0%, rgba(12, 14, 18, 0.55) 45%, rgba(12, 14, 18, 0.88) 100%),
    radial-gradient(ellipse 70% 50% at 20% 80%, rgba(91, 141, 239, 0.18), transparent 60%);
}

.login-hero__grid {
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, black 20%, transparent 90%);
}

.login-hero > *:not(.login-hero__media) {
  position: relative;
  z-index: 1;
}

.login-hero__brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.login-hero__logo {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  background: linear-gradient(145deg, var(--msp-accent), #3d6fd4);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(91, 141, 239, 0.35);
}

.login-hero__logo svg {
  width: 22px;
  height: 22px;
}

.login-hero__brand-name {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.login-hero__content {
  max-width: 26rem;
  margin: auto 0;
  padding: 2rem 0;
}

.login-hero__content h2 {
  margin: 0 0 1rem;
  font-size: clamp(1.75rem, 3vw, 2.35rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.login-hero__content > p {
  margin: 0 0 2rem;
  color: var(--msp-text-secondary);
  font-size: 1rem;
  line-height: 1.6;
}

.login-hero__features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.login-hero__features li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  color: var(--msp-text-secondary);
}

.login-hero__feature-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--msp-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--msp-accent);
  flex-shrink: 0;
}

.login-hero__feature-icon svg {
  width: 17px;
  height: 17px;
}

.login-hero__footnote {
  margin: 0;
  font-size: 0.8rem;
  color: var(--msp-text-muted);
}

/* ── Form side ── */
.login-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: clamp(1.5rem, 4vw, 3rem);
  position: relative;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(91, 141, 239, 0.08), transparent 55%),
    var(--msp-bg);
}

.login-panel__mobile-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 2rem;
  align-self: flex-start;
}

@media (min-width: 960px) {
  .login-panel__mobile-brand {
    display: none;
  }
}

.login-panel__mobile-brand .login-hero__logo {
  width: 36px;
  height: 36px;
}

.login-panel__mobile-brand span {
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.02em;
}

/* ── Login card frame (gradient border + glow) ── */
.login-card-frame {
  width: 100%;
  max-width: 420px;
  position: relative;
}

.login-card-frame::before {
  content: '';
  position: absolute;
  inset: -40px -20px -20px;
  background: radial-gradient(ellipse 70% 55% at 50% 40%, rgba(91, 141, 239, 0.18), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.login-card {
  position: relative;
  z-index: 1;
  border-radius: 20px;
  padding: 1px;
  background: linear-gradient(
    155deg,
    rgba(91, 141, 239, 0.55) 0%,
    rgba(255, 255, 255, 0.12) 35%,
    rgba(91, 141, 239, 0.08) 65%,
    rgba(255, 255, 255, 0.06) 100%
  );
  box-shadow:
    0 40px 80px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.04);
}

.login-card__glow {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 70%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  z-index: 2;
  pointer-events: none;
}

.login-card__header,
.login-card__body,
.login-card__footer {
  background: linear-gradient(180deg, #1a2030 0%, #141820 100%);
}

.login-card__header {
  text-align: center;
  padding: 2.25rem 2rem 1.5rem;
  border-radius: 19px 19px 0 0;
}

.login-card__mark {
  width: 52px;
  height: 52px;
  margin: 0 auto 1.15rem;
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(91, 141, 239, 0.25), rgba(91, 141, 239, 0.08));
  border: 1px solid rgba(91, 141, 239, 0.35);
  color: var(--msp-accent-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(91, 141, 239, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.login-card__mark svg {
  width: 26px;
  height: 26px;
}

.login-card__header h1 {
  margin: 0 0 0.35rem;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.035em;
  color: var(--msp-text);
}

.login-card__header p {
  margin: 0;
  color: var(--msp-text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
}

.login-card__body {
  padding: 0.25rem 2rem 1.75rem;
}

.login-card__footer {
  padding: 1.15rem 2rem 1.65rem;
  border-radius: 0 0 19px 19px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: linear-gradient(180deg, #141820 0%, #12161e 100%);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.login-field label {
  display: block;
  margin-bottom: 0.45rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--msp-text-muted);
  letter-spacing: 0.01em;
}

.login-input-wrap {
  position: relative;
}

.login-input-wrap svg.field-icon {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  width: 17px;
  height: 17px;
  color: var(--msp-text-muted);
  pointer-events: none;
  transition: color 0.15s;
}

.login-input-wrap:focus-within svg.field-icon {
  color: var(--msp-accent);
}

.login-input {
  width: 100%;
  height: 48px;
  padding: 0 0.9rem 0 2.75rem;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  background: rgba(8, 10, 14, 0.65);
  color: var(--msp-text);
  font: inherit;
  font-size: 0.92rem;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.login-input::placeholder {
  color: rgba(107, 117, 133, 0.85);
}

.login-input:hover {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(8, 10, 14, 0.85);
}

.login-input:focus {
  outline: none;
  border-color: rgba(91, 141, 239, 0.65);
  box-shadow: 0 0 0 3px rgba(91, 141, 239, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.03);
  background: rgba(8, 10, 14, 0.95);
}

.login-input--password {
  padding-right: 2.75rem;
}

.login-toggle-pw {
  position: absolute;
  right: 0.45rem;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--msp-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, background 0.15s;
}

.login-toggle-pw:hover {
  color: var(--msp-text);
  background: rgba(255, 255, 255, 0.06);
}

.login-toggle-pw svg {
  width: 17px;
  height: 17px;
}

.login-error {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin: 0;
  padding: 0.65rem 0.8rem;
  border-radius: 10px;
  background: rgba(240, 113, 120, 0.08);
  border: 1px solid rgba(240, 113, 120, 0.18);
  color: #fca5a5;
  font-size: 0.82rem;
  line-height: 1.4;
}

.login-error::before {
  content: '!';
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: rgba(240, 113, 120, 0.2);
  color: var(--msp-err);
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}

.login-submit {
  margin-top: 0.25rem;
  width: 100%;
  height: 48px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(180deg, #6798f5 0%, #4a82eb 100%);
  color: #fff;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.12) inset,
    0 8px 24px rgba(74, 130, 235, 0.35);
  transition: transform 0.12s, box-shadow 0.15s, filter 0.15s;
}

.login-submit svg {
  width: 18px;
  height: 18px;
  opacity: 0.9;
  transition: transform 0.15s;
}

.login-submit:hover:not(:disabled) {
  filter: brightness(1.05);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.14) inset,
    0 12px 28px rgba(74, 130, 235, 0.42);
}

.login-submit:hover:not(:disabled) svg {
  transform: translateX(3px);
}

.login-submit:active:not(:disabled) {
  transform: scale(0.985);
}

.login-submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.login-card__hint {
  margin: 0;
  text-align: center;
  font-size: 0.8rem;
  color: var(--msp-text-muted);
  line-height: 1.5;
}

.login-card__hint button {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: inherit;
  color: var(--msp-accent);
  cursor: pointer;
  text-decoration: none;
  transition: color 0.15s;
}

.login-card__hint button:hover {
  color: var(--msp-accent-hover);
  text-decoration: underline;
  text-underline-offset: 2px;
}
