:root {
  --primary-color: #47895b;
  --secondary-color: #76bb8b;
  --text-color: #333;
  --bot-message-bg: #d1edd9;
  --user-message-bg: #b9dcc4;
  --input-bg: #ffffff;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  --pulse-listening-start: #47895b;
  --pulse-listening-end: #376b42;
  --pulse-speaking-start: #47895b;
  --pulse-speaking-end: #76bb8b;
  --pulse-generating-start: #72c68b;
  --pulse-generating-end: #90e6aa;
  --pulse-error-start: #dc2626;
  --pulse-error-end: #b91c1c;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: var(--text-color);
  background-color: #f9f9f9;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden; /* Отключаем скролл всей страницы */
}

.header {
  background-color: var(--primary-color);
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
  flex-shrink: 0;
}

.header a {
  color: white;
  text-decoration: none;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 20px;
  transition: background-color 0.2s;
}

.header a.active {
  background-color: rgba(255, 255, 255, 0.2);
}

.header a:hover {
  background-color: rgba(255, 255, 255, 0.15);
}

.container {
  flex: 1;
  display: flex;
  flex-direction: column;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
  height: calc(100vh - 60px); /* Вычитаем высоту header */
  padding: 0;
  overflow: hidden;
  position: relative;
}

.title {
  text-align: center;
  padding: 15px 0;
  background-color: white;
  border-bottom: 1px solid #eee;
  flex-shrink: 0;
}

.title h1 {
  font-size: 1.8rem;
  margin: 0;
  color: var(--primary-color);
}

.title h2 {
  font-size: 1rem;
  margin: 5px 0 0 0;
  font-weight: normal;
  color: #666;
}

.chat-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-container {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  background-color: white;
  scroll-behavior: smooth;
}

.message {
  display: flex;
  margin-bottom: 16px;
  max-width: 80%;
}

.bot-message {
  align-self: flex-start;
}

.user-message {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.message-content {
  padding: 12px 16px;
  border-radius: 18px;
  line-height: 1.5;
  box-shadow: var(--shadow);
}

.bot-message .message-content {
  background-color: var(--bot-message-bg);
  border-bottom-left-radius: 4px;
}

.user-message .message-content {
  background-color: var(--user-message-bg);
  border-bottom-right-radius: 4px;
}

.chat-form {
  padding: 16px;
  background-color: white;
  border-top: 1px solid #eee;
  flex-shrink: 0;
}

.input-container {
  display: flex;
  border-radius: 24px;
  background-color: var(--input-bg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

input {
  flex: 1;
  padding: 12px 20px;
  border: none;
  outline: none;
  font-size: 1rem;
  background-color: transparent;
}

button {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 0 24px;
  cursor: pointer;
  font-weight: 600;
  transition: background-color 0.2s;
}

button:hover {
  background-color: #1f6b6b;
}

#pulse-circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  opacity: 0;
  transform: scale(1);
  animation: none;
  box-shadow: none;
  transition: opacity 0.6s ease, transform 0.6s ease;
  cursor: pointer;
  user-select: none;
  position: relative;
  margin-top: 250px;
  margin-left: auto;
  margin-right: auto;
}

#pulse-circle.listening {
  background: radial-gradient(circle at center, var(--pulse-listening-start), var(--pulse-listening-end));
  box-shadow:
    0 0 20px var(--pulse-listening-start),
    0 0 40px var(--pulse-listening-end) inset;
  opacity: 0.7;
  animation: breath 2.5s ease-in-out infinite;
}

#pulse-circle.speaking {
  background: linear-gradient(45deg, var(--pulse-speaking-start), var(--pulse-speaking-end));
  box-shadow:
    0 0 30px var(--pulse-speaking-end),
    0 0 60px var(--pulse-speaking-start) inset;
  opacity: 0.85;
  animation: pulse-animation 2s ease-in-out infinite;
}
#pulse-circle.generating {
  background: linear-gradient(45deg, var(--pulse-speaking-start), var(--pulse-speaking-end));
  box-shadow:
    0 0 30px var(--pulse-speaking-end),
    0 0 60px var(--pulse-speaking-start) inset;
  opacity: 0.85;
  animation: pulse-animation 2s ease-in-out infinite;
}

#pulse-circle.error {
  background: radial-gradient(circle at center, var(--pulse-error-start), var(--pulse-error-end));
  box-shadow:
    0 0 20px var(--pulse-error-start),
    0 0 40px var(--pulse-error-end) inset;
  opacity: 0.85;
  transform: scale(1.1);
  animation: none;
}

#pulse-circle.waiting {
  background: radial-gradient(circle at center, var(--pulse-error-start), var(--pulse-error-end));
  box-shadow:
    0 0 20px var(--pulse-error-start),
    0 0 40px var(--pulse-error-end) inset;
  opacity: 0.85;
  transform: scale(1.1);
  animation: none;
}

#pulse-circle.hidden {
  opacity: 0;
  animation: none;
  pointer-events: none;
}

@keyframes pulse-animation {
  0%, 100% {
    transform: scale(1);
    opacity: 0.7;
  }
  50% {
    transform: scale(1.3);
    opacity: 1;
  }
}
@keyframes breath {
  0%, 100% {
    transform: scale(1);
    opacity: 0.65;
  }
  50% {
    transform: scale(1.15);
    opacity: 0.85;
  }
}

@media (max-width: 768px) {
  .message {
    max-width: 90%;
  }
  
  .container {
    padding: 0;
  }
  
  .chat-container {
    padding: 10px;
  }
}
.register-container {
  background: white;
  padding: 2rem;
  border-radius: 10px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 450px;
}

.register-header {
  text-align: center;
  margin-bottom: 2rem;
}

.register-header h1 {
  color: #333;
  margin: 0;
  font-size: 2rem;
}

.form-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.form-group {
  margin-bottom: 1.5rem;
  flex: 1;
}

.form-group.full-width {
  flex: none;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: #555;
  font-weight: 500;
}

.form-group input {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid #e1e5e9;
  border-radius: 5px;
  font-size: 1rem;
  transition: border-color 0.3s ease;
  box-sizing: border-box;
}

.form-group input:focus {
  outline: none;
  border-color: #667eea;
}

.password-requirements {
  font-size: 0.85rem;
  color: #666;
  margin-top: 0.5rem;
  padding: 0.5rem;
  background: #f8f9fa;
  border-radius: 4px;
  border-left: 3px solid #667eea;
}

.register-btn {
  width: 100%;
  padding: 0.75rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 5px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.register-btn:hover {
  transform: translateY(-2px);
}

.register-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.links {
  text-align: center;
  margin-top: 1.5rem;
}

.links a {
  color: #667eea;
  text-decoration: none;
}

.links a:hover {
  text-decoration: underline;
}

.error-message {
  background: #fee;
  color: #c33;
  padding: 0.75rem;
  border-radius: 5px;
  margin-bottom: 1rem;
  border: 1px solid #fcc;
  display: none;
}

.success-message {
  background: #efe;
  color: #363;
  padding: 0.75rem;
  border-radius: 5px;
  margin-bottom: 1rem;
  border: 1px solid #cfc;
  display: none;
}

.loading {
  display: none;
}

.spinner {
  border: 2px solid #f3f3f3;
  border-top: 2px solid #667eea;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.field-error {
  border-color: #dc3545 !important;
}

.field-success {
  border-color: #28a745 !important;
}

.navbar {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  padding: 1rem 2rem;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
}

.nav-brand a {
  color: white;
  text-decoration: none;
  font-size: 1.5rem;
  font-weight: bold;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.nav-links a {
  color: white;
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 5px;
  transition: background-color 0.3s ease;
}

.nav-links a:hover {
  background-color: rgba(255,255,255,0.1);
}

.nav-btn {
  background: rgba(255,255,255,0.2);
  color: white;
  border: 1px solid rgba(255,255,255,0.3);
  padding: 0.5rem 1rem;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.nav-btn:hover {
  background-color: rgba(255,255,255,0.3);
}

.register-container {
  background: white;
  padding: 2rem;
  border-radius: 10px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 450px;
}

.register-header {
  text-align: center;
  margin-bottom: 2rem;
}

.register-header h1 {
  color: #333;
  margin: 0;
  font-size: 2rem;
}

.form-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.form-group {
  margin-bottom: 1.5rem;
  flex: 1;
}

.form-group.full-width {
  flex: none;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: #555;
  font-weight: 500;
}

.form-group input {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid #e1e5e9;
  border-radius: 5px;
  font-size: 1rem;
  transition: border-color 0.3s ease;
  box-sizing: border-box;
}

.form-group input:focus {
  outline: none;
  border-color: #667eea;
}

.password-requirements {
  font-size: 0.85rem;
  color: #666;
  margin-top: 0.5rem;
  padding: 0.5rem;
  background: #f8f9fa;
  border-radius: 4px;
  border-left: 3px solid #667eea;
}

.register-btn {
  width: 100%;
  padding: 0.75rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 5px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.register-btn:hover {
  transform: translateY(-2px);
}

.register-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.links {
  text-align: center;
  margin-top: 1.5rem;
}

.links a {
  color: #667eea;
  text-decoration: none;
}

.links a:hover {
  text-decoration: underline;
}

.error-message {
  background: #fee;
  color: #c33;
  padding: 0.75rem;
  border-radius: 5px;
  margin-bottom: 1rem;
  border: 1px solid #fcc;
  display: none;
}

.success-message {
  background: #efe;
  color: #363;
  padding: 0.75rem;
  border-radius: 5px;
  margin-bottom: 1rem;
  border: 1px solid #cfc;
  display: none;
}

.loading {
  display: none;
}

.spinner {
  border: 2px solid #f3f3f3;
  border-top: 2px solid #667eea;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.field-error {
  border-color: #dc3545 !important;
}

.field-success {
  border-color: #28a745 !important;
}