:root {
  --color-background: #fbf7ef;
  --color-primary: #1d2a73;
  --color-secondary: #f24444;
  --text-main: #17212b;
  --text-muted: #5b6570;
  --surface: #ffffff;
  --border: #d9d2c5;
  --danger: var(--color-secondary);
  --shadow: 0 18px 45px rgba(23, 33, 43, 0.09);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  background: var(--color-background);
  color: var(--text-main);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

img,
textarea,
input,
button {
  max-width: 100%;
}

a {
  color: var(--color-primary);
}

a:hover {
  color: color-mix(in srgb, var(--color-primary) 82%, #000);
}

:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 3px;
}

.site-header {
  display: flex;
  align-items: center;
  min-height: 76px;
  padding: 16px clamp(16px, 4vw, 48px);
  background: rgba(251, 247, 239, 0.95);
  border-bottom: 1px solid var(--border);
}

.logo-link {
  display: inline-flex;
  align-items: center;
  max-width: min(20vw, 96px);
}

.logo-image {
  display: block;
  width: clamp(54px, 9vw, 82px);
  height: auto;
  max-height: 62px;
  object-fit: contain;
}

.page-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 28px auto 42px;
}

.top-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.82fr);
  gap: 22px;
  align-items: stretch;
}

.project-card,
.updates-panel,
.chat-panel,
.content-page,
.admin-section,
.admin-login {
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.project-card {
  min-height: 360px;
  background:
    linear-gradient(90deg, rgba(13, 23, 33, 0.76), rgba(13, 23, 33, 0.18)),
    url("/assets/louxelp_web_index_A.png") center / cover no-repeat;
  color: #fff;
  display: flex;
  align-items: end;
  overflow: hidden;
}

.project-card__content {
  width: min(620px, 100%);
  padding: clamp(24px, 5vw, 44px);
}

.project-card h1,
.content-page h1,
.admin-login h1 {
  margin: 0 0 12px;
  font-size: clamp(2rem, 5vw, 4.6rem);
  line-height: 1;
  letter-spacing: 0;
}

.project-card p {
  max-width: 48rem;
  margin: 0 0 24px;
  font-size: 1.1rem;
}

.updates-panel,
.chat-panel,
.admin-section,
.admin-login {
  background: var(--surface);
}

.section-heading,
.admin-topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 20px 22px 12px;
}

.section-heading h2,
.admin-section h2,
.admin-topbar h1 {
  margin: 0;
  font-size: 1.25rem;
}

.updates-list {
  max-height: 290px;
  overflow-y: auto;
  padding: 0 22px 22px;
}

.update-item,
.message-item,
.admin-item {
  border-top: 1px solid var(--border);
  padding: 14px 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.meta {
  display: block;
  color: var(--text-muted);
  font-size: 0.82rem;
  margin-bottom: 5px;
}

.chat-panel {
  position: relative;
  margin-top: 22px;
  overflow: hidden;
}

.chat-content {
  padding: 0 22px 22px;
  transition: filter 160ms ease, opacity 160ms ease;
}

.chat-content.is-locked {
  filter: blur(4px);
  opacity: 0.42;
  pointer-events: none;
  user-select: none;
}

.chat-gate {
  position: absolute;
  inset: 64px 16px 16px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.chat-gate.is-hidden {
  display: none;
}

.gate-form,
.stack-form,
#login-form {
  display: grid;
  gap: 12px;
}

.gate-form {
  width: min(460px, 100%);
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  pointer-events: auto;
}

label {
  font-weight: 700;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 13px;
  color: var(--text-main);
  background: #fff;
  font: inherit;
}

textarea {
  resize: vertical;
}

.checkbox-row {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  font-weight: 500;
}

.checkbox-row input {
  width: 18px;
  height: 18px;
  margin-top: 3px;
}

.button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  padding: 11px 18px;
  background: var(--color-secondary);
  color: #fff;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
}

.button:hover {
  background: color-mix(in srgb, var(--color-secondary) 86%, #000);
  color: #fff;
}

.button:active {
  background: color-mix(in srgb, var(--color-secondary) 76%, #000);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.button--light {
  display: inline-flex;
  background: var(--color-primary);
  color: #fff;
}

.button--light:hover,
.button--light:active {
  background: color-mix(in srgb, var(--color-primary) 84%, #000);
  color: #fff;
}

.button--secondary {
  background: var(--color-primary);
  color: #fff;
}

.button--secondary:hover,
.button--secondary:active {
  background: color-mix(in srgb, var(--color-primary) 84%, #000);
  color: #fff;
}

.button--danger {
  background: var(--danger);
  color: #fff;
}

.messages-list {
  min-height: 260px;
  max-height: 470px;
  overflow-y: auto;
  border-block: 1px solid var(--border);
}

.message-item strong {
  margin-right: 8px;
}

.message-form {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.message-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.form-status {
  min-height: 1.3em;
  margin: 0;
  color: var(--danger);
}

.site-footer {
  padding: 24px clamp(16px, 4vw, 48px);
  border-top: 1px solid var(--border);
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 22px;
}

.content-page {
  width: min(880px, calc(100% - 32px));
  margin: 32px auto;
  padding: clamp(22px, 5vw, 46px);
  background: var(--surface);
}

.content-page p {
  font-size: 1.05rem;
}

.admin-shell {
  width: min(1080px, calc(100% - 32px));
  margin: 32px auto;
}

.admin-login {
  width: min(480px, 100%);
  margin: 10vh auto 0;
  padding: 26px;
}

.admin-panel {
  display: grid;
  gap: 18px;
}

.admin-section {
  padding: 20px;
}

.admin-list {
  margin-top: 18px;
  max-height: 430px;
  overflow-y: auto;
}

.admin-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hidden {
  display: none !important;
}

.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;
}

@media (max-width: 800px) {
  .top-grid {
    grid-template-columns: 1fr;
  }

  .project-card {
    min-height: 300px;
  }

  .chat-gate {
    inset: 56px 10px 10px;
  }

  .message-actions,
  .admin-item,
  .admin-topbar {
    align-items: stretch;
    flex-direction: column;
    grid-template-columns: 1fr;
  }

  .message-actions .button,
  .admin-actions .button,
  .admin-topbar .button {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .page-shell,
  .admin-shell,
  .content-page {
    width: min(100% - 20px, 1180px);
  }

  .site-header {
    min-height: 66px;
    padding-inline: 12px;
  }

  .section-heading,
  .chat-content,
  .updates-list,
  .admin-section,
  .gate-form {
    padding-inline: 14px;
  }
}
