:root {
  color-scheme: dark;
  --bg: #111214;
  --panel: #1c1e22;
  --panel-strong: #24272d;
  --text: #f4f1e9;
  --muted: #b9b4aa;
  --line: #343841;
  --accent: #e5b454;
  --accent-dark: #b17d26;
  --danger: #f28b82;
  --success: #88d18a;
  --info: #8ab4f8;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
}

button,
input {
  font: inherit;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  padding: 14px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid var(--line);
  background: #17191d;
}

.brand {
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

.page {
  width: min(1040px, calc(100% - 32px));
  margin: 0 auto;
  padding: 42px 0 64px;
}

.intro,
.login-panel {
  max-width: 740px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 12px;
  font-size: clamp(2rem, 4vw, 3.8rem);
  line-height: 1.05;
}

h2 {
  margin: 30px 0 14px;
  font-size: 1.2rem;
}

h3 {
  margin-bottom: 4px;
  font-size: 1.25rem;
}

.intro p,
.login-panel p {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.55;
}

.search-form,
.login-form {
  margin-top: 30px;
}

label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-weight: 700;
}

.search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  background: var(--panel);
  color: var(--text);
  outline: none;
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgb(229 180 84 / 18%);
}

button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  padding: 0 16px;
  background: var(--accent);
  color: #16130c;
  cursor: pointer;
  font-weight: 800;
}

button:hover {
  background: #f0c66d;
}

.ghost-button {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}

.ghost-button:hover {
  background: var(--panel-strong);
}

.messages {
  display: grid;
  gap: 10px;
  margin-bottom: 24px;
}

.message {
  border: 1px solid var(--line);
  border-left-width: 5px;
  border-radius: 8px;
  padding: 12px 14px;
  background: var(--panel);
}

.message.error {
  border-left-color: var(--danger);
}

.message.success {
  border-left-color: var(--success);
}

.message.info {
  border-left-color: var(--info);
}

.results {
  display: grid;
  gap: 16px;
}

.movie-card {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--panel);
}

.poster-frame {
  width: 120px;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border-radius: 6px;
  background: #0d0e10;
}

.poster-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.poster-placeholder {
  display: grid;
  place-items: center;
  height: 100%;
  padding: 10px;
  color: var(--muted);
  text-align: center;
  font-weight: 700;
}

.year {
  margin-bottom: 10px;
  color: var(--accent);
  font-weight: 800;
}

.overview {
  color: var(--muted);
  line-height: 1.55;
}

.movie-body form {
  margin-top: 16px;
}

.empty-state {
  margin-top: 22px;
  color: var(--muted);
}

.login-panel {
  width: min(460px, 100%);
  margin: 0 auto;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.login-form {
  display: grid;
  gap: 12px;
}

.login-form button {
  margin-top: 8px;
}

@media (max-width: 640px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .search-row,
  .movie-card {
    grid-template-columns: 1fr;
  }

  .poster-frame {
    width: 100%;
    max-width: 180px;
  }
}
