/*
 * ContoAI — delade tokens, bas, knappar och inloggningsvyn (/auth).
 *
 * Design-tokens (--ca-*) delas av startsidan och inloggningsvyn så att båda
 * har samma palett, typsnitt, radier och skuggor som appen. Startsidans egna
 * komponenter ligger i landing.css. Temat är låst till ljust ("blue").
 */

:root {
  --ca-bg: #F4F6FB;
  --ca-panel: #FFFFFF;
  --ca-raise: #F0F3F9;
  --ca-rail: #101736;
  --ca-line: #D5DDEC;
  --ca-line-2: #DCE2EF;
  --ca-rail-line: rgba(255, 255, 255, .11);
  --ca-rail-raise: rgba(255, 255, 255, .045);
  --ca-rail-raise-2: rgba(255, 255, 255, .08);
  --ca-txt: #0D1330;
  --ca-txt-2: #3E4767;
  --ca-txt-3: #636C8C;
  --ca-blue: #1B3FD6;
  --ca-blue-hover: #2E52EE;
  --ca-blue-on-dark: #2E52EE;
  --ca-blue-accent: #7C93FF;
  --ca-blue-wash: rgba(27, 63, 214, .075);
  --ca-blue-wash-solid: #EEF1FC;
  --ca-ok: #06623F;
  --ca-ok-bg: #DCF3E8;
  --ca-ok-br: #ADDFC8;
  --ca-warn: #8A5200;
  --ca-warn-bg: #FDF1DF;
  --ca-warn-br: #F0DFC0;
  --ca-red: #A82D1C;
  --ca-red-bg: #FDEBE8;
  --ca-red-br: #F2C2B9;
  --ca-r-sm: 8px;
  --ca-r-card: 12px;
  --ca-r-pill: 999px;
  --ca-sh-sm: 0 1px 2px rgba(13, 19, 48, .05);
  --ca-sh: 0 1px 2px rgba(13, 19, 48, .04), 0 10px 30px rgba(13, 19, 48, .05);
  --ca-sh-lg: 0 2px 6px rgba(13, 19, 48, .06), 0 28px 70px rgba(13, 19, 48, .12);
  --ca-display: "Plus Jakarta Sans", system-ui, sans-serif;
  --ca-ui: "Inter", system-ui, sans-serif;
  --ca-mono: "IBM Plex Mono", ui-monospace, monospace;

  color-scheme: light only;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* `hidden` must win over component display rules (flex/grid). */
[hidden] {
  display: none !important;
}

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

body {
  font-family: var(--ca-ui);
  background: var(--ca-bg);
  color: var(--ca-txt);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

button {
  font: inherit;
  cursor: pointer;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.narrow {
  max-width: 840px;
}

.mono {
  font-family: var(--ca-mono);
  font-variant-numeric: tabular-nums;
}

.eyebrow {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ca-txt-2);
}

.section {
  padding: 96px 0;
}

.section-band {
  background: var(--ca-panel);
  border-top: 1px solid var(--ca-line-2);
  border-bottom: 1px solid var(--ca-line-2);
}

.section-title {
  font-family: var(--ca-display);
  font-weight: 800;
  font-size: clamp(28px, 3.4vw, 42px);
  line-height: 1.12;
  letter-spacing: -.015em;
  word-spacing: .04em;
}

.section-lead {
  margin-top: 18px;
  font-size: 18px;
  line-height: 1.65;
  color: var(--ca-txt-2);
  max-width: 640px;
}

/* ------------------------------------------------------------------- Brand */

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ca-txt);
  flex: none;
}

.logo-mark {
  display: block;
  border-radius: 50%;
}

.wordmark {
  font-family: var(--ca-display);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -.02em;
}

/* "AI" in the app's Beta-badge gradient (apps/app .ca-wordmark); solid blue without text clipping. */
.wordmark-ai {
  font-weight: 800;
  color: #5b7dff;
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .wordmark-ai {
    background: linear-gradient(115deg, #5b7dff, #a78bfa 55%, #38bdf8);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
}

/* ----------------------------------------------------------------- Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 26px;
  border: 1px solid transparent;
  border-radius: var(--ca-r-pill);
  font-family: var(--ca-ui);
  font-size: 15.5px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: transform .15s ease, background .15s ease, border-color .15s ease, color .15s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: var(--ca-blue);
  color: #fff;
  box-shadow: var(--ca-sh-sm);
}

.btn-primary:hover {
  background: var(--ca-blue-hover);
}

.btn-secondary {
  background: var(--ca-panel);
  border-color: var(--ca-line);
  color: var(--ca-txt);
}

.btn-secondary:hover {
  border-color: var(--ca-txt-3);
}

.btn-sm {
  height: 40px;
  padding: 0 18px;
  font-size: 14.5px;
}

.btn-lg {
  height: 52px;
  padding: 0 30px;
  font-size: 16px;
}

/* =========================================================================
 * Inloggning (/auth) — egen inloggningsvy.
 * ====================================================================== */

.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  background: var(--ca-bg);
}

.auth-aside {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 44px;
  background: var(--ca-rail);
  color: #fff;
}

.auth-aside::after {
  content: "";
  position: absolute;
  inset: auto -20% -30% 20%;
  height: 420px;
  background: radial-gradient(closest-side, rgba(46, 82, 238, .45), transparent);
  pointer-events: none;
}

.auth-aside .brand,
.auth-aside .brand:visited {
  position: relative;
  color: #fff;
}

.auth-aside h1 {
  position: relative;
  font-family: var(--ca-display);
  font-weight: 800;
  font-size: clamp(30px, 3.2vw, 44px);
  line-height: 1.1;
  letter-spacing: -.02em;
}

.auth-aside h1 span {
  display: block;
  font-weight: 500;
  color: rgba(255, 255, 255, .72);
}

.auth-aside .aside-lead {
  position: relative;
  margin-top: 18px;
  max-width: 420px;
  color: rgba(255, 255, 255, .72);
  font-size: 17px;
}

.aside-points {
  position: relative;
  list-style: none;
  display: grid;
  gap: 12px;
  margin-top: 30px;
}

.aside-points li {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255, 255, 255, .82);
  font-size: 14.5px;
}

.aside-points .tick {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  flex: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, .12);
  color: var(--ca-blue-accent);
  font-size: 12px;
}

.auth-aside .aside-foot {
  position: relative;
  font-size: 13px;
  color: rgba(255, 255, 255, .55);
}

.auth-main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
}

.auth-mobile-brand {
  display: none;
  align-items: center;
  gap: 10px;
  margin-bottom: 26px;
}

.auth-card h2 {
  font-family: var(--ca-display);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -.02em;
}

.auth-card .auth-sub {
  margin-top: 8px;
  color: var(--ca-txt-2);
}

.company-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 22px;
  padding: 10px 16px;
  border: 1px solid var(--ca-line);
  border-radius: var(--ca-r-card);
  background: var(--ca-raise);
}

.company-chip .avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 50%;
  background: var(--ca-blue-wash-solid);
  color: var(--ca-blue);
  font-size: 13px;
  font-weight: 700;
}

.company-chip .who {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 500;
}

.company-chip button {
  border: 0;
  background: transparent;
  color: var(--ca-blue);
  font-size: 14px;
  font-weight: 600;
}

.auth-form {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

.field label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ca-txt-2);
}

.field .input-wrap {
  position: relative;
}

.field input {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  border: 1px solid var(--ca-line);
  border-radius: var(--ca-r-card);
  background: var(--ca-panel);
  font-size: 15.5px;
  color: var(--ca-txt);
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.field input:focus {
  border-color: var(--ca-blue);
  box-shadow: 0 0 0 3px var(--ca-blue-wash);
}

.field .reveal {
  position: absolute;
  top: 0;
  right: 0;
  display: grid;
  place-items: center;
  width: 48px;
  height: 52px;
  border: 0;
  background: transparent;
  color: var(--ca-txt-3);
}

.field .hint {
  margin-top: 6px;
  font-size: 13px;
  color: var(--ca-txt-3);
}

.auth-submit {
  width: 100%;
  height: 52px;
  border: 0;
  border-radius: var(--ca-r-card);
  background: var(--ca-blue);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  box-shadow: var(--ca-sh-sm);
  transition: background .15s ease, transform .15s ease;
}

.auth-submit:hover {
  background: var(--ca-blue-hover);
  transform: translateY(-1px);
}

.auth-submit:disabled {
  opacity: .6;
  cursor: default;
  transform: none;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 4px 0;
  font-size: 12px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ca-txt-3);
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--ca-line);
}

.provider-list {
  display: grid;
  gap: 12px;
}

.provider-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  height: 52px;
  border: 1px solid var(--ca-line);
  border-radius: var(--ca-r-card);
  background: var(--ca-panel);
  color: var(--ca-txt-2);
  font-size: 15.5px;
  font-weight: 500;
  transition: background .15s ease, border-color .15s ease;
}

.provider-btn:hover {
  background: var(--ca-raise);
  border-color: var(--ca-txt-3);
}

.provider-btn svg {
  width: 20px;
  height: 20px;
}

.auth-links {
  margin-top: 22px;
  font-size: 14px;
  text-align: center;
  color: var(--ca-txt-2);
}

.auth-links a {
  color: var(--ca-blue);
  font-weight: 600;
  text-decoration: none;
}

.auth-links a:hover { color: var(--ca-blue-hover); }

.auth-note {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--ca-line-2);
  text-align: center;
  font-size: 12.5px;
  color: var(--ca-txt-3);
}

.auth-forgot {
  margin-top: -6px;
  text-align: right;
  font-size: 14px;
}

.auth-forgot a,
.auth-alt a {
  color: var(--ca-blue);
  text-decoration: none;
}

.auth-alt {
  margin-top: 18px;
  text-align: center;
  font-size: 14px;
  color: var(--ca-txt-3);
}

.auth-error {
  margin-top: 18px;
  padding: 12px 14px;
  border: 1px solid var(--ca-red-br);
  border-radius: var(--ca-r-sm);
  background: var(--ca-red-bg);
  color: var(--ca-red);
  font-size: 14px;
}

.auth-error[hidden] { display: none; }

.auth-demo {
  margin-top: 14px;
  padding: 10px 14px;
  border: 1px dashed var(--ca-line);
  border-radius: var(--ca-r-sm);
  background: var(--ca-raise);
  text-align: center;
  font-size: 13px;
  color: var(--ca-txt-3);
}

.auth-demo button {
  border: 0;
  background: transparent;
  color: var(--ca-blue);
  font-weight: 600;
}

.auth-demo[hidden] { display: none; }

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, .4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ------------------------------------------------------------- Responsive */

@media (max-width: 1020px) {
  .auth-page {
    grid-template-columns: 1fr;
  }

  .auth-aside {
    display: none;
  }

  .auth-mobile-brand {
    display: flex;
  }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
