@import url("https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@500;600;700&family=Manrope:wght@400;500;600;700;800&family=Noto+Sans+SC:wght@400;500;700&display=swap");

:root {
  --bg: #f6f8fb;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-strong: rgba(255, 255, 255, 0.96);
  --line: rgba(18, 22, 31, 0.12);
  --line-strong: rgba(18, 22, 31, 0.22);
  --text: #10131a;
  --muted: #5f6878;
  --accent: #2f5eb4;
  --accent-deep: #17356b;
  --accent-soft: #d8e6ff;
  --success: #16765f;
  --error: #b93636;
  --shadow: 0 28px 80px rgba(22, 34, 62, 0.1);
  --max-width: 1160px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Manrope", "Noto Sans SC", sans-serif;
  background:
    linear-gradient(135deg, rgba(47, 94, 180, 0.1), transparent 34%),
    repeating-linear-gradient(
      180deg,
      rgba(16, 19, 26, 0.018) 0,
      rgba(16, 19, 26, 0.018) 1px,
      transparent 1px,
      transparent 18px
    ),
    linear-gradient(180deg, #fbfcfe 0%, #f2f5fa 52%, #eef2f7 100%);
}

body.modal-open {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

img,
svg {
  display: block;
  max-width: 100%;
}

button,
input {
  font: inherit;
}

.login-shell {
  min-height: 100vh;
  overflow-x: hidden;
}

.login-container {
  width: min(calc(100% - 40px), var(--max-width));
  margin: 0 auto;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
  margin-bottom: 1.6rem;
}

.brand-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 16px;
  background: var(--surface-strong);
  border: 1px solid rgba(18, 22, 31, 0.08);
  box-shadow: 0 12px 32px rgba(22, 34, 62, 0.06);
}

.brand-mark__icon {
  width: 29px;
  height: auto;
}

.brand-copy {
  min-width: 0;
}

.brand-copy small,
.eyebrow,
.form-heading span {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.brand-copy strong {
  display: block;
  font-size: 1.05rem;
  font-weight: 800;
  white-space: nowrap;
}

.login-main {
  min-height: 100vh;
  display: grid;
  align-items: center;
  padding: 4rem 0;
}

.login-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 440px);
  gap: 4rem;
  align-items: center;
}

.login-copy {
  max-width: 620px;
}

.login-copy h1 {
  margin: 1rem 0 1.25rem;
  max-width: 580px;
  font-family: "Cormorant Garamond", "Noto Sans SC", serif;
  font-size: 5rem;
  line-height: 0.94;
  font-weight: 700;
}

.login-copy p {
  margin: 0;
  max-width: 580px;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.9;
}

.login-proof {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

.login-proof span {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 1rem;
  border-radius: 999px;
  color: var(--accent-deep);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(18, 22, 31, 0.08);
  box-shadow: 0 10px 26px rgba(16, 19, 26, 0.04);
}

.login-card {
  width: 100%;
  padding: 2rem;
  border-radius: 28px;
  background: var(--surface-strong);
  border: 1px solid rgba(18, 22, 31, 0.1);
  box-shadow: var(--shadow);
}

.form-heading {
  margin-bottom: 1.6rem;
}

.form-heading h2 {
  margin: 0.35rem 0 0;
  font-size: 1.75rem;
  line-height: 1.2;
}

.field {
  display: grid;
  gap: 0.55rem;
  margin-bottom: 1rem;
}

.field > span:first-child {
  color: var(--text);
  font-size: 0.94rem;
  font-weight: 700;
}

.field input {
  width: 100%;
  min-height: 52px;
  padding: 0 1rem;
  border: 1px solid rgba(18, 22, 31, 0.12);
  border-radius: 16px;
  outline: none;
  color: var(--text);
  background: rgba(246, 248, 251, 0.78);
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.field input:focus {
  border-color: rgba(47, 94, 180, 0.54);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(47, 94, 180, 0.12);
}

.field input.is-invalid {
  border-color: rgba(185, 54, 54, 0.72);
  box-shadow: 0 0 0 4px rgba(185, 54, 54, 0.1);
}

.password-control {
  position: relative;
  display: block;
}

.password-control input {
  padding-right: 3.25rem;
}

.icon-button {
  position: absolute;
  right: 0.48rem;
  top: 50%;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 12px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.icon-button:hover {
  color: var(--accent-deep);
  background: rgba(47, 94, 180, 0.08);
}

.icon-button svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0.4rem 0 1.1rem;
}

.remember {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
  cursor: pointer;
}

.remember input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.form-row a,
.signup-note a {
  color: var(--accent-deep);
  font-weight: 700;
}

.form-message {
  min-height: 1.35rem;
  margin: 0 0 0.8rem;
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--muted);
}

.form-message.is-error {
  color: var(--error);
}

.form-message.is-success {
  color: var(--success);
}

.submit-button {
  width: 100%;
  min-height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent-deep), var(--accent));
  box-shadow: 0 16px 30px rgba(47, 94, 180, 0.22);
  font-weight: 800;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.submit-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 36px rgba(47, 94, 180, 0.25);
}

.submit-button:disabled,
.button:disabled {
  cursor: not-allowed;
  opacity: 0.7;
  transform: none;
  box-shadow: none;
}

.submit-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.signup-note {
  margin: 1.2rem 0 0;
  color: var(--muted);
  text-align: center;
}

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(11, 17, 29, 0.32);
  backdrop-filter: blur(12px);
}

.auth-modal[hidden] {
  display: none;
}

.auth-modal__card {
  width: min(100%, 520px);
  padding: 1.35rem;
  border-radius: 28px;
  border: 1px solid rgba(18, 22, 31, 0.08);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 26px 70px rgba(16, 19, 26, 0.16);
}

.auth-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.auth-modal__header h3 {
  margin: 0.2rem 0 0;
  font-size: 1.5rem;
}

.auth-modal__close {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(18, 22, 31, 0.08);
  border-radius: 14px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.82);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.auth-modal__close:hover {
  color: var(--text);
  background: rgba(216, 230, 255, 0.28);
}

.auth-modal__form {
  display: grid;
  gap: 0.95rem;
}

.auth-modal__hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.7;
}

.auth-modal__field {
  display: grid;
  gap: 0.45rem;
}

.auth-modal__field--grow {
  flex: 1;
}

.auth-modal__field span {
  font-size: 0.9rem;
  font-weight: 700;
}

.auth-modal__field input {
  width: 100%;
  min-height: 48px;
  padding: 0 0.95rem;
  border: 1px solid rgba(18, 22, 31, 0.1);
  border-radius: 16px;
  outline: none;
  color: var(--text);
  background: rgba(248, 250, 253, 0.92);
}

.auth-modal__field input:focus {
  border-color: rgba(47, 94, 180, 0.46);
  box-shadow: 0 0 0 4px rgba(47, 94, 180, 0.1);
  background: #fff;
}

.auth-modal__field input.is-invalid {
  border-color: rgba(185, 54, 54, 0.72);
  box-shadow: 0 0 0 4px rgba(185, 54, 54, 0.1);
}

.auth-modal__message {
  min-height: 1.35rem;
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.auth-modal__message.is-error {
  color: var(--error);
}

.auth-modal__message.is-success {
  color: var(--success);
}

.auth-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.8rem;
}

.auth-modal__inline {
  display: flex;
  align-items: flex-end;
  gap: 0.8rem;
}

.auth-modal__send-code {
  min-width: 132px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 1.2rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.button-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--accent-deep), var(--accent));
  box-shadow: 0 14px 30px rgba(47, 94, 180, 0.18);
}

.button-secondary {
  color: var(--text);
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(18, 22, 31, 0.08);
}

@media (max-width: 920px) {
  .login-main {
    align-items: start;
    padding: 3rem 0;
  }

  .login-layout {
    grid-template-columns: 1fr;
    gap: 2.4rem;
  }

  .login-copy h1 {
    max-width: 520px;
    font-size: 4rem;
  }

  .login-card {
    max-width: 520px;
  }
}

@media (max-width: 640px) {
  .login-container {
    width: min(calc(100% - 32px), var(--max-width));
  }

  .login-main {
    padding: 2.5rem 0;
  }

  .login-copy h1 {
    font-size: 3.2rem;
  }

  .login-copy p {
    font-size: 1rem;
  }

  .login-proof {
    margin-top: 1.5rem;
  }

  .login-card {
    padding: 1.35rem;
    border-radius: 22px;
  }

  .form-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.8rem;
  }

  .auth-modal__actions {
    flex-direction: column-reverse;
  }

  .auth-modal__actions .button {
    width: 100%;
  }

  .auth-modal__inline {
    flex-direction: column;
    align-items: stretch;
  }

  .auth-modal__send-code {
    width: 100%;
  }
}
