/* The Scalene Corporation — landing + client portal
   Dark, minimal, intentionally understated. */

:root {
  --bg:          #0a0b0d;
  --bg-2:        #0e1013;
  --surface:     #15171c;
  --surface-2:   #1b1e24;

  --line:        rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);

  --text:        #ececee;
  --muted:       #9a9ca3;
  --muted-2:     #6c6e75;

  --accent:      #c9b48f;            /* restrained champagne hairline */
  --accent-soft: rgba(201, 180, 143, 0.14);
  --error:       #e08a84;

  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);

  color-scheme: dark;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Depth: a soft glow behind the lockup + a faint film grain. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(60% 45% at 50% 32%, rgba(201, 180, 143, 0.06), transparent 70%),
    radial-gradient(90% 70% at 50% 120%, rgba(60, 72, 96, 0.14), transparent 70%),
    linear-gradient(180deg, var(--bg-2), var(--bg) 60%);
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Header ---------- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px clamp(18px, 5vw, 52px);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}
.brand__mark { width: 18px; height: 18px; color: var(--accent); }
.brand__name {
  font-family: "Marcellus", Georgia, serif;
  font-weight: 400;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}
.nav-login {
  appearance: none;
  background: none;
  border: none;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 8px 2px;
  transition: color 0.3s var(--ease);
}
.nav-login:hover { color: var(--text); }

/* ---------- Hero ---------- */
.hero {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px 72px;
}
.hero__inner {
  text-align: center;
  max-width: 600px;
  animation: rise 1s var(--ease) both;
}

.lockup {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.lockup__mark {
  width: 34px;
  height: 34px;
  color: var(--accent);
  margin-bottom: 26px;
  opacity: 0.95;
}
.lockup__the {
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-left: 0.42em; /* optical offset for tracking */
}
.lockup__name {
  font-family: "Marcellus", Georgia, serif;
  font-weight: 400;
  font-size: clamp(2.8rem, 11vw, 5.2rem);
  line-height: 1.04;
  letter-spacing: 0.01em;
  margin: 4px 0 8px;
}
.lockup__corp {
  font-size: clamp(0.74rem, 2.3vw, 0.9rem);
  font-weight: 400;
  letter-spacing: 0.5em;
  text-transform: uppercase;
  color: var(--muted);
  margin-left: 0.5em;
}

.rule {
  width: 46px;
  height: 1px;
  margin: 34px auto 26px;
  background: linear-gradient(90deg, transparent, var(--line-strong), transparent);
}

.hero__cta { margin-top: 2px; }

/* ---------- Footer ---------- */
.site-footer {
  padding: 15px clamp(18px, 5vw, 52px);
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted-2);
}

/* ---------- Buttons ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 2px;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease), color 0.3s var(--ease), transform 0.1s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn__icon { width: 14px; height: 14px; color: var(--accent); }

.btn--outline {
  padding: 13px 26px;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line-strong);
}
.btn--outline:hover { border-color: var(--accent); background: var(--accent-soft); }

.btn--primary {
  padding: 12px 20px;
  background: var(--text);
  color: #0a0b0d;
  border: 1px solid var(--text);
}
.btn--primary:hover { background: #fff; border-color: #fff; }
.btn--primary:disabled { cursor: default; opacity: 0.8; }
.btn--full { width: 100%; }

/* Loading spinner inside primary button */
.btn__spinner {
  position: absolute;
  width: 15px;
  height: 15px;
  border: 2px solid rgba(10, 11, 13, 0.25);
  border-top-color: #0a0b0d;
  border-radius: 50%;
  opacity: 0;
}
.btn.is-loading .btn__label { opacity: 0; }
.btn.is-loading .btn__spinner { opacity: 1; animation: spin 0.7s linear infinite; }

/* ---------- Modal ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal[hidden] { display: none; }

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 6, 8, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.22s var(--ease);
}
.modal.is-open .modal__backdrop { opacity: 1; }

.modal__dialog {
  position: relative;
  width: 100%;
  max-width: 320px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 28px 26px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.8);
  text-align: center;
  opacity: 0;
  transform: translateY(8px) scale(0.985);
  transition: opacity 0.22s var(--ease), transform 0.28s var(--ease);
}
.modal.is-open .modal__dialog { opacity: 1; transform: none; }

.modal__close {
  position: absolute;
  top: 13px;
  right: 13px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  background: none;
  border: none;
  color: var(--muted-2);
  cursor: pointer;
  border-radius: 4px;
  transition: color 0.3s var(--ease), background 0.3s var(--ease);
}
.modal__close svg { width: 16px; height: 16px; }
.modal__close:hover { color: var(--text); background: var(--surface-2); }

.modal__mark { width: 24px; height: 24px; color: var(--accent); }
#modal-title {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 1.14rem;
  letter-spacing: 0.01em;
  margin: 10px 0 22px;
}

/* ---------- Form ---------- */
#login-form { text-align: left; }
.field { margin-bottom: 13px; }
.field__labelrow { display: flex; align-items: baseline; justify-content: space-between; }
.field label {
  display: block;
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.field input[type="email"],
.field input[type="password"],
.field input[type="text"] {
  width: 100%;
  padding: 10px 11px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--text);
  font-family: var(--sans);
  font-size: 0.84rem;
  letter-spacing: 0.01em;
  transition: border-color 0.25s var(--ease), background 0.25s var(--ease);
}
.field input::placeholder { color: var(--muted-2); }
.field input:focus {
  outline: none;
  border-color: var(--accent);
  background: #0c0e12;
}
.field input:disabled { opacity: 0.55; }

.field--row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
  margin-bottom: 8px;
}
.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.7rem;
  color: var(--muted);
  cursor: pointer;
  text-transform: none;
  letter-spacing: 0.01em;
  margin: 0;
}
.checkbox input {
  width: 13px;
  height: 13px;
  accent-color: var(--accent);
  cursor: pointer;
}

.link-sm {
  background: none;
  border: none;
  padding: 0;
  font-family: var(--sans);
  font-size: 0.7rem;
  color: var(--muted);
  cursor: pointer;
  text-decoration: none;
  letter-spacing: 0.01em;
  text-transform: none;
  transition: color 0.3s var(--ease);
}
.link-sm:hover { color: var(--text); }

.form-error {
  min-height: 1.1em;
  margin: 2px 0 12px;
  font-size: 0.72rem;
  line-height: 1.35;
  color: var(--error);
  opacity: 0;
  transition: opacity 0.2s var(--ease);
}
.form-error.is-visible { opacity: 1; }

/* ---------- Motion ---------- */
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-4px); }
  40%, 60% { transform: translateX(4px); }
}
#login-form.shake { animation: shake 0.42s var(--ease); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

@media (max-width: 480px) {
  .modal__dialog { padding: 26px 20px 22px; }
}
