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

:root {
  --ink: #14161a;
  --ink-2: #565b63;
  --ink-3: #898e97;
  --paper: #ffffff;
  --paper-2: #f6f5f1;
  --paper-3: #efede7;
  --line: #e6e3dc;
  --line-2: #d7d3ca;
  --accent: #1f5bff;
  --accent-ink: #1742c8;
  --accent-tint: #ecf0ff;
  --danger: #b3261e;
  --success: #147a41;
  --success-bg: #eefaf2;
  --radius: 12px;
  --radius-lg: 24px;
  --display: 'Schibsted Grotesk', system-ui, sans-serif;
  --text: 'Hanken Grotesk', system-ui, sans-serif;
}

html, body { min-height: 100%; }

body {
  margin: 0;
  font-family: var(--text);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(460px, 1fr);
  background: var(--paper);
}

.auth__form-col {
  grid-column: 2;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 28px 40px 40px;
}

.auth__topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.auth__back,
.auth__switch {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-2);
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.3;
}

.auth__back:hover,
.auth__switch a:hover {
  color: var(--ink);
}

.auth__switch {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.alink {
  color: var(--accent);
  font-weight: 700;
}

.alink:hover {
  text-decoration: underline;
}

.auth__form-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 36px 0;
}

.auth__card {
  width: 100%;
  max-width: 430px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.auth__card--wide {
  max-width: 540px;
}

.auth__head {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.auth__title {
  margin: 0;
  font-family: var(--display);
  font-size: 32px;
  font-weight: 700;
  line-height: 1.08;
}

.auth__sub {
  margin: 0;
  color: var(--ink-2);
  font-size: 16px;
  line-height: 1.5;
}

.auth__sub a {
  color: var(--accent);
  font-weight: 700;
}

.auth__form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.auth__or {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--ink-3);
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
}

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

.auth__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.auth__legal {
  margin: 0;
  color: var(--ink-3);
  font-size: 12.5px;
  line-height: 1.5;
  text-align: center;
}

.auth__legal a {
  color: var(--ink-2);
  text-decoration: underline;
}

.brandp {
  grid-column: 1;
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 28px;
  padding: 44px 48px;
  color: #fff;
  background:
    radial-gradient(700px 420px at 110% -10%, rgba(255,255,255,.20), transparent 60%),
    radial-gradient(620px 520px at -10% 115%, rgba(0,0,0,.16), transparent 55%),
    linear-gradient(160deg, var(--accent) 0%, var(--accent-ink) 100%);
}

.brandp__top {
  display: flex;
  flex-direction: column;
  gap: 30px;
  max-width: 480px;
}

.brandp__quote {
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 440px;
}

.brandp__headline {
  margin: 0;
  font-family: var(--display);
  font-size: 34px;
  font-weight: 700;
  line-height: 1.1;
}

.brandp__checks {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.brandp__check {
  display: flex;
  align-items: center;
  gap: 11px;
  color: rgba(255,255,255,.92);
  font-size: 16px;
  font-weight: 500;
}

.brandp__check-icon {
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(255,255,255,.18);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--display);
  font-size: 21px;
  font-weight: 700;
  line-height: 1;
}

.logo svg {
  flex: 0 0 auto;
}

.logo__accent {
  color: var(--accent);
}

.logo--light .logo__accent {
  color: #b9ccff;
}

.badge,
.firma-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: max-content;
  padding: 6px 13px;
  border-radius: 999px;
  background: var(--accent-tint);
  color: var(--accent-ink);
  font-size: 13px;
  font-weight: 700;
}

.trial-badge {
  margin-bottom: 4px;
}

.gbtn,
.btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  border-radius: 12px;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease, transform .12s ease;
}

.gbtn {
  padding: 13px 18px;
  border: 1.5px solid var(--line-2);
  background: #fff;
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
}

.gbtn:hover:not(:disabled) {
  background: var(--paper-2);
  border-color: var(--ink-3);
}

.btn {
  border: 1.5px solid transparent;
  padding: 16px 30px;
  font-size: 17px;
  font-weight: 700;
}

.btn--primary,
.btn {
  background: var(--accent);
  color: #fff;
}

.btn:hover:not(:disabled) {
  background: var(--accent-ink);
}

.btn:active:not(:disabled),
.gbtn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn:disabled,
.gbtn:disabled {
  cursor: not-allowed;
  opacity: .62;
}

.afield {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.afield__label {
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}

.afield__wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.afield__input {
  width: 100%;
  padding: 13px 15px;
  border: 1.5px solid var(--line-2);
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
  font-size: 16px;
  transition: border-color .15s ease, background .15s ease;
}

.afield__input.has-icon {
  padding-left: 44px;
}

.afield__input::placeholder {
  color: var(--ink-3);
}

.afield__input:hover {
  border-color: var(--ink-3);
}

.afield__input:focus {
  border-color: var(--accent);
  outline: none;
}

.afield__input.error {
  border-color: var(--danger);
  background: rgba(179, 38, 30, .035);
}

.afield__input.valid {
  border-color: var(--success);
  background: rgba(20, 122, 65, .035);
}

.afield__input[readonly] {
  background: var(--paper-2);
  color: var(--ink-2);
  cursor: not-allowed;
}

.afield__lead {
  position: absolute;
  left: 14px;
  display: flex;
  align-items: center;
  color: var(--ink-3);
  pointer-events: none;
}

.afield__hint,
.hint {
  min-height: 18px;
  color: var(--ink-3);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
}

.hint.error-hint {
  color: var(--danger);
}

.hint.success-hint {
  color: var(--success);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.subdomain-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.subdomain-suffix {
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.section-label {
  margin: 6px 0 -4px;
  padding-top: 16px;
  border-top: 1.5px solid var(--line);
  color: var(--ink-3);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.pw-group {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.pw-group.hidden {
  display: none;
}

.pw-rules {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 12px;
  margin: -8px 0 0;
  padding: 0;
  list-style: none;
}

.pw-rules li {
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 700;
}

.pw-rules li::before {
  content: "x";
  display: inline-block;
  width: 14px;
  margin-right: 6px;
  color: var(--danger);
}

.pw-rules li.ok {
  color: var(--success);
}

.pw-rules li.ok::before {
  content: "✓";
  color: var(--success);
}

.acheck {
  display: inline-flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.acheck input {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
}

.acheck__box {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  margin-top: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--line-2);
  border-radius: 6px;
  background: #fff;
  color: #fff;
  transition: background .15s ease, border-color .15s ease;
}

.acheck input:checked + .acheck__box {
  background: var(--accent);
  border-color: var(--accent);
}

.acheck__box svg {
  opacity: 0;
}

.acheck input:checked + .acheck__box svg {
  opacity: 1;
}

.acheck__txt {
  color: var(--ink-2);
  font-size: 14.5px;
  line-height: 1.4;
}

.acheck__txt a {
  color: var(--accent);
  font-weight: 700;
}

.tos-block {
  display: grid;
  gap: 12px;
}

.tos-block .acheck {
  padding: 13px 14px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: var(--paper-2);
}

.google-connected {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(20, 122, 65, .16);
  border-radius: var(--radius);
  background: var(--success-bg);
  color: var(--success);
  font-size: 13px;
  font-weight: 800;
}

.google-connected.visible {
  display: flex;
}

.error-msg {
  display: none;
  padding: 12px 14px;
  border: 1px solid rgba(179, 38, 30, .16);
  border-radius: var(--radius);
  background: rgba(179, 38, 30, .08);
  color: var(--danger);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
}

.error-msg.visible {
  display: block;
}

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-right: 6px;
  border: 2px solid rgba(255,255,255,.32);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  vertical-align: middle;
}

.spinner-dark {
  border-color: rgba(20,22,26,.18);
  border-top-color: var(--ink);
}

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

@media (max-width: 1100px) {
  .brandp {
    padding: 36px;
  }
}

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

  .auth__form-col {
    grid-column: 1;
    min-height: 100vh;
  }

  .brandp {
    display: none;
  }
}

@media (max-width: 620px) {
  .auth__form-col {
    padding: 22px 22px 32px;
  }

  .auth__topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .auth__switch {
    justify-content: flex-start;
  }

  .auth__title {
    font-size: 28px;
  }

  .form-grid,
  .subdomain-row,
  .pw-rules {
    grid-template-columns: 1fr;
  }

  .subdomain-suffix {
    white-space: normal;
  }
}
