/* ============================================================
   Marketplace registration page styles.
   Self-contained: Avaloq Mosaic design tokens + the few component
   styles this page needs (form, inputs, button, alert). No Bootstrap,
   no external CSS, no /vendor. Fonts are self-hosted under /fonts so
   the strict same-origin CSP is unaffected.
   Tokens derived from the Avaloq Mosaic design system.
   ============================================================ */

/* --- Brand webfont (Hanken Grotesk, self-hosted, latin) --------------------
   The Mosaic system's open-license fallback typeface. Regular weight only;
   the brand avoids bold, so 300-600 maps to this single face. */
@font-face {
  font-family: 'Hanken Grotesk';
  src: url('/fonts/HankenGrotesk-latin.woff2') format('woff2');
  font-weight: 300 600;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Core palette */
  --avaloq-blue: #004893;
  --white: #ffffff;
  --black: #000000;

  /* Neutrals */
  --charcoal: #333333;
  --mid-grey: #858585;
  --grey: #adadad;
  --light-grey: #d6d6d6;
  --lighter-grey: #ebebeb;
  --off-white: #f6f6f6;

  /* Error (brand red is reserved for errors) */
  --red: #da291c;
  --red-50: #ec948d;

  /* Semantic aliases */
  --text-primary: var(--black);
  --text-secondary: var(--mid-grey);
  --text-error: var(--red);
  --surface-page: var(--off-white);
  --surface-card: var(--white);
  --border-default: var(--light-grey);
  --action-primary: var(--avaloq-blue);
  --action-primary-hover: #182e4a; /* --dark-blue */
  --action-primary-text: var(--white);
  --focus-ring: #0084d5; /* --blue */

  /* Typography */
  --font-sans: 'Hanken Grotesk', 'Neue Haas Unica', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --weight-regular: 400;
  --weight-medium: 500;
  --leading-body: 1.55;
  --leading-heading: 1.15;
  --tracking-heading: -0.01em;

  /* Spacing (4px rhythm) */
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;

  /* Radius / elevation / motion */
  --radius-sm: 6px;
  --radius-md: 10px;
  --shadow-sm: 0 1px 3px rgba(24, 46, 74, 0.08), 0 1px 2px rgba(24, 46, 74, 0.04);
  --shadow-md: 0 4px 12px rgba(24, 46, 74, 0.08), 0 1px 3px rgba(24, 46, 74, 0.05);
  --shadow-focus: 0 0 0 3px rgba(0, 132, 213, 0.35);
  --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
  --dur: 200ms;
}

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

html, body { height: 100%; }

body {
  margin: 0;
  display: flex;
  align-items: center;
  padding: var(--space-10) var(--space-4);
  font-family: var(--font-sans);
  font-weight: var(--weight-regular);
  font-size: 1rem;
  line-height: var(--leading-body);
  color: var(--text-primary);
  background: var(--surface-page);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 {
  margin: 0;
  font-weight: var(--weight-regular);
  line-height: var(--leading-heading);
  letter-spacing: var(--tracking-heading);
}

p { margin: 0; }
strong { font-weight: var(--weight-medium); }

.text-center { text-align: center; }

/* ============================================================
   Layout: centered card
   ============================================================ */
.container {
  width: 100%;
  max-width: 400px;
  margin: auto;
}

.form-signin,
#no-token {
  width: 100%;
  padding: var(--space-8);
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  text-align: center;
}

.form-signin img,
#no-token img { margin-bottom: var(--space-4); }

.form-signin h1,
#no-token h1 {
  margin-bottom: var(--space-6);
  font-size: 1.5rem;
}

#no-token p { color: var(--text-secondary); }

/* ============================================================
   Inputs
   ============================================================ */
.form-control {
  display: block;
  width: 100%;
  height: auto;
  padding: var(--space-3) var(--space-4);
  margin-top: var(--space-2);
  font-family: inherit;
  font-size: 1rem;
  line-height: var(--leading-body);
  color: var(--text-primary);
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  transition: border-color var(--dur) var(--ease-standard),
              box-shadow var(--dur) var(--ease-standard);
}

.form-control::placeholder { color: var(--text-secondary); }

.form-control:focus {
  outline: none;
  border-color: var(--focus-ring);
  box-shadow: var(--shadow-focus);
}

/* ============================================================
   Button
   ============================================================ */
.btn {
  display: inline-block;
  width: 100%;
  padding: var(--space-3) var(--space-5);
  margin-top: var(--space-5);
  font-family: inherit;
  font-size: 1.0625rem;
  font-weight: var(--weight-medium);
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  transition: background-color var(--dur) var(--ease-standard);
}

.btn-primary {
  color: var(--action-primary-text);
  background: var(--action-primary);
}

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

.btn:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
}

/* ============================================================
   Alerts
   ============================================================ */
.alert {
  position: relative;
  padding: var(--space-4) var(--space-10) var(--space-4) var(--space-4);
  margin-bottom: var(--space-6);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  text-align: center;
}

.alert-danger {
  color: var(--red);
  background: #fdecea;
  border-color: var(--red-50);
}

.alert-primary {
  color: var(--avaloq-blue);
  background: #e7eff7;
  border-color: #80a3c9;
}

.alert .close {
  position: absolute;
  top: 50%;
  right: var(--space-4);
  transform: translateY(-50%);
  padding: 0;
  font-size: 1.5rem;
  line-height: 1;
  color: inherit;
  background: transparent;
  border: 0;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity var(--dur) var(--ease-standard);
}

.alert .close:hover { opacity: 1; }

/* ============================================================
   Accessibility helper (visually-hidden labels)
   ============================================================ */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}