/* ============================================================
   FlatChat360 - Login Service Styles
   Standalone stylesheet voor login.flatchat360.com
   Stijl: identiek aan splitter V2 (minimalistisch schermvullend)
   ============================================================ */

/* === DESIGN TOKENS (uit packages/tokens/tokens.ts) === */
:root {
  --c-primary:       #1E293B;
  --c-accent:        #7732FF;
  --c-accent-hover:  #6228D0;
  --c-accent-subtle: #EDE6FF;
  --c-highlight:     #38BDF8;
  --c-bg-app:        #F1F5F9;
  --c-bg-surface:    #FFFFFF;
  --c-text-head:     #0F172A;
  --c-text-body:     #475569;
  --c-text-muted:    #94A3B8;
  --c-border:        #E2E8F0;
  --c-error:         #EF4444;
  --c-success:       #10B981;

  --r-pill:  9999px;
  --r-card:  16px;
  --r-nav:   12px;

  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px; --sp-7: 32px; --sp-8: 40px;
  --sp-9: 48px; --sp-10: 64px;

  --font-ui: 'Poppins', sans-serif;

  --z-dropdown: 100;
  --z-toast:    999;
}

/* === BASIS RESET === */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-ui);
  color: var(--c-text-body);
  background: var(--c-bg-surface);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--c-accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }

.material-symbols-rounded {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  vertical-align: middle;
  line-height: 1;
  display: inline-block;
  width: 1em;
  height: 1em;
  overflow: hidden;
  flex-shrink: 0;
}

/* ============================================================
   SPLITTER V2 LAYOUT - gekopieerd van marketing splitter-fs
   ============================================================ */

.splitter-fs {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--c-bg-surface);
}

/* Topbar */
.splitter-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-5) var(--sp-8);
}

.navbar-logo {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  text-decoration: none;
}
.navbar-logo:hover { text-decoration: none; }
.navbar-logo-img {
  height: 36px;
  width: 36px;
  border-radius: var(--r-nav);
  display: block;
}
.logo-text {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--c-text-head);
}

/* Center */
.splitter-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--sp-8) var(--sp-5);
  gap: var(--sp-7);
}

.splitter-headline {
  font-size: clamp(2.8rem, 7vw, 5rem);
  font-weight: 800;
  color: var(--c-text-head);
  line-height: 1.1;
  margin: 0;
}

.splitter-desc {
  font-size: 1.1rem;
  color: var(--c-text-muted);
  line-height: 1.65;
  margin: 0;
}

.login-sub {
  font-size: 1.1rem;
  color: var(--c-text-muted);
  line-height: 1.65;
  margin: 0;
}

/* Bottom bar */
.splitter-bottom {
  padding: var(--sp-5) var(--sp-8);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--c-border);
  font-size: 0.75rem;
  color: var(--c-text-muted);
}
.splitter-bottom p { margin: 0; }
.splitter-bottom a { color: var(--c-text-muted); text-decoration: none; }
.splitter-bottom a:hover { color: var(--c-text-body); }

.splitter-bottom-links {
  display: flex;
  gap: var(--sp-6);
}

/* Paint stroke - identiek aan marketing */
.paint-stroke {
  position: relative;
  display: inline-block;
  isolation: isolate;
}
.paint-stroke::before {
  content: '';
  position: absolute;
  background-color: var(--c-highlight);
  width: 110%;
  height: 80%;
  left: -5%;
  top: 10%;
  z-index: -1;
  border-radius: 4px;
  transform: rotate(-2deg) scaleX(0);
  transform-origin: left;
  animation: paintStroke 0.8s ease 0.5s forwards;
}
@keyframes paintStroke {
  to { transform: rotate(-2deg) scaleX(1); }
}

/* ============================================================
   FORMULIER - gecentreerd, max 380px
   ============================================================ */

.login-form-center {
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.form-group {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.fc-input {
  width: 100%;
  padding: 12px var(--sp-5);
  border: 1px solid var(--c-border);
  border-radius: var(--r-pill);
  font-family: var(--font-ui);
  font-size: 0.9rem;
  color: var(--c-text-head);
  background: var(--c-bg-app);
  outline: none;
  transition: none;
}
.fc-input::placeholder { color: var(--c-text-muted); }
.fc-input:focus {
  border-color: var(--c-accent);
  background: var(--c-bg-surface);
  box-shadow: 0 0 0 3px var(--c-accent-subtle);
}

.login-fine {
  font-size: 0.825rem;
  color: var(--c-text-muted);
  text-align: center;
}
.login-fine a { color: var(--c-accent); }
.login-fine a:hover { text-decoration: underline; }

/* ============================================================
   KNOPPEN
   ============================================================ */

.fc-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 10px var(--sp-6);
  border-radius: var(--r-pill);
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.4;
  white-space: nowrap;
  transition: none;
}
.fc-btn:hover { text-decoration: none; }

.fc-btn-primary {
  background: var(--c-accent);
  color: #fff;
}
.fc-btn-primary:hover { background: var(--c-accent-hover); color: #fff; }
.fc-btn-primary:disabled { opacity: 0.65; cursor: not-allowed; }

.fc-btn-icon {
  width: 40px;
  height: 40px;
  padding: var(--sp-2);
  background: transparent;
  color: var(--c-text-head);
}
.fc-btn-icon:hover { background: var(--c-bg-app); }

.fc-btn-lg { padding: 14px var(--sp-7); font-size: 1rem; }

.login-submit {
  width: 100%;
  justify-content: center;
}

/* ============================================================
   LANGUAGE SELECTOR - identiek aan marketing
   ============================================================ */

.fc-lang-trigger {
  font-size: 1.2rem;
  flex-shrink: 0;
}
.fc-lang-trigger:hover { background: var(--c-bg-app); }
.fc-dropdown.open .fc-lang-trigger { background: var(--c-bg-app); }

.fc-dropdown { position: relative; display: inline-block; }

.fc-select-menu {
  position: absolute;
  top: calc(100% + var(--sp-1));
  left: 0;
  background: var(--c-bg-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-nav);
  padding: var(--sp-2) 0;
  min-width: 220px;
  z-index: var(--z-dropdown);
  display: none;
}
.fc-select-menu.right { left: auto; right: 0; }
.fc-dropdown.open .fc-select-menu { display: block; }

.fc-lang-menu { min-width: 200px; padding: var(--sp-2) 0; }

.fc-lang-item {
  padding: var(--sp-2) var(--sp-4);
  font-size: 0.875rem;
  color: var(--c-text-body);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  white-space: nowrap;
}
.fc-lang-item:hover { background: var(--c-bg-app); }
.fc-lang-item.active { color: var(--c-accent); font-weight: 600; }
.fc-lang-flag { font-size: 1.2rem; width: 24px; text-align: center; flex-shrink: 0; }
.fc-lang-name { flex: 1; }
.fc-lang-check { display: none; font-size: 16px; color: var(--c-accent); margin-left: auto; }
.fc-lang-item.active .fc-lang-check { display: flex; }

/* ============================================================
   TOASTS
   ============================================================ */

.toast-container {
  position: fixed;
  bottom: var(--sp-6);
  right: var(--sp-6);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  z-index: var(--z-toast);
}
.toast {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-5);
  border-radius: var(--r-nav);
  background: var(--c-text-head);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 500;
  min-width: 280px;
  max-width: 400px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
}
.toast.success { background: var(--c-success); }
.toast.error   { background: var(--c-error); }

/* ============================================================
   AUTH-CHECK OVERLAY
   Verbergt de pagina terwijl gecontroleerd wordt of de gebruiker
   al ingelogd is. Voorkomt dat het formulier zichtbaar flitst.
   ============================================================ */
.login-auth-check {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--c-bg-app);
  z-index: 9999;
}
.login-auth-check.hidden {
  display: none;
}
.login-auth-spinner {
  font-size: var(--sp-8);
  color: var(--c-accent);
  animation: login-spin 0.9s linear infinite;
}
@keyframes login-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ============================================================
   RESPONSIEF
   ============================================================ */

@media (max-width: 640px) {
  .splitter-topbar { padding: var(--sp-4) var(--sp-5); }
  .splitter-center { gap: var(--sp-6); }
  .login-form-center { max-width: 100%; }
  .login-submit { min-width: 100%; }
  .splitter-bottom {
    flex-direction: column;
    gap: var(--sp-3);
    text-align: center;
  }
  .splitter-bottom-links { gap: var(--sp-4); flex-wrap: wrap; justify-content: center; }
  .toast-container { left: var(--sp-4); right: var(--sp-4); bottom: var(--sp-4); }
  .toast { min-width: unset; max-width: unset; width: 100%; }
}

/* ============================================================
   DARK MODE
   ============================================================ */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --c-bg-app:       #0F172A;
    --c-bg-surface:   #0B111A;
    --c-text-head:    #F8FAFC;
    --c-text-body:    #CBD5E1;
    --c-text-muted:   #64748B;
    --c-border:       #334155;
    --c-accent:       #9B6BFF;
    --c-accent-hover: #B794FF;
    --c-accent-subtle:#2D1B69;
    --c-success-bg:   #022C22;
    --c-warning-bg:   #431407;
    --c-error-bg:     #450A0A;
    --c-info-bg:      #172554;
  }
}
[data-theme="dark"] {
  --c-bg-app:       #0F172A;
  --c-bg-surface:   #0B111A;
  --c-text-head:    #F8FAFC;
  --c-text-body:    #CBD5E1;
  --c-text-muted:   #64748B;
  --c-border:       #334155;
  --c-accent:       #9B6BFF;
  --c-accent-hover: #B794FF;
  --c-accent-subtle:#2D1B69;
  --c-success-bg:   #022C22;
  --c-warning-bg:   #431407;
  --c-error-bg:     #450A0A;
  --c-info-bg:      #172554;
}

/* Settings dropdown (ook voor login) */
.fc-settings-trigger {
  flex-shrink: 0;
  color: var(--c-text-head);
}
.fc-dropdown.open .fc-settings-trigger {
  background: var(--c-bg-app);
  color: var(--c-text-head);
}
.fc-settings-menu {
  min-width: 220px;
  padding: var(--sp-2) 0;
}
.fc-settings-theme-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-4);
  font-size: 0.875rem;
  color: var(--c-text-body);
}
.fc-settings-theme-label { flex: 1; font-weight: 500; color: var(--c-text-head); }
.fc-theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--r-pill);
  border: 1px solid var(--c-border);
  background: var(--c-bg-app);
  cursor: pointer;
  color: var(--c-text-muted);
}
.fc-theme-toggle:hover { border-color: var(--c-accent); color: var(--c-accent); }
.fc-theme-toggle .material-symbols-rounded { font-size: 18px; }
.fc-settings-divider {
  height: 1px;
  background: var(--c-border);
  margin: var(--sp-2) 0;
}
.fc-lang-item {
  padding: var(--sp-2) var(--sp-4);
  font-size: 0.875rem;
  color: var(--c-text-body);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  white-space: nowrap;
}
.fc-lang-item:hover { background: var(--c-bg-app); }
.fc-lang-item.active { color: var(--c-accent); font-weight: 600; }
.fc-lang-flag { font-size: 1.2rem; width: 24px; text-align: center; flex-shrink: 0; }
.fc-lang-name { flex: 1; }
.fc-lang-check { display: none; font-size: 16px; color: var(--c-accent); margin-left: auto; }
.fc-lang-item.active .fc-lang-check { display: flex; }
