/* ===================================================================
   AUTH — shared styles for the public/auth cluster ("warm precision")
   Consumers:
     - templates/login.html         (extends layout.html; refine.css IS loaded)
     - templates/index_company.html (standalone page; refine.css is NOT loaded)
   Self-contained on purpose: every custom property used below is
   defined here (values mirror static/css/refine.css) so both
   consumers render identically.
   White-label (company_info / settings) values — logos, background
   art, opacity, primary colors — stay as small inline <style> blocks
   in each template and override the brand fallbacks in this file.
   =================================================================== */

:root {
  /* Type (mirrors refine.css) */
  --font-display: "Bricolage Grotesque", "Manrope", sans-serif;
  --font-ui: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* Ink & surfaces */
  --ink-900: #211d16;      /* espresso — primary text & solid buttons */
  --ink-800: #2e2a22;
  --ink-700: #4a463d;
  --ink-500: #7a766c;      /* muted text */
  --cream-page: #faf8f4;
  --cream-muted: #f4f1ea;
  --line-soft: #eae6dc;    /* hairline borders */
  --line-strong: #d9d3c4;

  /* Accent — caramel */
  --caramel-600: #b06612;
  --caramel-500: #c17817;

  /* Warm espresso hero gradient (brand fallback for background art) */
  --espresso-gradient: linear-gradient(135deg, #2e2a22 0%, #4a463d 100%);
}

/* ── SHARED: page shell (login + company landing) ─────────────── */

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-ui);
  background-color: var(--cream-page);
  color: var(--ink-800);
}

.login-container,
.landing-container {
  position: relative;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  overflow: hidden;
}

/* Brand fallback backdrop; each template's inline block overrides
   with company background art / color when configured. */
.background-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--espresso-gradient);
  background-size: cover;
  background-position: center;
  opacity: 0.2;
  filter: blur(3px);
  z-index: -1;
}

.login-content,
.landing-content {
  z-index: 1;
  background-color: rgba(255, 255, 255, 0.85);
  border-radius: 10px;
  padding: 3rem;
  width: 90%;
  box-shadow: 0 10px 25px rgba(33, 29, 22, 0.1);
}
.login-content { max-width: 500px; }
.landing-content { max-width: 800px; }

.logo {
  height: auto;
  border-radius: 4px;
}

/* Shared responsive adjustments */
@media (max-width: 768px) {
  .login-content,
  .landing-content {
    padding: 2rem;
    width: 95%;
  }
}

/* ── LOGIN PAGE (templates/login.html) ────────────────────────── */

.login-container .logo-container {
  margin-bottom: 1.5rem;
  position: relative;
  z-index: 2;
}

.login-container .logo {
  max-width: 100px; /* company_info.logo_max_width overrides inline */
  position: relative;
  pointer-events: auto;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

/* Tap counter badge (easter-egg) */
.tap-counter {
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--caramel-500);
  color: #000;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  animation: tapPulse 0.3s ease;
  box-shadow: 0 2px 8px rgba(193, 120, 23, 0.5);
  z-index: 100;
  pointer-events: none;
}

.tap-counter.show {
  display: flex;
}

@keyframes tapPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

.login-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 2rem;
  color: var(--ink-900);
  margin-bottom: 0.5rem;
}

.login-tagline {
  font-family: var(--font-ui);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--caramel-600); /* company_info.primary_color overrides inline */
  margin-bottom: 1.5rem;
}

.login-title-only {
  margin-bottom: 1.5rem;
}

.login-container .form-control {
  font-family: var(--font-ui);
  padding: 12px 15px;
  border-radius: 6px;
  border: 1px solid var(--line-strong);
  background-color: rgba(255, 255, 255, 0.9);
  transition: all 0.3s ease;
  margin-bottom: 1rem;
}

.login-container .form-control:focus {
  border-color: var(--caramel-500);
  box-shadow: 0 0 0 0.2rem rgba(193, 120, 23, 0.22);
  background-color: white;
}

.login-container .form-label {
  font-weight: 500;
  color: var(--ink-700);
}

.login-container .btn-login {
  background-color: var(--ink-900); /* company_info.primary_color overrides inline */
  color: white;
  font-family: var(--font-ui);
  font-weight: 600;
  padding: 12px 28px;
  font-size: 1.1rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  width: 100%;
  margin-bottom: 1.5rem;
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px rgba(33, 29, 22, 0.1);
}

.login-container .btn-login:hover {
  background-color: #141109;
  transform: translateY(-3px);
  box-shadow: 0 6px 10px rgba(33, 29, 22, 0.15);
}

.forgot-links {
  display: flex;
  justify-content: space-between;
  width: 100%;
}

.forgot-link {
  color: var(--ink-700);
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  padding: 8px 16px;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  background-color: rgba(255, 255, 255, 0.5);
}

.forgot-link:hover {
  color: var(--ink-900);
  background-color: white;
  transform: translateY(-2px);
  box-shadow: 0 2px 5px rgba(33, 29, 22, 0.1);
  text-decoration: none;
}

.legal-link:hover {
  color: var(--ink-900) !important;
  text-decoration: underline !important;
}

@media (max-width: 768px) {
  .login-title {
    font-size: 1.8rem;
  }

  .forgot-links {
    flex-direction: column;
    gap: 10px;
  }
}

/* Easter Egg Game Overlay */
#egg-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  display: grid;
  place-items: center;
  z-index: 9999;
  backdrop-filter: blur(4px);
}

#egg-overlay.egg-hidden {
  display: none;
}

.egg-shell {
  width: min(95vw, 440px);
  aspect-ratio: 3 / 5;
  background: #000;
  border-radius: 14px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
  position: relative;
  overflow: hidden;
  border: 2px solid var(--caramel-500);
}

.egg-close {
  position: absolute;
  top: 8px;
  right: 10px;
  border: 0;
  background: #fff;
  color: #000;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  font-size: 24px;
  font-weight: 700;
  cursor: pointer;
  z-index: 10000;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.egg-close:hover {
  background: var(--caramel-500);
  transform: scale(1.1);
}

.egg-hint {
  position: absolute;
  bottom: 12px;
  width: 100%;
  text-align: center;
  color: #ddd;
  font-size: 0.8rem;
  opacity: 0.8;
  pointer-events: none;
  text-shadow: 0 1px 3px #000;
}

@media (max-width: 768px) {
  .egg-shell {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    aspect-ratio: auto;
  }

  .egg-hint {
    font-size: 0.75rem;
    bottom: 90px;
  }
}

/* ── COMPANY LANDING PAGE (templates/index_company.html) ──────── */
/* Standalone page: --primary-color / --secondary-color come from an
   inline :root block in the template (settings.* white-label hooks). */

.landing-container .logo-container {
  margin-bottom: 2rem;
}

.landing-container .logo {
  max-width: 150px;
}

.site-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 2.5rem;
  color: var(--ink-900);
  margin-bottom: 1rem;
}

.site-tagline {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.site-description {
  font-size: 1.1rem;
  font-weight: 300;
  color: var(--ink-700);
  max-width: 600px;
  line-height: 1.6;
  margin: 0 auto 2.5rem;
}

.action-buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
}

.btn-auth {
  padding: 12px 28px;
  font-size: 1rem;
  font-family: var(--font-ui);
  font-weight: 600;
  letter-spacing: 1px;
  text-decoration: none;
  border: none;
  border-radius: 4px;
  transition: all 0.3s ease;
}

.landing-container .btn-login {
  background-color: var(--primary-color);
  color: white;
  box-shadow: 0 4px 6px rgba(33, 29, 22, 0.1);
}

.landing-container .btn-login:hover {
  filter: brightness(0.85);
  transform: translateY(-3px);
  box-shadow: 0 6px 10px rgba(33, 29, 22, 0.15);
  color: white;
  text-decoration: none;
}

.btn-signup {
  background-color: #ffffff;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
}

.btn-signup:hover {
  background-color: var(--cream-muted);
  transform: translateY(-3px);
  box-shadow: 0 6px 10px rgba(33, 29, 22, 0.1);
  color: var(--primary-color);
  text-decoration: none;
}

.footer-text {
  margin-top: 3rem;
  font-size: 0.9rem;
  color: var(--ink-500);
}

.powered-by-link {
  color: var(--ink-500);
  text-decoration: underline;
}

.powered-by-link:hover {
  color: var(--primary-color);
}

@media (max-width: 768px) {
  .site-title {
    font-size: 2rem;
  }

  .site-description {
    font-size: 1rem;
  }

  .action-buttons {
    flex-direction: column;
    gap: 15px;
  }
}
