:root {
  --ink: #0f2744;
  --ink-soft: #1a3a5c;
  --forest: #1f6f5b;
  --forest-deep: #155446;
  --gold: #c4a35a;
  --paper: #f3efe6;
  --paper-2: #ebe4d6;
  --line: rgba(15, 39, 68, 0.14);
  --text: #1c2430;
  --muted: #5c6775;
  --danger: #b42318;
  --font-display: "Fraunces", "Songti SC", "SimSun", serif;
  --font-body: "Manrope", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100%;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--ink);
}
a { color: var(--forest); text-decoration: none; }
a:hover { color: var(--forest-deep); }

.ec-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
}

/* ===== Brand plane ===== */
.ec-brand {
  position: relative;
  overflow: hidden;
  color: #f7f2e8;
  min-height: 100vh;
  display: flex;
  align-items: flex-end;
  padding: clamp(28px, 5vw, 64px);
  background:
    radial-gradient(1200px 700px at 12% 18%, rgba(31, 111, 91, 0.35), transparent 55%),
    radial-gradient(900px 500px at 80% 80%, rgba(196, 163, 90, 0.18), transparent 50%),
    linear-gradient(145deg, #0b1d33 0%, #0f2744 42%, #163652 100%);
}

.ec-brand-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.ec-brand-bg .page {
  position: absolute;
  border-radius: 4px 14px 14px 4px;
  background: linear-gradient(110deg, rgba(243, 239, 230, 0.12), rgba(243, 239, 230, 0.04));
  border: 1px solid rgba(243, 239, 230, 0.14);
  box-shadow: inset 0 0 0 1px rgba(196, 163, 90, 0.08);
  transform-origin: left center;
  animation: pageFloat 8s ease-in-out infinite;
}
.ec-brand-bg .p1 {
  width: min(42vw, 420px);
  height: min(58vw, 560px);
  right: 8%;
  top: 12%;
  transform: rotate(8deg);
}
.ec-brand-bg .p2 {
  width: min(38vw, 380px);
  height: min(52vw, 520px);
  right: 16%;
  top: 16%;
  transform: rotate(14deg);
  animation-delay: -2s;
  opacity: 0.85;
}
.ec-brand-bg .p3 {
  width: min(34vw, 340px);
  height: min(48vw, 480px);
  right: 24%;
  top: 20%;
  transform: rotate(20deg);
  animation-delay: -4s;
  opacity: 0.65;
}
.ec-brand-bg .grain {
  position: absolute;
  inset: 0;
  opacity: 0.18;
  background-image:
    radial-gradient(rgba(255, 255, 255, 0.12) 0.6px, transparent 0.7px);
  background-size: 3px 3px;
  mix-blend-mode: soft-light;
}

@keyframes pageFloat {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -10px; }
}

.ec-brand-inner {
  position: relative;
  z-index: 1;
  max-width: 520px;
  animation: riseIn 0.8s ease both;
}

.ec-logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  margin-bottom: 28px;
}
.ec-logo img {
  display: block;
  width: 48px;
  height: 48px;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.2));
}
.ec-logo-text {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.ec-logo:hover { color: #fff; }

.ec-headline {
  margin: 0 0 16px;
  font-family: var(--font-display);
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.02em;
}
.ec-lead {
  margin: 0 0 28px;
  max-width: 36ch;
  font-size: 16px;
  line-height: 1.65;
  color: rgba(247, 242, 232, 0.78);
}
.ec-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  color: var(--gold);
  font-weight: 600;
  border-bottom: 1px solid rgba(196, 163, 90, 0.45);
  transition: border-color 0.25s ease, color 0.25s ease;
}
.ec-ghost:hover {
  color: #e0c27a;
  border-color: #e0c27a;
}

/* ===== Form panel ===== */
.ec-panel {
  background:
    linear-gradient(180deg, var(--paper) 0%, var(--paper-2) 100%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(28px, 5vw, 56px) clamp(24px, 4vw, 48px);
  position: relative;
  animation: panelIn 0.7s ease 0.1s both;
}

.ec-panel::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(15, 39, 68, 0.18), transparent);
}

.ec-panel-head { margin-bottom: 28px; }
.ec-logo-sm {
  margin-bottom: 28px;
  color: var(--ink);
}
.ec-logo-sm img {
  height: 40px;
  width: auto;
  filter: none;
}
.ec-brand .ec-logo img {
  width: 52px;
  height: 52px;
  padding: 0;
  background: transparent;
  border-radius: 0;
}
.ec-panel-kicker {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--forest);
}
.ec-panel-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(26px, 3vw, 34px);
  font-weight: 700;
  color: var(--ink);
  line-height: 1.25;
}
.ec-panel-tip {
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
  max-width: 38ch;
}
.ec-reg .ec-panel {
  justify-content: flex-start;
  padding-top: clamp(36px, 6vh, 72px);
  padding-bottom: 40px;
  overflow-y: auto;
}
.ec-reg .ec-form {
  gap: 14px;
}

.ec-form {
  display: grid;
  gap: 16px;
  max-width: 380px;
}
.ec-field {
  display: grid;
  gap: 8px;
}
.ec-field > span,
.ec-captcha label > span {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.ec-field input,
.ec-captcha input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.72);
  font: inherit;
  font-size: 15px;
  color: var(--text);
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}
.ec-field input:hover,
.ec-captcha input:hover {
  border-color: rgba(31, 111, 91, 0.45);
}
.ec-field input:focus,
.ec-captcha input:focus {
  outline: none;
  border-color: var(--forest);
  background: #fff;
  transform: translateY(-1px);
}
.ec-captcha {
  display: grid;
  grid-template-columns: 1fr 140px;
  gap: 12px;
  align-items: end;
}
.ec-captcha label { display: grid; gap: 8px; }
.ec-captcha-img {
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
}
.ec-captcha-img img {
  width: 100%;
  height: 100%;
  display: block;
  cursor: pointer;
  object-fit: cover;
}

.ec-submit {
  margin-top: 6px;
  height: 48px;
  border: 0;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--forest) 0%, var(--forest-deep) 100%);
  color: #fff;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease;
}
.ec-submit:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}
.ec-submit:active { transform: translateY(0); }

.ec-links {
  max-width: 380px;
  margin-top: 18px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
  color: var(--muted);
}
.ec-links a { font-weight: 600; }

.ec-foot {
  margin-top: 40px;
  max-width: 380px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 12px;
  color: rgba(92, 103, 117, 0.9);
}
.ec-foot a { color: inherit; }

@keyframes riseIn {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes panelIn {
  from { opacity: 0; transform: translateX(16px); }
  to { opacity: 1; transform: translateX(0); }
}

@media (max-width: 900px) {
  .ec-shell {
    grid-template-columns: 1fr;
  }
  .ec-brand {
    min-height: 42vh;
    align-items: flex-end;
    padding: 28px 22px 32px;
  }
  .ec-brand-bg .p1,
  .ec-brand-bg .p2,
  .ec-brand-bg .p3 {
    opacity: 0.45;
  }
  .ec-headline { font-size: 34px; }
  .ec-lead { margin-bottom: 18px; }
  .ec-panel {
    min-height: auto;
    padding: 32px 22px 40px;
  }
  .ec-panel::before { display: none; }
  .ec-logo-sm { display: none; }
  .ec-form,
  .ec-links,
  .ec-foot { max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  .ec-brand-bg .page,
  .ec-brand-inner,
  .ec-panel {
    animation: none !important;
  }
}
