/* Общие */
body {
  margin: 0;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  font-family: 'Segoe UI', system-ui, sans-serif;
  min-height: 100vh;
}

/* Стеклянное меню */
.glass-nav {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  padding: 10px 0;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.navbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Логотип (увеличен, с отступом) */
.logo {
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: 40px;
}
.logo-icon {
  font-size: 1.8rem;
}
.logo-text {
  background: linear-gradient(135deg, #6e45e2, #88d3ce);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-size: 2.0rem;
  font-weight: 700;
}

/* Навигационные ссылки + кнопки */
.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.nav-link {
  text-decoration: none;
  color: #333;
  font-weight: 500;
  font-size: 0.85rem;
  transition: color 0.2s;
  padding: 4px 8px;
}
.nav-link:hover {
  color: #6e45e2;
}

/* Кнопки Войти/Контакты (перенесены в конец строки) */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-left: auto; /* прижимает к правому краю */
}

.btn-login, .btn-contacts {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: #333;
  font-size: 12px;
  line-height: 1.2;
}
.btn-login .login-icon, .btn-contacts .contact-icon {
  margin-bottom: 2px;
}
.btn-login:hover, .btn-contacts:hover {
  color: #6e45e2;
}

/* Строка поиска + геолокация */
.search-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.geo-location {
  flex-shrink: 0;
}

.geo-btn {
  background: rgba(255,255,255,0.3);
  border: none;
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  color: #333;
  display: flex;
  align-items: center;
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
}
.geo-btn span {
  margin-left: 6px;
}
.geo-btn:hover {
  background: rgba(255,255,255,0.5);
}

.search-box {
  flex: 1;
  display: flex;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255,255,255,0.7);
  border: 1px solid rgba(0,0,0,0.4);
}
.search-input {
  flex: 1;
  border: none;
  padding: 10px 16px;
  background: transparent;
  outline: none;
  font-size: 0.9rem;
}
.search-btn {
  background: transparent;
  border: none;
  padding: 0 16px;
  cursor: pointer;
display: flex;
  align-items: center;
  justify-content: center;
  color: #333;          /* цвет обводки, можно изменить */
  transition: color 0.2s;
}
.search-btn:hover {
  color: #6e45e2;       /* при наведении – мягкий акцент */
}
.search-btn svg {
  pointer-events: none;
}

/* Герой-секция и карточки (без изменений) */
.hero-section {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 70vh;
  position: relative;
}
.hero-section::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="rgba(255,255,255,0.1)" d="M0,64L48,80C96,96,192,128,288,128C384,128,480,96,576,85.3C672,75,768,85,864,112C960,139,1056,181,1152,186.7C1248,192,1344,160,1392,144L1440,128L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>') no-repeat bottom;
  background-size: cover;
}
.glass-card {
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.05);
}
.project-card {
  transition: transform 0.3s;
  overflow: hidden;
}
.project-card:hover {
  transform: translateY(-5px);
}
.project-card img {
  height: 200px;
  object-fit: cover;
}
/* Страница входа */
.login-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 80vh;
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 420px;
  padding: 40px 30px;
  text-align: center;
}

.login-title {
  margin-bottom: 30px;
  font-size: 1.6rem;
  font-weight: 600;
  color: #333;
}

.social-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 25px;
}

.social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.1);
  background: rgba(255,255,255,0.3);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  font-size: 0.95rem;
  font-weight: 500;
  color: #333;
  cursor: pointer;
  transition: all 0.2s;
}
.social-btn:hover {
  background: rgba(255,255,255,0.5);
  border-color: rgba(0,0,0,0.2);
  transform: translateY(-1px);
}

.social-icon {
  display: flex;
  align-items: center;
}

.yandex:hover { border-color: #fc3f1d; color: #fc3f1d; }
.google:hover { border-color: #4285f4; color: #4285f4; }
.apple:hover { border-color: #000; color: #000; }

.divider {
  display: flex;
  align-items: center;
  margin: 25px 0;
  color: #888;
  font-size: 0.85rem;
}
.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(0,0,0,0.15);
}
.divider span {
  margin: 0 15px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 20px;
}

.input-group {
  text-align: left;
}

.login-input {
  width: 100%;
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,0.15);
  background: rgba(255,255,255,0.25);
  backdrop-filter: blur(4px);
  font-size: 0.95rem;
  outline: none;
  transition: border 0.2s;
}
.login-input:focus {
  border-color: #6e45e2;
}

.btn-login-submit {
  padding: 12px 24px;
  border-radius: 12px;
  border: none;
  background: #6e45e2;
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-login-submit:hover {
  background: #5b36c5;
}
.btn-login-submit:disabled {
  background: #ccc;
  cursor: not-allowed;
}

.captcha-placeholder {
  margin: 20px 0;
  display: flex;
  justify-content: center;
}

.recaptcha-box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: #f9f9f9;
  border: 1px solid #d3d3d3;
  border-radius: 4px;
  font-size: 0.9rem;
  color: #555;
}
.recaptcha-checkbox {
  width: 24px;
  height: 24px;
  border: 2px solid #c1c1c1;
  border-radius: 2px;
  background: white;
}

.register-link {
  margin-top: 15px;
  font-size: 0.9rem;
  color: #555;
}
.register-link a {
  color: #6e45e2;
  text-decoration: none;
  font-weight: 500;
}
.register-link a:hover {
  text-decoration: underline;
}
/* Стили для ошибок Devise */
.alert {
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 20px;
  font-size: 0.9rem;
}
.alert-danger {
  background: rgba(255,0,0,0.1);
  border: 1px solid rgba(255,0,0,0.2);
  color: #a00;
}
.alert-info {
  background: rgba(0,0,255,0.1);
  border: 1px solid rgba(0,0,255,0.2);
  color: #006;
}
.remember-me {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: #333;
}
.radio-group {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-bottom: 15px;
  font-size: 0.95rem;
}
.radio-group span {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.login-input select,
.login-input.select {
  width: 100%;
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,0.15);
  background: rgba(255,255,255,0.25);
  backdrop-filter: blur(4px);
  font-size: 0.95rem;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 1em;
}
.form-label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  color: #333;
}
/* Личный кабинет клиента */
.client-header {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255,255,255,0.3);
  padding: 12px 20px;
  gap: 20px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.client-header-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 120px;
}

.user-info {
  flex: 2;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  min-width: 200px;
}

.user-avatar {
  font-size: 1.8rem;
}

.user-name {
  font-weight: 600;
  font-size: 1rem;
  color: #333;
}

.cell-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  color: #666;
  letter-spacing: 0.5px;
}

.cell-value {
  font-size: 0.9rem;
  color: #333;
  font-weight: 500;
}

.logout-cell {
  margin-left: auto;
}

.btn-logout {
  display: flex;
  align-items: center;
  gap: 5px;
  text-decoration: none;
  color: #333;
  font-size: 0.85rem;
  border: 1px solid rgba(0,0,0,0.2);
  padding: 4px 12px;
  border-radius: 8px;
  background: rgba(255,255,255,0.3);
  transition: background 0.2s;
}
.btn-logout:hover {
  background: rgba(255,255,255,0.5);
}

/* Основной макет: sidebar + контент */
.client-layout {
  display: flex;
  height: calc(100vh - 62px); /* минус высота хедера (примерно 62px) */
}

.client-sidebar {
  width: 220px;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-right: 1px solid rgba(255,255,255,0.25);
  padding: 20px 0;
  overflow-y: auto;
  flex-shrink: 0;
}

.sidebar-menu {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-item {
  padding: 0;
}

.sidebar-item a {
  display: block;
  padding: 12px 20px;
  text-decoration: none;
  color: #333;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.2s, border-left 0.2s;
  border-left: 3px solid transparent;
}

.sidebar-item a:hover,
.sidebar-item.active a {
  background: rgba(255,255,255,0.3);
  border-left-color: #6e45e2;
}

/* Контентная область */
.client-content {
  flex: 1;
  padding: 30px;
  overflow-y: auto;
  background: rgba(255,255,255,0.1);
}
/* Модальное окно настроек */
.profile-modal {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 30px;
  z-index: 1000;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  width: 90%;
  max-width: 400px;
}
.profile-modal.active {
  display: block;
}
.modal-backdrop {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4);
  z-index: 999;
}
.modal-backdrop.active {
  display: block;
}
.profile-modal h3 {
  margin-top: 0;
}
.profile-modal .input-group {
  margin-bottom: 15px;
}
.toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}
.role-switcher {
  display: flex;
  align-items: center;
  gap: 5px;
}
.role-switcher select {
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid rgba(0,0,0,0.2);
  background: rgba(255,255,255,0.3);
  backdrop-filter: blur(4px);
  font-size: 0.8rem;
}
.code-area {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.9rem;
  line-height: 1.5;
  background: rgba(255,255,255,0.5);
  resize: vertical; /* можно растягивать только по вертикали */
  min-height: 120px;
}
/* Сетка участков */
.plots-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  margin-top: 15px;
}
.plot-card {
  background: rgba(255,255,255,0.4);
  backdrop-filter: blur(8px);
  border-radius: 12px;
  padding: 15px;
  border: 1px solid rgba(0,0,0,0.08);
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.plot-card:hover {
  background: rgba(255,255,255,0.8);
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}
.plot-card-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.plot-card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 5px;
  margin-top: 10px;
}
/* Переопределяем фон */
body {
  background: #ffffff !important;
}

/* Верхняя строка и sidebar светло-серые */
.client-header,
.client-sidebar {
  background: #f5f5f5 !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-color: #e0e0e0 !important;
}
.client-sidebar {
  border-right: 1px solid #e0e0e0;
}
.client-header {
  border-bottom: 1px solid #e0e0e0;
}
/* Квадратные кнопки-карточки для разделов */
.btn-project-card {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 180px;
  height: 180px;
  margin: 10px;
  background: rgba(255,255,255,0.4);
  backdrop-filter: blur(8px);
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.08);
  text-decoration: none;
  color: #333;
  font-weight: 600;
  font-size: 1rem;
  text-align: center;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
.btn-project-card:hover {
  background: rgba(255,255,255,0.8);
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.1);
  color: #6e45e2;
}
.btn-admin-link {
  display: inline-block;
  padding: 4px 12px;
  background: #6e45e2;
  color: #fff;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: bold;
}
.btn-admin-link:hover {
  background: #5b36c5;
  color: #fff;
}
