:root {
  --brand-dark: #443341;
  --brand-accent: #D93735;
  --brand-gray: #B3B2B2;
  --brand-bg: #FFFFFF;
  --brand-light-bg: #F7F5F6;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--brand-dark);
  background: var(--brand-bg);
  line-height: 1.6;
}

a {
  color: var(--brand-accent);
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
header.site-header {
  background: var(--brand-dark);
  padding: 20px 0;
}

header.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

header.site-header img.logo {
  height: 32px;
  filter: brightness(0) invert(1);
}

/* Hero */
.hero {
  background: var(--brand-light-bg);
  padding: 64px 0;
  text-align: center;
}

.hero h1 {
  font-size: 2.4rem;
  margin: 0 0 12px;
  color: var(--brand-dark);
}

.hero p.subtitle {
  font-size: 1.1rem;
  color: var(--brand-gray);
  margin: 0 0 8px;
}

.hero .meta {
  display: flex;
  gap: 24px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 24px;
  font-weight: 600;
}

.hero .meta span {
  background: var(--brand-bg);
  border: 1px solid var(--brand-gray);
  border-radius: 999px;
  padding: 8px 18px;
}

/* About */
.about {
  padding: 56px 0;
  text-align: center;
}

.about h2 {
  color: var(--brand-dark);
}

.about p {
  max-width: 620px;
  margin: 0 auto;
  color: #555;
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
  text-align: left;
}

.about-photo {
  width: 100%;
  border-radius: 16px;
  box-shadow: 0 8px 30px rgba(68, 51, 65, 0.15);
}

.about-text h2 {
  margin-top: 0;
}

.about-text h3 {
  color: var(--brand-dark);
  margin-bottom: 8px;
}

.about-text p {
  margin: 0 auto 16px;
  max-width: none;
}

.learn-list {
  margin: 0 0 20px;
  padding-left: 20px;
  color: #555;
}

.learn-list li {
  margin-bottom: 6px;
}

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

/* Registration form */
.register {
  background: var(--brand-light-bg);
  padding: 56px 0;
}

.register .container {
  max-width: 520px;
}

.register h2 {
  text-align: center;
  margin-bottom: 8px;
  color: var(--brand-dark);
}

.register p.hint {
  text-align: center;
  color: var(--brand-gray);
  margin-bottom: 32px;
}

form.reg-form {
  background: var(--brand-bg);
  border-radius: 12px;
  padding: 32px;
  box-shadow: 0 4px 20px rgba(68, 51, 65, 0.08);
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 0.9rem;
}

.form-group input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--brand-gray);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
}

.form-group input:focus {
  outline: none;
  border-color: var(--brand-accent);
}

.btn-submit {
  width: 100%;
  background: var(--brand-accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 14px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s;
}

.btn-submit:hover {
  opacity: 0.9;
}

.btn-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.form-message {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 0.9rem;
  display: none;
}

.form-message.success {
  display: block;
  background: #e6f4ea;
  color: #1e7e34;
}

.form-message.error {
  display: block;
  background: #fde8e7;
  color: var(--brand-accent);
}

.field-error {
  color: var(--brand-accent);
  font-size: 0.8rem;
  margin-top: 4px;
  display: none;
}

/* Footer */
footer.site-footer {
  background: var(--brand-dark);
  color: var(--brand-gray);
  text-align: center;
  padding: 24px 0;
  font-size: 0.85rem;
}

footer.site-footer a {
  color: #fff;
}

/* Admin */
.admin-body {
  background: var(--brand-light-bg);
  min-height: 100vh;
}

.admin-header {
  background: var(--brand-dark);
  color: #fff;
  padding: 16px 0;
}

.admin-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-header a {
  color: var(--brand-gray);
  text-decoration: none;
}

.admin-wrap {
  max-width: 1000px;
  margin: 0 auto;
  padding: 32px 20px;
}

.admin-toolbar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.admin-toolbar input[type="search"] {
  padding: 10px 14px;
  border: 1px solid var(--brand-gray);
  border-radius: 8px;
  min-width: 240px;
}

.btn {
  display: inline-block;
  background: var(--brand-accent);
  color: #fff;
  text-decoration: none;
  padding: 10px 18px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
}

table.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(68, 51, 65, 0.06);
}

table.admin-table th,
table.admin-table td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid #eee;
  font-size: 0.9rem;
}

table.admin-table th {
  background: var(--brand-light-bg);
  color: var(--brand-dark);
}

table.admin-table .delete-btn {
  background: none;
  border: none;
  color: var(--brand-accent);
  cursor: pointer;
  font-size: 0.85rem;
}

.login-wrap {
  max-width: 380px;
  margin: 80px auto;
  padding: 0 20px;
}

.login-wrap form {
  background: #fff;
  padding: 32px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(68, 51, 65, 0.08);
}

.login-wrap h1 {
  text-align: center;
  font-size: 1.4rem;
}

/* Chat widget */
.chat-widget {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1000;
}

.chat-toggle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: var(--brand-accent);
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(68, 51, 65, 0.25);
}

.chat-panel {
  position: absolute;
  right: 0;
  bottom: 68px;
  width: 320px;
  max-width: calc(100vw - 40px);
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(68, 51, 65, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-panel[hidden] {
  display: none;
}

.chat-header {
  background: var(--brand-dark);
  color: #fff;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
}

.chat-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  line-height: 1;
}

.chat-messages {
  padding: 12px 16px;
  height: 320px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-msg {
  max-width: 85%;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 0.85rem;
  line-height: 1.4;
}

.chat-msg-bot {
  background: var(--brand-light-bg);
  color: var(--brand-dark);
  align-self: flex-start;
}

.chat-msg-user {
  background: var(--brand-accent);
  color: #fff;
  align-self: flex-end;
}

.chat-msg-typing {
  opacity: 0.6;
  font-style: italic;
}

.chat-input-row {
  display: flex;
  border-top: 1px solid #eee;
  padding: 10px;
  gap: 8px;
}

.chat-input-row input {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid var(--brand-gray);
  border-radius: 8px;
  font-size: 0.85rem;
  font-family: inherit;
}

.chat-input-row button {
  background: var(--brand-accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 0.85rem;
  cursor: pointer;
  font-weight: 600;
}

.chat-input-row button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

@media (max-width: 600px) {
  .hero h1 {
    font-size: 1.8rem;
  }
  form.reg-form {
    padding: 20px;
  }
  .admin-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
}
