/* Sign-in pages (login.html, magic-login.html) — split hero + form layout
   matching www.calloncloud.io/login. Standalone: does not depend on login.css. */

:root {
  --auth-text: #000000;
  --auth-text-muted: rgba(0, 0, 0, .7);
  --auth-placeholder: rgba(0, 0, 0, .3);
  --auth-panel-bg: #f0eeee;
  --auth-field-bg: #ffffff;
  --auth-border: #d5d5d5;
  --auth-border-hover: #c9c9c9;
  --auth-accent: #000000;
  --auth-accent-hover: #202020;
  --auth-ring: rgba(0, 0, 0, .1);
  --auth-danger: #c62828;
  --auth-danger-bg: #fdecec;
  --auth-radius: 12px;
  --auth-control-h: 52px;
  --auth-transition: .18s cubic-bezier(.4, 0, .2, 1);
}

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

body {
  margin: 0;
  background: var(--auth-panel-bg);
  color: var(--auth-text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* ── Shell ───────────────────────────────────────────────── */
.auth-shell {
  display: grid;
  grid-template-columns: 1fr;
  min-height: 100vh;
  min-height: 100dvh;
}

/* ── Hero (left half, desktop only) ─────────────────────── */
.auth-hero {
  position: relative;
  display: none;
  min-width: 0;
  overflow: hidden;
  background: linear-gradient(to right, #f0f1f4, #d9dbe1);
}
.auth-hero-image {
  position: absolute;
  inset: -22% 0 0 0;
  width: 100%;
  height: 122%;
  object-fit: cover;
  object-position: top;
}
.auth-hero-logo {
  position: absolute;
  left: 5%;
  top: 4.3%;
  border-radius: 2px;
}
.auth-logo {
  display: block;
  width: 135px;
  height: auto;
  aspect-ratio: 1286 / 500;
}
.auth-partners {
  position: absolute;
  inset: auto 0 0 0;
  padding: 40px 32px 4.3%;
  background: linear-gradient(to top, #ffffff, rgba(255, 255, 255, .9) 50%, transparent);
}
.auth-partners-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 80%;
  max-width: 900px;
  margin: 0 auto;
}
.auth-partners-row img {
  display: block;
  min-width: 0;
  width: clamp(48px, 4.65vw, 110px);
  height: clamp(18px, 1.55vw, 36px);
  object-fit: contain;
}

/* ── Form panel (right half) ────────────────────────────── */
.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 56px 24px;
  background: var(--auth-panel-bg);
}
.auth-panel-inner {
  width: 100%;
  max-width: 450px;
}
.auth-mobile-logo {
  display: inline-block;
  margin-bottom: 40px;
  border-radius: 2px;
}

.auth-title {
  margin: 0;
  font-size: 31px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--auth-text);
}
.auth-subtitle {
  margin: 8px 0 0;
  font-size: 16px;
  line-height: 1.6;
  color: var(--auth-text-muted);
}
.auth-subtitle strong {
  color: var(--auth-text);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.auth-form { margin-top: 36px; }

.auth-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.auth-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--auth-text);
}
.auth-label-meta {
  font-weight: 400;
  color: var(--auth-text-muted);
}
.auth-link {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--auth-text);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  transition: opacity var(--auth-transition);
}
.auth-link:hover { opacity: .7; }
.auth-link:focus-visible {
  outline: 2px solid var(--auth-accent);
  outline-offset: 3px;
  border-radius: 2px;
}
.auth-link:disabled,
.auth-link.resend-disabled {
  opacity: .4;
  text-decoration: none;
  cursor: default;
  pointer-events: none;
}

.auth-input {
  display: block;
  width: 100%;
  height: var(--auth-control-h);
  margin-top: 12px;
  padding: 0 20px;
  border: 1px solid var(--auth-border);
  border-radius: var(--auth-radius);
  background: var(--auth-field-bg);
  font: inherit;
  font-size: 16px;
  color: var(--auth-text);
  outline: none;
  transition: border-color var(--auth-transition), box-shadow var(--auth-transition);
}
.auth-input::placeholder { color: var(--auth-placeholder); }
.auth-input:hover { border-color: var(--auth-border-hover); }
.auth-input:focus {
  border-color: var(--auth-accent);
  box-shadow: 0 0 0 4px var(--auth-ring);
}
.auth-input[readonly] {
  background: transparent;
  color: var(--auth-text-muted);
}
.auth-input[readonly]:hover { border-color: var(--auth-border); }
.auth-input.is-invalid,
.otp-input.is-invalid {
  border-color: var(--auth-danger);
}
.auth-input.is-invalid:focus,
.otp-input.is-invalid:focus {
  box-shadow: 0 0 0 4px rgba(198, 40, 40, .12);
}

.auth-field-error {
  display: none;
  margin-top: 8px;
  font-size: 14px;
  color: var(--auth-danger);
}
.auth-field-error.is-visible { display: block; }

/* ── OTP ─────────────────────────────────────────────────── */
.auth-otp { margin-top: 28px; }
.auth-otp-row {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}
.otp-input {
  width: 100%;
  min-width: 0;
  height: var(--auth-control-h);
  padding: 0;
  border: 1px solid var(--auth-border);
  border-radius: var(--auth-radius);
  background: var(--auth-field-bg);
  font: inherit;
  font-size: 22px;
  font-weight: 600;
  text-align: center;
  color: var(--auth-text);
  outline: none;
  transition: border-color var(--auth-transition), box-shadow var(--auth-transition);
}
.otp-input:hover { border-color: var(--auth-border-hover); }
.otp-input:focus {
  border-color: var(--auth-accent);
  box-shadow: 0 0 0 4px var(--auth-ring);
}

/* ── Button ──────────────────────────────────────────────── */
.auth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: var(--auth-control-h);
  margin-top: 24px;
  padding: 0 24px;
  border: 0;
  border-radius: var(--auth-radius);
  background: var(--auth-accent);
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .2s ease, opacity .2s ease;
}
.auth-btn:hover { background: var(--auth-accent-hover); color: #ffffff; }
.auth-btn:active { background: var(--auth-accent); }
.auth-btn:focus-visible {
  outline: 2px solid var(--auth-accent);
  outline-offset: 4px;
}
.auth-btn:disabled {
  opacity: .35;
  cursor: not-allowed;
}
.auth-spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: authSpin .7s linear infinite;
}
@keyframes authSpin { to { transform: rotate(360deg); } }

/* ── Notices ─────────────────────────────────────────────── */
.auth-notice {
  margin-top: 24px;
  padding: 12px 16px;
  border-radius: var(--auth-radius);
  background: var(--auth-danger-bg);
  font-size: 14px;
  line-height: 1.5;
  color: var(--auth-danger);
}
.auth-help {
  margin: 20px 0 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--auth-text-muted);
}

.is-hidden { display: none !important; }

/* ── Animations ──────────────────────────────────────────── */
.fade-in-up { animation: authFadeInUp .22s ease; }
@keyframes authFadeInUp {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .fade-in-up { animation: none; }
}

/* ── Breakpoints ─────────────────────────────────────────── */
@media (min-width: 576px) {
  .auth-panel { padding: 56px 40px; }
  .auth-logo { width: 145px; }
  .auth-title { font-size: 36px; }
}

@media (min-width: 992px) {
  :root {
    --auth-radius: 16px;
    --auth-control-h: 60px;
  }
  .auth-shell { grid-template-columns: 1fr 1fr; }
  /* Pin the hero to the viewport: when the form grows taller than the
     screen (OTP step), only the form column scrolls — the hero must not
     stretch with the grid row and push the image / partner strip down. */
  .auth-hero {
    display: block;
    position: sticky;
    top: 0;
    align-self: start;
    height: 100vh;
    height: 100dvh;
  }
  .auth-logo { width: clamp(145px, 9vw, 190px); }
  .auth-mobile-logo { display: none; }
  .auth-panel { padding: 64px 40px; }
  .auth-title { font-size: 40px; }
  .auth-subtitle { font-size: 18px; }
  .auth-form { margin-top: 56px; }
  .auth-label { font-size: 18px; }
  .auth-input { margin-top: 16px; font-size: 18px; }
  .auth-otp-row { margin-top: 16px; gap: 10px; }
  .auth-btn { margin-top: 36px; font-size: 18px; }
}
