/* CLINQ IAM — auth page styles
   Colours and layout mirror the TCP portal login page. */

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

:root {
  --primary:        hsl(197 71% 40%);   /* same teal as nuvita-ui --primary */
  --primary-fg:     #ffffff;
  --primary-dim:    rgba(255,255,255,0.15);
  --primary-faint:  rgba(255,255,255,0.05);
  --fg:             #1B1B1F;
  --muted-fg:       #64748b;
  --border:         hsl(220 13% 82%);
  --input-bg:       #ffffff;
  --card-bg:        #ffffff;
  --destructive:    #ef4444;
  --destructive-bg: rgba(239,68,68,0.08);
  --ring:           hsl(197 71% 40%);
  --radius:         6px;
  --font: "Archivo", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

html, body { height: 100%; }
body { font-family: var(--font); font-size: 14px; color: var(--fg); background: var(--card-bg); }

/* ── Layout ──────────────────────────────────────────────────────────────── */
.auth-shell { display: flex; min-height: 100vh; }

/* Left — branding panel */
.auth-brand {
  display: none;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  padding: 3rem;
  position: relative;
  overflow: hidden;
}
@media (min-width: 1024px) { .auth-brand { display: flex; } }

/* Decorative circles — white/5 like TCP */
.auth-brand-circle {
  position: absolute;
  border-radius: 50%;
  background: var(--primary-faint);
}
.auth-brand-circle-1 { width: 420px; height: 420px; top: -130px; right: -130px; }
.auth-brand-circle-2 { width: 320px; height: 320px; bottom: -100px; left: -100px; }
.auth-brand-circle-3 { width: 180px; height: 180px; top: 33%; right: 25%; }

.auth-brand-inner { position: relative; z-index: 1; text-align: center; max-width: 380px; }

.auth-brand-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px; height: 64px;
  border-radius: 16px;
  background: var(--primary-dim);
  margin-bottom: 2rem;
}
.auth-brand-icon span { font-size: 26px; font-weight: 700; color: var(--primary-fg); }

.auth-brand h2 {
  font-family: var(--font);
  color: var(--primary-fg);
  font-size: 1.625rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 1rem;
}
.auth-brand p { color: rgba(255,255,255,0.7); font-size: 0.9375rem; line-height: 1.6; }

.auth-brand-tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 2.5rem; }
.auth-brand-tag {
  padding: 6px 16px;
  border-radius: 999px;
  background: var(--primary-dim);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--primary-fg);
}

/* Right — form panel */
.auth-form-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
  background: var(--card-bg);
}
@media (min-width: 1024px) { .auth-form-panel { max-width: 480px; } }

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

/* ClinqLogo */
.auth-logo {
  margin-bottom: 2.5rem;
  display: flex;
  align-items: center;
  gap: 0;
  height: 28px;       /* matches ClinqLogo height={28} */
}
.auth-logo-text {
  font-family: var(--font);
  font-size: 23.8px;  /* 28 × 0.85, matches component fontSize calc */
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--fg);
}
.auth-logo svg { display: block; }

.auth-heading { margin-bottom: 2rem; }
.auth-heading h1 {
  font-family: var(--font);
  font-size: 1.625rem;
  font-weight: 600;
  line-height: 1.25;
  margin-bottom: 4px;
  color: var(--fg);
}
.auth-heading p { color: var(--muted-fg); font-size: 0.875rem; }

/* ── Form elements ────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--fg);
  margin-bottom: 6px;
}
.form-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.form-label-row .form-label { margin-bottom: 0; }

.form-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--input-bg);
  font-family: var(--font);
  font-size: 0.875rem;
  color: var(--fg);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-input::placeholder { color: var(--muted-fg); }
.form-input:focus {
  border-color: var(--ring);
  box-shadow: 0 0 0 3px hsla(197, 71%, 40%, 0.18);
}
.form-input.error { border-color: var(--destructive); }
.form-input.error:focus { box-shadow: 0 0 0 3px rgba(239,68,68,0.15); }

.form-input-wrap { position: relative; }
.form-input-wrap .form-input { padding-right: 42px; }
.reveal-btn {
  position: absolute;
  right: 10px; top: 50%;
  transform: translateY(-50%);
  background: none; border: none; cursor: pointer;
  color: var(--muted-fg);
  padding: 4px;
  display: flex; align-items: center;
  transition: color 0.15s;
}
.reveal-btn:hover { color: var(--fg); }

.form-error { margin-top: 5px; font-size: 0.8125rem; color: var(--destructive); }

.select-wrap {
  position: relative;
}
.form-select {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding: 12px 42px 12px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--input-bg);
  font-family: var(--font);
  font-size: 0.875rem;
  color: var(--fg);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-select:focus {
  border-color: var(--ring);
  box-shadow: 0 0 0 3px hsla(197, 71%, 40%, 0.18);
}
.form-select.error {
  border-color: var(--destructive);
}
.form-select.error:focus {
  box-shadow: 0 0 0 3px rgba(239,68,68,0.15);
}
.select-caret {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted-fg);
  pointer-events: none;
  font-size: 1rem;
}

.server-error {
  padding: 10px 12px;
  border-radius: var(--radius);
  background: var(--destructive-bg);
  font-size: 0.875rem;
  color: var(--destructive);
  margin-bottom: 1.25rem;
}
.server-success {
  padding: 10px 12px;
  border-radius: var(--radius);
  background: rgba(34,197,94,0.08);
  font-size: 0.875rem;
  color: #16a34a;
  margin-bottom: 1.25rem;
}

/* ── Checkbox ─────────────────────────────────────────────────────────────── */
.form-check { display: flex; align-items: center; gap: 8px; margin-bottom: 1.5rem; }
.form-check input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }
.form-check label { font-size: 0.875rem; color: var(--muted-fg); cursor: pointer; }

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn-primary {
  width: 100%;
  padding: 10px 16px;
  background: var(--primary);
  color: var(--primary-fg);
  border: none;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.15s;
}
.btn-primary:hover { opacity: 0.9; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Links ────────────────────────────────────────────────────────────────── */
.link { color: var(--primary); font-size: 0.8125rem; text-decoration: none; }
.link:hover { text-decoration: underline; }

/* ── MFA ──────────────────────────────────────────────────────────────────── */
.code-hint { font-size: 0.8125rem; color: var(--muted-fg); margin-bottom: 1.25rem; line-height: 1.5; }
.resend-row { text-align: center; margin-top: 1rem; font-size: 0.8125rem; color: var(--muted-fg); }
.resend-row button {
  background: none; border: none; cursor: pointer;
  color: var(--primary); font-size: 0.8125rem;
  text-decoration: underline; padding: 0;
}

/* ── Divider ──────────────────────────────────────────────────────────────── */
.divider { display: flex; align-items: center; gap: 10px; margin: 1.25rem 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.divider span { font-size: 0.75rem; color: var(--muted-fg); white-space: nowrap; }

/* ── SSO buttons ──────────────────────────────────────────────────────────── */
.sso-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card-bg);
  font-family: var(--font);
  font-size: 0.875rem; font-weight: 500;
  color: var(--fg); cursor: pointer; text-decoration: none;
  transition: background 0.15s;
  margin-bottom: 8px;
}
.sso-btn:hover { background: #f8fafc; }
