/* The front door: log in, sign up, confirm email.

   A split. The form on paper at the left; at the right, a 440px accent field
   with the product's flow — Quotation, Invoice, Receipt — stacked down it. The
   accent field is allowed here and nowhere else in the app: this screen is
   seen once a session and can afford to be loud. The dashboard can't.

   On a phone the field becomes a 210px band across the top with the flow on
   one line, and the primary pill sits at the foot of the screen rather than
   under the fields, where a thumb already is.

   Shared by login.html, signup.html and verify.html so the three can't drift. */

@import url('/fonts/fonts.css');

:root {
  --paper: #fff;
  --ink: #000;
  --ink-5: rgba(0, 0, 0, 0.05);
  --ink-35: rgba(0, 0, 0, 0.35);
  --border-strong: rgba(0, 0, 0, 0.2);
  --text-primary: #000;
  --text-secondary: rgba(0, 0, 0, 0.65);
  --text-tertiary: rgba(0, 0, 0, 0.45);
  --accent: #c25405;
  --accent-deep: #8f3d04;
  --danger-text: #a0122b;
  --danger-bg: rgba(160, 18, 43, 0.05);
  --danger-border: rgba(160, 18, 43, 0.24);
  --danger-field-border: rgba(160, 18, 43, 0.45);
  --font-display: 'Newsreader', Georgia, 'Times New Roman', serif;
  --font-sans: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --radius-md: 8px;
  --radius-full: 9999px;
  --ease-out-soft: cubic-bezier(0.2, 0.7, 0.2, 1);
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: var(--font-sans);
  background: var(--paper);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
}

.auth {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 440px;
  min-height: 100vh;
  min-height: 100svh;
}

/* ---------- The form side ---------- */

.auth-main {
  display: flex;
  flex-direction: column;
  padding: 44px clamp(28px, 6vw, 64px) 40px;
}

.auth-lockup {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: inherit;
  text-decoration: none;
  align-self: flex-start;
}

.auth-lockup img {
  width: 26px;
  height: 26px;
  display: block;
}

.auth-word {
  font: 500 23px/1 var(--font-display);
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.auth-suffix {
  font: 600 10.5px/1 var(--font-sans);
  letter-spacing: 0.02em;
  color: var(--text-tertiary);
}

.auth-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  max-width: 380px;
  padding: 48px 0 24px;
}

.auth-body h1 {
  margin: 0;
  font: 500 56px/1 var(--font-display);
  letter-spacing: -0.03em;
  text-wrap: balance;
}

/* One line under the big thing, not a label over it. */
.auth-caption {
  margin: 16px 0 0;
  font: 600 11px/1.5 var(--font-sans);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.auth-form {
  display: flex;
  flex-direction: column;
  margin-top: 36px;
}

.error {
  display: none;
  margin: 24px 0 0;
  padding: 11px 14px;
  border: 1px solid var(--danger-border);
  border-radius: var(--radius-md);
  background: var(--danger-bg);
  color: var(--danger-text);
  font: 400 13px/1.45 var(--font-sans);
  animation: errorIn 200ms var(--ease-out-soft);
}

@keyframes errorIn {
  from {
    opacity: 0;
  }
}

/* ---------- Fields: text on an underline ---------- */

.field {
  margin-bottom: 26px;
}

.field-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

label {
  display: block;
  margin-bottom: 4px;
  font: 600 10.5px var(--font-sans);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

input {
  --field-rest: var(--border-strong);
  --field-line: var(--accent);
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 12px 0 11px;
  border: none;
  border-radius: 0;
  outline: none;
  font: 400 16px/1.3 var(--font-sans);
  color: var(--text-primary);
  background-color: transparent;
  background-image: linear-gradient(var(--field-line), var(--field-line)),
    linear-gradient(var(--field-rest), var(--field-rest));
  background-repeat: no-repeat;
  background-position: left bottom, left bottom;
  background-size: 0% 1.5px, 100% 1px;
  transition: background-size 250ms var(--ease-out-soft);
}

input::placeholder {
  color: var(--ink-35);
}

/* The accent line draws from left to right. */
input:focus {
  background-size: 100% 1.5px, 100% 1px;
}

input:user-invalid {
  --field-rest: var(--danger-field-border);
  --field-line: var(--danger-field-border);
  background-size: 100% 1.5px, 100% 1px;
}

@media (forced-colors: active) {
  input {
    border-bottom: 1px solid CanvasText;
  }
}

.hint {
  margin: 8px 0 0;
  font: 400 12px/1.5 var(--font-sans);
  color: var(--text-tertiary);
}

/* ---------- Actions ---------- */

.auth-submit,
.cta {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 54px;
  margin-top: 14px;
  border: 1px solid var(--accent);
  border-radius: var(--radius-full);
  background: var(--accent);
  color: var(--paper);
  font: 600 15px var(--font-sans);
  text-decoration: none;
  cursor: pointer;
  transition: transform 200ms var(--ease-out-soft), background-color 200ms var(--ease-out-soft),
    border-color 200ms var(--ease-out-soft), box-shadow 200ms var(--ease-out-soft);
}

.auth-submit:hover,
.cta:hover {
  background: var(--accent-deep);
  border-color: var(--accent-deep);
  transform: translateY(-2px);
  box-shadow: 0 10px 22px -12px rgba(194, 84, 5, 0.7);
}

.auth-submit:active,
.cta:active {
  transform: translateY(1px) scale(0.98);
  box-shadow: none;
}

.auth-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* verify.html's CTA only appears once there is somewhere to go. */
.cta {
  display: none;
  margin-top: 36px;
}

.cta.is-on {
  display: flex;
}

.auth-foot {
  margin: 20px 0 0;
  text-align: center;
  font: 400 13px/1.5 var(--font-sans);
  color: var(--text-secondary);
}

.auth-foot:empty {
  display: none;
}

.auth-foot a {
  color: var(--accent-deep);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: transparent;
  transition: color 150ms var(--ease-out-soft), text-decoration-color 150ms var(--ease-out-soft);
}

.auth-foot a:hover {
  color: var(--accent);
  text-decoration-color: currentColor;
}

/* ---------- The accent field ---------- */

.auth-field {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: var(--paper);
}

/* The paper mark at 8%, cropped past the edge so only strokes show. */
.auth-field-mark {
  position: absolute;
  top: -18%;
  left: -34%;
  height: 128%;
  opacity: 0.08;
  pointer-events: none;
  user-select: none;
}

.auth-field-lockup {
  display: none;
}

.auth-flow {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.auth-flow-word {
  font: 400 54px/1 var(--font-display);
  letter-spacing: -0.02em;
  white-space: nowrap;
}

/* Drawn, not a glyph: a → takes whatever weight the font ships. Drawn
   horizontally and turned down on the stacked layout. */
.auth-flow-arrow {
  width: 30px;
  height: 14px;
  transform: rotate(90deg);
  overflow: visible;
  stroke: rgba(255, 255, 255, 0.75);
}

/* ---------- Phone ---------- */

@media (max-width: 767px) {
  .auth {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 210px 1fr;
  }

  .auth-field {
    grid-row: 1;
    align-items: flex-end;
    justify-content: center;
    padding: 0 20px 38px;
  }

  .auth-field-mark {
    top: -60%;
    left: 34%;
    height: 230%;
  }

  .auth-field-lockup {
    display: inline-flex;
    position: absolute;
    top: 26px;
    left: 24px;
    color: var(--paper);
  }

  .auth-field-lockup .auth-suffix {
    color: rgba(255, 255, 255, 0.65);
  }

  .auth-flow {
    flex-direction: row;
    gap: 8px;
  }

  .auth-flow-word {
    font-size: clamp(20px, 6.6vw, 26px);
  }

  .auth-flow-arrow {
    width: 14px;
    height: 8px;
    transform: none;
  }

  .auth-main {
    grid-row: 2;
    padding: 36px 24px calc(24px + env(safe-area-inset-bottom));
  }

  /* The accent lockup is in the band on a phone. */
  .auth-main > .auth-lockup {
    display: none;
  }

  .auth-body {
    max-width: none;
    justify-content: flex-start;
    padding: 0;
  }

  .auth-body h1 {
    font-size: clamp(36px, 11vw, 44px);
  }

  .auth-form {
    flex: 1;
  }

  /* The pill goes to the foot of the screen, where a thumb already is. */
  .auth-submit {
    margin-top: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-property: color, background-color, border-color, text-decoration-color, opacity !important;
    animation: none !important;
  }

  .auth-submit:hover,
  .auth-submit:active,
  .cta:hover,
  .cta:active {
    transform: none;
  }

  input {
    transition: none;
  }
}
