/* ===== ОСНОВНЫЕ НАСТРОЙКИ ===== */
:root {
  /* Цветовая палитра */
  --primary-dark: #b3563b;
  --primary: #b3826a;
  --primary-light: #b85c4a;
  --secondary-dark: #2e4045;
  --secondary: #3a4e53;
  --text-dark: #2c2c2c;
  --text-soft: #5e6e73;
  --text-muted: #6f7e7e;
  --bg-main: #f9f5f0;
  --bg-card: #fffffffa;
  --bg-soft: #f2ebe3;
  --border-light: #ece3d7;
  --border-soft: #e1d3c5;
  --accent-soft: #eadccf;
  
  /* Размеры */
  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 14px;
  --radius-xs: 8px;
  --radius-full: 40px;
  
  /* Тени */
  --shadow-sm: 0 4px 10px rgba(0,0,0,0.02);
  --shadow-md: 0 15px 35px -10px rgba(41, 36, 30, 0.15);
  --shadow-lg: 0 20px 40px -15px rgba(41, 36, 30, 0.2);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: var(--bg-main);
  font-family: 'Inter', sans-serif;
  color: var(--text-dark);
  line-height: 1.5;
  padding: 1rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.wrapper {
  max-width: 1100px;
  width: 100%;
}

a {
  color: var(--secondary-dark);
  transition: color 0.2s ease;
}

a:hover {
  text-decoration: none;
  color: var(--primary-dark);
}

/* ===== ОБЩИЕ КОМПОНЕНТЫ ===== */
.section-title {
  font-family: 'Literata', serif;
  font-size: clamp(1.5rem, 3vw, 1.3rem);
  font-weight: 600;
  color: var(--secondary-dark);
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding-left: 1.5rem;
}

.page-title {
  font-family: 'Literata', serif;
  font-size: clamp(1.5rem, 4vw, 1.8rem);
  font-weight: 600;
  color: var(--secondary-dark);
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding-bottom: 0.5rem;
}

.section-title i {
  color: var(--primary-light);
  font-size: clamp(1.4rem, 3vw, 1.6rem);
}

.section-title span {
  font-size: 1rem;
  color: #7a6a5c;
  font-weight: 400;
  margin-left: 0.5rem;
}

/* Карточки */
.card {
  background-color: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  margin-bottom: 2rem;
  overflow: hidden;
}

.card-shadow {
  box-shadow: var(--shadow-md);
}

.card-shadow-lg {
  box-shadow: var(--shadow-lg);
}

/* Бейджи */
.badge-container {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin: 0.5rem 0;
}

.badge {
  background-color: #e8ddd2;
  color: var(--secondary);
  padding: 0.2rem 0.9rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
}

/* ===== ШАПКА ===== */
.club-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
}

.header-left {
  border-left: 6px solid var(--primary-dark);
  padding-left: clamp(1.2rem, 3vw, 1.8rem);
  flex: 1 1 auto;
}

.header-left h1 {
  font-family: 'Literata', serif;
  font-size: clamp(1.8rem, 5vw, 2.2rem);
  font-weight: 600;
  color: var(--secondary-dark);
  line-height: 1.2;
}

.header-left h1 i {
  color: var(--primary-light);
  font-size: clamp(1.6rem, 4vw, 2rem);
  margin-right: 0.3rem;
}

.header-left .subhead {
  font-size: 1rem;
  color: var(--text-soft);
  margin-top: 0.4rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  padding: 0.5rem 0;
}

/* ===== ПРОФИЛЬ ПОЛЬЗОВАТЕЛЯ ===== */
.user-profile {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  background-color: var(--bg-soft);
  padding: 0.5rem 1.2rem 0.5rem 0.8rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-soft);
  transition: all 0.2s ease;
}

.user-profile:hover {
  background-color: #ece1d6;
  border-color: #cbb7a4;
  box-shadow: 0 4px 8px rgba(0,0,0,0.05);
}

.user-avatar {
  width: 2.4rem;
  height: 2.4rem;
  background-color: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.2rem;
  border: 2px solid #f0e0d4;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.user-name {
  font-weight: 500;
  color: var(--secondary-dark);
  font-size: 1rem;
  max-width: 150px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-name i {
  color: var(--primary);
  margin-left: 0.3rem;
  font-size: 0.8rem;
  opacity: 0.8;
}

.logout-btn {
  background: none;
  border: none;
  color: #8e8072;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.3rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.logout-btn:hover {
  color: var(--primary-dark);
  background-color: #f0e7de;
  transform: scale(1.05);
}

/* ===== ТАБЛИЦЫ И КАРТОЧКИ КНИГ ===== */
.table-section {
  margin-bottom: 2.8rem;
}

.books-container,
.books-table {
  composes: card card-shadow;
}

/* Десктопная таблица */
.desktop-table {
  width: 100%;
  border-collapse: collapse;
}

.desktop-table th {
  text-align: left;
  padding: 1.2rem 1rem 0.8rem 1.5rem;
  font-family: 'Literata', serif;
  font-weight: 600;
  color: #5f4e41;
  border-bottom: 2px solid var(--accent-soft);
  background-color: #fbf7f2;
  font-size: 0.95rem;
}

.desktop-table td {
  padding: 1.2rem 1rem 1.2rem 1.5rem;
  border-bottom: 1px solid #f0e7de;
  vertical-align: top;
  background-color: white;
}

/* Мобильные карточки */
.mobile-cards {
  display: none;
  padding: 0.3rem;
}

.book-card {
  background: #fefcf9;
  border-radius: var(--radius-md);
  padding: 1.2rem;
  margin-bottom: 0.1rem;
  border: 1px solid var(--accent-soft);
  box-shadow: var(--shadow-sm);
}

.book-card:last-child {
  margin-bottom: 0;
}

.card-header {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  margin-bottom: 0.8rem;
}

.card-header i {
  color: var(--primary-light);
  font-size: 1.2rem;
  margin-top: 0.2rem;
}

.card-title h3 {
  font-family: 'Literata', serif;
  font-weight: 600;
  font-size: 1.2rem;
  color: var(--secondary-dark);
  margin-bottom: 0.2rem;
  align-items: center;
}

.card-title .author {
  font-size: 0.9rem;
  color: #786b5e;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-left: -2rem;
}

.card-review {
  background: #fcf9f6;
  border-radius: var(--radius-sm);
  padding: 0.8rem 1rem;
  margin: 0.8rem 0;
  border-left: 3px solid #d6bd9f;
  font-family: 'Literata', serif;
  font-size: 0.95rem;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.85rem;
  color: #7a6a5c;
  margin: 0.6rem 0;
}

.card-meta span {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.card-rating {
  background: #f0e0d4;
  border-radius: var(--radius-full);
  padding: 0.2rem 0.8rem;
  font-weight: 500;
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.6rem;
  color: #6b5f54;
  font-size: 0.9rem;
}

/* ===== ФОРМЫ ===== */
.form-card {
  composes: card;
  padding: 1.5rem 1.2rem;
}

.form-title {
  font-family: 'Literata', serif;
  font-size: clamp(1.4rem, 4vw, 1.6rem);
  font-weight: 600;
  color: var(--secondary-dark);
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.form-title i {
  color: var(--primary-light);
  font-size: clamp(1.4rem, 4vw, 1.6rem);
}

.form-sub {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
  border-left: 3px solid #ddcdbb;
  padding-left: 1rem;
}

.review-form {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

@media (min-width: 550px) {
  .form-row {
    flex-direction: row;
  }
  .form-row .form-group {
    flex: 1;
  }
}

.form-group label {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 500;
  color: #4f5f5c;
  font-size: 0.9rem;
}

.form-group label i {
  color: #b3826a;
  width: 1.2rem;
}

.form-control {
  width: 100%;
  padding: 0.8rem 1rem;
  background-color: #fefcf9;
  border: 1px solid var(--border-soft);
  border-radius: 18px;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  transition: all 0.2s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  background-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(179, 130, 106, 0.12);
}

textarea.form-control {
  min-height: 120px;
  resize: vertical;
}

/* Рейтинг */
.rating-select {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  background: #f4ede6;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-full);
  border: 1px solid #dbcbba;
}

.rating-select select {
  background: #fffbf7;
  border: 1px solid #ccb7a6;
  border-radius: 30px;
  padding: 0.4rem 1.5rem 0.4rem 1rem;
  font-size: 0.9rem;
  color: var(--secondary-dark);
  flex: 1;
  min-width: 80px;
}

/* ===== ЧЕКБОКСЫ ===== */
.checkbox-group {
  margin: 1.2rem 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  cursor: pointer;
  color: var(--secondary);
  font-size: 1rem;
}

.checkbox-item input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.checkbox-custom {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  background-color: #fefcf9;
  border: 2px solid var(--border-soft);
  border-radius: var(--radius-xs);
  transition: all 0.2s ease;
  box-shadow: inset 2px 2px 4px rgba(0,0,0,0.02);
  color: var(--primary);
}

.checkbox-item:hover .checkbox-custom {
  border-color: var(--primary);
  background-color: #fff9f2;
}

.checkbox-item input[type="checkbox"]:focus + .checkbox-custom {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(179, 130, 106, 0.12);
}

.checkbox-item input[type="checkbox"]:checked + .checkbox-custom {
  background-color: var(--primary);
  border-color: #9f735a;
  color: white;
}

.checkbox-custom i {
  display: none;
  font-size: 0.9rem;
}

.checkbox-item input[type="checkbox"]:checked + .checkbox-custom i {
  display: inline-block;
}

.checkbox-item input[type="checkbox"]:disabled + .checkbox-custom {
  opacity: 0.5;
  background-color: #ede3d9;
  border-color: #d6c2b2;
  cursor: not-allowed;
}

/* ===== КНОПКИ ===== */
.btn-primary {
  width: 100%;
  background-color: var(--primary);
  border: none;
  color: white;
  padding: 0.9rem 1.5rem;
  border-radius: var(--radius-full);
  font-size: 1.1rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  cursor: pointer;
  border: 1px solid #9f735a;
  font-family: 'Literata', serif;
  transition: background-color 0.2s ease;
}

.btn-primary:hover {
  background-color: #9f6e55;
}

.btn-login {
  composes: btn-primary;
  width: auto;
  min-width: 200px;
}

.btn-login i {
  font-size: 1.1rem;
}

/* ===== ФОРМА ВХОДА ===== */
.login-card {
  composes: card card-shadow-lg;
  max-width: 440px;
  width: 100%;
  padding: clamp(1.8rem, 5vw, 2.5rem) clamp(1.5rem, 4vw, 2.2rem);
  backdrop-filter: blur(2px);
}

.login-header {
  border-left: 6px solid var(--primary-dark);
  padding-left: clamp(1.2rem, 3vw, 1.5rem);
  margin-bottom: 2rem;
}

.login-header h1 {
  font-family: 'Literata', serif;
  font-size: clamp(1.8rem, 5vw, 2.2rem);
  font-weight: 600;
  color: var(--secondary-dark);
  line-height: 1.2;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.login-header h1 i {
  color: var(--primary-light);
  font-size: clamp(1.6rem, 4vw, 2rem);
}

.login-header p {
  color: var(--text-soft);
  font-size: 1rem;
  margin-top: 0.25rem;
}

.login-header p i {
  color: var(--primary);
  margin-right: 0.3rem;
}

.login-links {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.8rem;
  font-size: 0.95rem;
}

.login-links a {
  color: var(--text-muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: color 0.2s ease;
  border-bottom: 1px dashed #d6c9bc;
}

.login-links a:hover {
  color: var(--primary-dark);
  border-bottom-color: var(--primary-dark);
}

.login-links i {
  color: var(--primary);
  font-size: 0.9rem;
}

/* ===== ФУТЕР ===== */
.club-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1rem;
  background: var(--bg-soft);
  border-radius: var(--radius-full);
  padding: 1.2rem 1.5rem;
  color: #3f4f55;
  border: 1px solid var(--border-soft);
}

.join-link {
  background: #ffffffd9;
  padding: 0.5rem 1.5rem;
  border-radius: var(--radius-full);
  color: var(--secondary-dark);
  text-decoration: none;
  font-weight: 500;
  border: 1px solid #cbb7a4;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  white-space: nowrap;
  transition: all 0.2s ease;
  margin-bottom: 0.5rem;
}

.join-link:hover {
  background: #ffffff;
  border-color: var(--primary);
}

.demo-note {
  font-size: 0.75rem;
  color: #9b8b7c;
  text-align: center;
  margin-top: 0.8rem;
}

/* ===== АДАПТИВНОСТЬ ===== */
@media (min-width: 600px) {
  .club-footer {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

@media (max-width: 700px) {
  .desktop-table {
    display: none;
  }
  .mobile-cards {
    display: block;
  }
}

@media (max-width: 600px) {
  .club-header {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .header-right {
    align-self: flex-end;
    margin-top: 0.5rem;
  }
  
  .user-profile {
    padding: 0.3rem 1rem 0.3rem 0.5rem;
  }
  
  .user-avatar {
    width: 2rem;
    height: 2rem;
    font-size: 1rem;
  }
  
  .user-name {
    font-size: 0.9rem;
    max-width: 120px;
  }
}

@media (max-width: 450px) {
  .login-card {
    padding: 1.8rem 1.5rem;
  }
}
#toast-container {
            position: fixed;
            top: 20px;
            right: 20px;
            z-index: 9999;
            display: flex;
            flex-direction: column;
            gap: 10px;
            pointer-events: none; /* Чтобы не мешать кликам, когда пусто */
        }

        /* 2. СТИЛЬ УВЕДОМЛЕНИЯ */
        .toast {
            pointer-events: auto; /* Возвращаем кликабельность */
            background-color: #27ae60;
            color: white;
            min-width: 300px;
            padding: 12px 16px;
            border-radius: 12px;
            box-shadow: 0 10px 20px rgba(0,0,0,0.15);
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
            display: flex;
            align-items: center;
            justify-content: space-between;
            animation: slideInRight 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
            overflow: hidden;
        }

        /* 3. КОНТЕНТ (ИКОНКА + ТЕКСТ) */
        .toast-content {
            display: flex;
            align-items: center;
            gap: 12px;
        }

        /* 4. КНОПКА ЗАКРЫТИЯ */
        .toast-close {
            background: none;
            border: none;
            color: white;
            font-size: 24px;
            cursor: pointer;
            opacity: 0.7;
            padding: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: opacity 0.2s;
            margin-right: -8px;
        }

        .toast-close:hover {
            opacity: 1;
        }

        /* 5. АНИМАЦИИ */
        @keyframes slideInRight {
            from { transform: translateX(120%); opacity: 0; }
            to { transform: translateX(0); opacity: 1; }
        }

        @keyframes slideInTop {
            from { transform: translateY(-120%); opacity: 0; }
            to { transform: translateY(0); opacity: 1; }
        }

        .toast.fade-out {
            opacity: 0;
            transform: scale(0.9);
            transition: all 0.3s ease-out;
        }

        /* 6. МОБИЛЬНАЯ АДАПТАЦИЯ */
        @media (max-width: 600px) {
            #toast-container {
                top: 10px;
                left: 10px;
                right: 10px;
            }

            .toast {
                min-width: auto;
                width: 100%;
                box-sizing: border-box;
                padding: 16px;
                animation: slideInTop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
            }

            .toast-close {
                padding: 12px; /* Увеличенная зона для клика пальцем */
            }
        }
		
		/* ===== СВОРАЧИВАЕМЫЙ БЛОК ===== */
.collapsible-section {
  margin-bottom: 1.5rem;
  border: 1px solid #ece3d7;
  border-radius: 20px;
  background-color: #fffffffa;
  overflow: hidden;
  box-shadow: 0 8px 20px -8px rgba(41, 36, 30, 0.1);
}

.collapsible-header {
  padding: 1.2rem 1.8rem;
  background-color: #fbf7f2;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: 'Literata', serif;
  font-size: 1.2rem;
  font-weight: 600;
  color: #2e4045;
  transition: background-color 0.2s;
  border-bottom: 1px solid transparent;
}

.collapsible-header:hover {
  background-color: #f5eee6;
}

.collapsible-header i:first-child {
  color: #b85c4a;
  margin-right: 0.8rem;
  font-size: 1.2rem;
}

.collapsible-header .toggle-icon {
  color: #b3826a;
  transition: transform 0.3s;
  font-size: 1rem;
}

.collapsible-header.active .toggle-icon {
  transform: rotate(180deg);
}

.collapsible-content {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.4s ease-out, opacity 0.3s ease-out, padding 0.3s ease-out;
  padding: 0 1.8rem;
  background-color: #fffffffa;
}

.collapsible-content.active {
  max-height: 3000px; /* достаточно большое значение */
  opacity: 1;
  padding: 1.5rem 1.8rem;
}

/* Для вложенных элементов внутри контента */
.collapsible-content p {
  margin-bottom: 1rem;
  color: #3a4e53;
  line-height: 1.6;
}

.collapsible-content p:last-child {
  margin-bottom: 0;
}

/* Адаптивность */
@media (max-width: 600px) {
  .collapsible-header {
    padding: 1rem 1.2rem;
    font-size: 1.1rem;
  }
  
  .collapsible-content.active {
    padding: 1.2rem;
  }
}