/*
 * TiniMe Login Page Stylesheet
 * ─────────────────────────────────────────────────────────────────────────────
 * Provides base layout and component styles for TiniMe login, consent and
 * logout pages. Admin UI pages are unaffected — all rules scope to
 * .tinyme-* classes.
 *
 * Runtime CSS variables (set by the active theme via applyTheme()):
 *   --theme-primary      Accent / button color
 *   --theme-background   Page background color
 *   --theme-card         Card background color
 *   --theme-button       Primary button color
 *   --theme-text         Text / foreground color
 *
 * To override, add your own <link> or <style> tags in the theme's
 * "Page Meta" field — they are injected into <head> after this file.
 * ─────────────────────────────────────────────────────────────────────────────
 */

/* ── Default token values (overridden at runtime) ─────────────────────────── */
:root {
  --theme-primary:    #48b9ef;
  --theme-background: #f4fbff;
  --theme-card:       #ffffff;
  --theme-button:     #1f7cb0;
  --theme-text:       #0c4a6e;
}

/* ── Page shell ───────────────────────────────────────────────────────────── */
.tinyme-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--theme-background);
  font-family: Inter, system-ui, -apple-system, sans-serif;
}

/* ── Header ───────────────────────────────────────────────────────────────── */
.tinyme-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid color-mix(in srgb, var(--theme-text) 10%, transparent);
  flex-shrink: 0;
}

.tinyme-brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.tinyme-logo {
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  background: var(--theme-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.tinyme-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 0.125rem;
}

.tinyme-logo-initial {
  color: #fff;
  font-weight: 700;
  font-size: 0.75rem;
  line-height: 1;
}

.tinyme-brand-name {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--theme-text);
}

/* ── Language switcher ────────────────────────────────────────────────────── */
.tinyme-lang {
  display: flex;
  align-items: center;
  gap: 0.125rem;
}

.tinyme-lang-btn {
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--theme-text);
  opacity: 0.75;
  transition: opacity 0.15s;
  font-family: inherit;
}

.tinyme-lang-btn:hover         { opacity: 0.85; }
.tinyme-lang-btn.active        { opacity: 1; }

/* Active state driven by html[data-tinyme-lang] — no JS needed on render */
[data-tinyme-lang='hu'] .tinyme-lang-btn[data-lang='hu'],
[data-tinyme-lang='en'] .tinyme-lang-btn[data-lang='en'],
[data-tinyme-lang='de'] .tinyme-lang-btn[data-lang='de'],
[data-tinyme-lang='fr'] .tinyme-lang-btn[data-lang='fr'],
[data-tinyme-lang='ro'] .tinyme-lang-btn[data-lang='ro'] {
  opacity: 1;
}

/* ── Main content area ────────────────────────────────────────────────────── */
.tinyme-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem;
}

.tinyme-content {
  width: 100%;
  max-width: 24rem;
}

.tinyme-content-wide {
  width: 100%;
  max-width: 72rem;
}

/* ── Footer ───────────────────────────────────────────────────────────────── */
.tinyme-footer {
  padding: 1rem;
  text-align: center;
  flex-shrink: 0;
}

.tinyme-footer p,
.tinyme-footer-text {
  font-size: 0.75rem;
  color: var(--theme-text);
  opacity: 0.55;
  margin: 0;
  font-family: inherit;
}

/* ── Theme-aware surfaces (light and dark login themes, 2026-11-19) ──────────
   The colors follow the tenant's theme: a red mixed toward the text color
   reads on a light and on a dark card alike. */
.tm-card {
  background: var(--theme-card);
  border: 1px solid color-mix(in srgb, var(--theme-text) 12%, transparent);
}
.tm-error {
  background: color-mix(in srgb, #dc2626 10%, transparent);
  border: 1px solid color-mix(in srgb, #dc2626 35%, transparent);
  color: color-mix(in srgb, #dc2626 70%, var(--theme-text));
}
.tm-error-text { color: color-mix(in srgb, #dc2626 70%, var(--theme-text)); }
.tm-muted { color: color-mix(in srgb, var(--theme-text) 65%, transparent); }
.tm-divider { border-top: 1px solid color-mix(in srgb, var(--theme-text) 12%, transparent); }

/* ── Account settings page (.tm-themed): the sections were written for a dark
   theme; inside .tm-themed their Tailwind colors follow the tenant's theme.
   This sheet is unlayered, so it wins over Tailwind's @layer utilities. ── */
.tm-themed .text-slate-200 { color: var(--theme-text); }
.tm-themed .text-slate-300,
.tm-themed .text-slate-400,
.tm-themed .text-slate-500,
.tm-themed .text-slate-600 { color: color-mix(in srgb, var(--theme-text) 65%, transparent); }
.tm-themed .hover\:text-slate-300:hover { color: var(--theme-text); }
.tm-themed .placeholder-slate-500::placeholder,
.tm-themed .placeholder-slate-600::placeholder { color: color-mix(in srgb, var(--theme-text) 45%, transparent); }
/* neutral buttons */
.tm-themed .bg-slate-700 { background: color-mix(in srgb, var(--theme-text) 8%, transparent); }
.tm-themed .hover\:bg-slate-600:hover { background: color-mix(in srgb, var(--theme-text) 14%, transparent); }
.tm-themed .border-slate-600 { border-color: color-mix(in srgb, var(--theme-text) 22%, transparent); }
.tm-themed .border-slate-600\/30 { border-color: color-mix(in srgb, var(--theme-text) 12%, transparent); }
.tm-themed .bg-slate-700.text-white,
.tm-themed .bg-slate-700 .text-white { color: var(--theme-text); }
/* red: danger buttons, errors */
.tm-themed .text-red-300,
.tm-themed .text-red-400,
.tm-themed .hover\:text-red-300:hover { color: color-mix(in srgb, #dc2626 70%, var(--theme-text)); }
.tm-themed .bg-red-900\/20,
.tm-themed .bg-red-900\/40 { background: color-mix(in srgb, #dc2626 12%, transparent); }
.tm-themed .hover\:bg-red-900\/30:hover,
.tm-themed .hover\:bg-red-900\/40:hover,
.tm-themed .hover\:bg-red-900\/60:hover { background: color-mix(in srgb, #dc2626 20%, transparent); }
.tm-themed .border-red-700\/40,
.tm-themed .border-red-700\/50 { border-color: color-mix(in srgb, #dc2626 40%, transparent); }
.tm-themed .bg-red-900\/40.text-white,
.tm-themed .bg-red-900\/20.text-white { color: color-mix(in srgb, #dc2626 70%, var(--theme-text)); }
/* green / amber notices */
.tm-themed .text-green-400 { color: color-mix(in srgb, #16a34a 75%, var(--theme-text)); }
.tm-themed .bg-green-900\/20 { background: color-mix(in srgb, #16a34a 10%, transparent); }
.tm-themed .border-green-700\/30 { border-color: color-mix(in srgb, #16a34a 35%, transparent); }
.tm-themed .text-amber-300,
.tm-themed .text-amber-400,
.tm-themed .text-amber-400\/80,
.tm-themed .text-amber-500\/80 { color: color-mix(in srgb, #b45309 75%, var(--theme-text)); }
.tm-themed .bg-amber-900\/20 { background: color-mix(in srgb, #d97706 10%, transparent); }
.tm-themed .border-amber-700\/40 { border-color: color-mix(in srgb, #d97706 40%, transparent); }
/* brand buttons take the theme's button color (contrast with white text) */
.tm-themed .bg-tinyme-600 { background: var(--theme-button); }
.tm-themed .hover\:bg-tinyme-700:hover { background: color-mix(in srgb, var(--theme-button) 85%, #000); }
.tm-themed .hover\:bg-red-700:hover { background: #b91c1c; color: #fff; }
/* the shared Tabs component (made for the light admin console) */
.tm-themed .border-slate-200 { border-color: color-mix(in srgb, var(--theme-text) 15%, transparent); }
.tm-themed .hover\:border-slate-300:hover { border-color: color-mix(in srgb, var(--theme-text) 30%, transparent); }
.tm-themed .hover\:text-slate-800:hover { color: var(--theme-text); }
