@import url("cp-tokens.css");

body.cp-login {
  min-height: 100vh;
  margin: 0;
  display: grid;
  place-items: center;
  padding: 40px 24px;
  background: var(--cp-surface-sunken);
}

.login-shell {
  width: min(1080px, 100%);
  min-height: 620px;
  display: grid;
  grid-template-columns: 1.02fr 1fr;
  overflow: hidden;
  background: var(--cp-surface);
  border: 1px solid var(--cp-border);
  border-radius: 24px;
  box-shadow: 0 28px 64px rgba(88, 10, 32, 0.12);
}

.brand-panel {
  position: relative;
  background: var(--cp-brand);
  color: #fff;
  padding: 36px 40px 32px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 36px;
  isolation: isolate;
  overflow: hidden;
}
.brand-scene {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}
.brand-scene img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.brand-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(153, 0, 51, 0.92) 0%, rgba(153, 0, 51, 0.58) 52%, rgba(153, 0, 51, 0.86) 100%);
  pointer-events: none;
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-tile {
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  display: grid;
  place-items: center;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.14);
}
.brand-tile img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  display: block;
}
.brand-names { display: flex; flex-direction: column; gap: 2px; }
.brand-wordmark {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.15;
}
.brand-wordmark span { color: #f3c5d0; }
.version-pill {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.7);
}

.brand-copy { margin: auto 0; }
.eyebrow {
  margin: 0 0 14px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.62);
}
.brand-panel h1 {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.1vw, 36px);
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: -0.03em;
  margin: 0;
}
.intro {
  margin: 0;
  max-width: 22em;
  color: rgba(255, 255, 255, 0.82);
  font-size: 15px;
  line-height: 1.55;
}
.brand-foot {
  margin: 18px 0 0;
  font-size: 15px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.78);
  text-align: center;
}

.form-panel {
  padding: 24px 44px 44px;
  display: flex;
  flex-direction: column;
  background: var(--cp-surface);
}
.form-panel-top {
  display: flex;
  justify-content: flex-end;
}
.theme-toggle {
  background: var(--cp-surface);
  border: 1px solid var(--cp-border);
  color: var(--cp-muted);
  border-radius: 999px;
  padding: 7px 14px;
  cursor: pointer;
  font: 500 12px/1 var(--font-sans);
}
.theme-toggle:hover { border-color: var(--cp-brand); color: var(--cp-brand-ink); }
.theme-toggle:focus-visible,
.field:focus-within,
.sign-in:focus-visible {
  outline: 2px solid var(--cp-brand);
  outline-offset: 2px;
}

.login-card {
  margin: auto 0;
  max-width: 400px;
  width: 100%;
}
.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin: 0 0 18px;
}
.card-logo {
  display: block;
  width: 80px;
  height: 80px;
  object-fit: contain;
  margin: 0 0 12px;
}
.product-name {
  margin: 0;
  color: var(--cp-brand);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.login-card h2 {
  font-family: var(--font-display);
  font-size: 30px;
  margin: 0 0 22px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.15;
}
label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin: 0 0 8px;
}
.field {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  border: 1px solid transparent;
  background: #f4f0f1;
  border-radius: 12px;
  padding: 0 14px;
}
.field-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  color: #9a7e87;
}
.field input {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--cp-ink);
  padding: 13px 0;
  outline: none;
  font: 400 14px/1.4 var(--font-sans);
}
.field input::placeholder { color: #9a7e87; }
.field:focus-within {
  background: var(--cp-surface);
  border-color: var(--cp-brand);
  box-shadow: 0 0 0 3px var(--cp-brand-soft);
}

.sign-in {
  width: 100%;
  margin-top: 8px;
  background: var(--cp-brand);
  color: #fff;
  border: 0;
  border-radius: 12px;
  padding: 14px 16px;
  font: 600 14px/1 var(--font-sans);
  cursor: pointer;
}
.sign-in:hover { background: var(--cp-brand-ink); }

.cf-alert { padding: 10px 12px; border-radius: 10px; font-size: 13px; margin-bottom: 14px; }
.cf-alert-error { background: rgba(185, 28, 28, 0.08); color: #b91c1c; border: 1px solid rgba(185, 28, 28, 0.22); }

:root[data-theme="dark"] .login-shell {
  border-color: var(--cp-border);
  box-shadow: 0 28px 64px rgba(0, 0, 0, 0.45);
}
:root[data-theme="dark"] .field {
  background: #1c1216;
  border-color: var(--cp-border);
}
:root[data-theme="dark"] .field:focus-within { background: #22161a; }
:root[data-theme="dark"] .theme-toggle { background: transparent; }

@media (max-width: 860px) {
  body.cp-login { padding: 16px; place-items: start center; }
  .login-shell {
    grid-template-columns: 1fr;
    min-height: 0;
    width: 100%;
  }
  .brand-panel { display: none; }
  .form-panel { padding: 16px 22px 32px; }
  .login-card { margin: 12px 0 0; max-width: none; }
}
