.auth-page {
  --ti-bg: #f5f3ef;
  --ti-card: #ffffff;
  --ti-ink: #1d1b2e;
  --ti-muted: #6e6b80;
  --ti-line: #e4e1ea;
  --ti-accent: #6c4cf1;
  --ti-accent-2: #9b6bff;
  --ti-accent-soft: #efeafe;
  --ti-danger: #e5484d;
  --ti-ok: #2fa66a;
  --ti-radius: 14px;
  --ti-font-body: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ti-font-head: "Fraunces", Georgia, serif;

  margin: 0;
  min-height: 100vh;
  background: var(--ti-bg);
  color: var(--ti-ink);
  font-family: var(--ti-font-body);
  -webkit-font-smoothing: antialiased;
}

.auth-page *,
.auth-page *::before,
.auth-page *::after { box-sizing: border-box; }

/* ---------- Layout ---------- */
.ti-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
}

/* ---------- Brand panel ---------- */
.ti-showcase {
  position: relative;
  overflow: hidden;
  padding: 44px 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
  color: #fff;
  background: linear-gradient(145deg, #4b2bd6 0%, #6c4cf1 45%, #b06bff 100%);
}

.ti-blob {
  position: absolute;
  border-radius: 50%;
  opacity: 0.55;
  animation: ti-float 14s ease-in-out infinite;
  pointer-events: none;
}
.ti-blob-1 { width: 380px; height: 380px; top: -120px; right: -100px; background: radial-gradient(circle at 30% 30%, #ff9ec4, transparent 70%); }
.ti-blob-2 { width: 460px; height: 460px; bottom: -180px; left: -140px; background: radial-gradient(circle at 60% 40%, #6fe3ff, transparent 70%); animation-delay: -5s; }

@keyframes ti-float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(24px, -30px) scale(1.08); }
}

.auth-page .ti-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.01em;
  color: inherit;
  text-decoration: none;
}
.ti-showcase > * { position: relative; z-index: 1; }
.ti-showcase > .ti-blob { position: absolute; z-index: 0; }

.ti-showcase-copy h2 {
  margin: 0 0 14px;
  font-family: var(--ti-font-head);
  font-size: clamp(2rem, 3.2vw, 3rem);
  line-height: 1.1;
  font-weight: 700;
  color: #fff;
}
.ti-showcase-copy p {
  margin: 0;
  max-width: 380px;
  line-height: 1.6;
  opacity: 0.92;
}

/* Mock invoice card */
.ti-invoice {
  width: min(100%, 340px);
  padding: 20px 22px;
  border-radius: 18px;
  color: var(--ti-ink);
  background: rgba(255,255,255,0.96);
  box-shadow: 0 24px 50px -20px rgba(20, 10, 80, 0.5);
  transform: rotate(-2deg);
  font-size: 0.88rem;
}
.ti-inv-top {
  display: flex; justify-content: space-between; align-items: center;
  padding-bottom: 14px;
  border-bottom: 1px dashed var(--ti-line);
}
.ti-inv-top small { display: block; color: var(--ti-muted); font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.08em; }
.ti-inv-top strong { font-family: var(--ti-font-head); font-size: 1.15rem; }
.ti-badge {
  padding: 4px 12px;
  border-radius: 999px;
  background: #e3f6ec; color: var(--ti-ok);
  font-weight: 700; font-size: 0.76rem;
}
.ti-invoice ul { list-style: none; margin: 14px 0; padding: 0; display: grid; gap: 10px; }
.ti-invoice li { display: flex; justify-content: space-between; gap: 12px; color: var(--ti-muted); }
.ti-invoice li b { color: var(--ti-ink); font-weight: 600; }
.ti-total {
  display: flex; justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--ti-line);
  font-weight: 700;
}
.ti-total b { color: var(--ti-accent); font-size: 1.05rem; }

/* ---------- Form panel ---------- */
.ti-panel {
  display: grid;
  place-items: center;
  padding: 32px 24px;
}

.ti-card {
  width: 100%;
  max-width: 440px;
  padding: 40px 36px 30px;
  background: var(--ti-card);
  border-radius: 24px;
  box-shadow: 0 30px 80px -30px rgba(60, 40, 140, 0.35);
  animation: ti-rise 0.6s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes ti-rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}

.ti-brand-mobile { display: none !important; color: var(--ti-accent) !important; margin-bottom: 20px; }

.ti-head { margin-bottom: 26px; }
.ti-head h1 {
  margin: 0 0 8px;
  font-family: var(--ti-font-head);
  font-size: 1.9rem;
  line-height: 1.15;
  color: var(--ti-ink);
}
.ti-head p { margin: 0; color: var(--ti-muted); font-size: 0.97rem; }

/* Server error alert */
.auth-page .ti-alert {
  margin: 0 0 20px;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 0.9rem;
  line-height: 1.4;
  color: #b42318;
  background: #fdecec;
  border: 1px solid #f7c9c9;
}

/* Form */
.ti-form { display: flex; flex-direction: column; gap: 18px; margin: 0; }

.ti-field label {
  display: block;
  margin-bottom: 7px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ti-ink);
}

.ti-field input {
  width: 100%;
  height: 50px;
  margin: 0;
  padding: 0 16px;
  font: inherit;
  font-size: 0.97rem;
  color: var(--ti-ink);
  background: #fff;
  border: 1.5px solid var(--ti-line);
  border-radius: var(--ti-radius);
  outline: none;
  box-shadow: none;
  transition: border-color .2s, box-shadow .2s;
}
.ti-field input::placeholder { color: #a8a5b8; }
.ti-field input:focus {
  border-color: var(--ti-accent);
  box-shadow: 0 0 0 4px var(--ti-accent-soft);
}
.ti-field.is-invalid input {
  border-color: var(--ti-danger);
  box-shadow: 0 0 0 4px rgba(229, 72, 77, 0.1);
}
.ti-field.is-valid input { border-color: var(--ti-ok); }

.ti-input-wrap { position: relative; }
.ti-input-wrap input { padding-right: 52px; }

.ti-error {
  display: block;
  margin-top: 6px;
  padding-left: 2px;
  font-size: 0.8rem;
  color: var(--ti-danger);
}
.ti-error:empty { display: none; }

/* Show / hide password */
.ti-eye {
  position: absolute; top: 6px; right: 6px;
  width: 38px; height: 38px;
  display: grid; place-items: center;
  padding: 0;
  border: 0; border-radius: 10px;
  background: none;
  color: var(--ti-muted);
  cursor: pointer;
  transition: background .2s, color .2s;
}
.ti-eye:hover, .ti-eye:focus-visible { background: var(--ti-accent-soft); color: var(--ti-accent); outline: none; }
.ti-eye .ti-eye-closed { display: none; }
.ti-eye.is-on .ti-eye-open { display: none; }
.ti-eye.is-on .ti-eye-closed { display: block; }

/* Password strength meter */
.ti-strength {
  display: grid;
  grid-template-columns: repeat(4, 1fr) auto;
  gap: 6px;
  align-items: center;
  margin-top: 10px;
}
.ti-strength span { height: 4px; border-radius: 4px; background: var(--ti-line); transition: background .3s; }
.ti-strength em { min-width: 84px; margin-left: 6px; font-style: normal; font-size: 0.76rem; color: var(--ti-muted); }
.ti-strength[data-level="1"] span:nth-child(-n+1) { background: var(--ti-danger); }
.ti-strength[data-level="2"] span:nth-child(-n+2) { background: #f5a524; }
.ti-strength[data-level="3"] span:nth-child(-n+3) { background: #7ac74f; }
.ti-strength[data-level="4"] span:nth-child(-n+4) { background: var(--ti-ok); }

/* Submit button (keeps your .button .full classes, overrides the look) */
.auth-page .ti-submit {
  position: relative;
  width: 100%;
  margin: 4px 0 0;
  padding: 15px;
  border: 0;
  border-radius: var(--ti-radius);
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--ti-accent), var(--ti-accent-2));
  box-shadow: 0 12px 24px -10px rgba(108, 76, 241, 0.7);
  cursor: pointer;
  transition: transform .2s, box-shadow .2s, opacity .2s;
}
.auth-page .ti-submit:hover { transform: translateY(-2px); box-shadow: 0 16px 28px -10px rgba(108, 76, 241, 0.8); }
.auth-page .ti-submit:active { transform: none; }
.auth-page .ti-submit:focus-visible { outline: 3px solid var(--ti-accent-soft); outline-offset: 2px; }
.auth-page .ti-submit.is-loading { opacity: 0.9; cursor: progress; pointer-events: none; }
.ti-spinner {
  display: none;
  position: absolute; inset: 0; margin: auto;
  width: 22px; height: 22px;
  border: 3px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: ti-spin .7s linear infinite;
}
.ti-submit.is-loading .ti-submit-label { visibility: hidden; }
.ti-submit.is-loading .ti-spinner { display: block; }
@keyframes ti-spin { to { transform: rotate(360deg); } }

/* Footer links */
.auth-page .ti-footer {
  margin: 24px 0 0;
  text-align: center;
  font-size: 0.92rem;
  color: var(--ti-muted);
}
.auth-page .ti-footer a,
.auth-page .ti-back {
  color: var(--ti-accent);
  font-weight: 600;
  text-decoration: none;
}
.auth-page .ti-footer a:hover,
.auth-page .ti-back:hover { text-decoration: underline; }
.auth-page .ti-back { display: block; margin-top: 14px; text-align: center; font-size: 0.84rem; color: var(--ti-muted); font-weight: 500; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .ti-layout { grid-template-columns: 1fr; }
  .ti-showcase { display: none; }
  .ti-panel {
    background:
      radial-gradient(circle at 10% 0%, #e4dcff 0, transparent 45%),
      radial-gradient(circle at 100% 100%, #ffe1ef 0, transparent 40%),
      var(--ti-bg);
    padding: 20px 14px;
  }
  .ti-brand-mobile { display: inline-flex !important; }
}
@media (max-width: 480px) {
  .ti-card { padding: 28px 20px 22px; border-radius: 20px; }
  .ti-head h1 { font-size: 1.6rem; }
}
@media (prefers-reduced-motion: reduce) {
  .auth-page *, .auth-page *::before, .auth-page *::after { animation: none !important; transition: none !important; }
}

