/* css/pages.css - Стили для конкретных страниц */

/* ========== ХЕДЕР ========== */
.header {
  background-color: #ecd887;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 0;
}

.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: var(--dark);
  font-size: 1.5rem;
  font-weight: bold;
}

.logo img {
  height: 40px;
  margin-right: 10px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 25px;
}

.nav a {
  text-decoration: none;
  color: var(--dark);
  font-weight: 500;
}

.nav a:hover {
  color: var(--primary);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 8px 16px;
  background: var(--lighter);
  border-radius: var(--radius-md);
  border: 2px solid var(--light);
}

.user-avatar-small {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 14px;
}

/* ========== ФУТЕР ========== */
.footer {
  background-color: var(--dark);
  color: var(--white);
  padding: 60px 0 20px;
  margin-top: 80px;
}

.footer-inner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 40px;
  margin-bottom: 40px;
}

.footer-title {
  font-size: 1.2rem;
  margin-bottom: 20px;
}

.footer-links li,
.footer-contacts li {
  margin-bottom: 10px;
  list-style: none;
}

.footer-links a,
.footer-contacts a {
  color: #ccc;
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--primary);
}

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid #444;
  color: #ccc;
  font-size: 0.9rem;
}

/* ========== РЕГИСТРАЦИЯ/ВХОД ========== */
.auth-container,
.check-in-container {
  max-width: 900px;
  margin: 40px auto;
  padding: 40px 30px;
  background: #ddddf3;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.auth-title,
.check-in-title {
  font-size: 32px;
  font-weight: 700;
  color: var(--dark);
  text-align: center;
  margin-bottom: 8px;
}

.auth-subtitle,
.check-in-subtitle {
  font-size: 18px;
  color: var(--gray);
  text-align: center;
  margin-bottom: 48px;
}

/* Выбор роли */
.role-selection {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  margin-bottom: 40px;
}

.role-option {
  background: var(--white);
  border: 3px solid var(--light);
  border-radius: var(--radius-lg);
  padding: 35px 30px;
  text-align: center;
  transition: var(--transition);
  cursor: pointer;
}

.role-option:hover {
  transform: translateY(-5px);
  border-color: var(--gray-light);
  box-shadow: var(--shadow-lg);
}

.role-option[data-role="master"]:hover {
  border-color: var(--primary);
}

.role-option[data-role="client"]:hover {
  border-color: var(--secondary);
}

.role-icon {
  font-size: 64px;
  margin-bottom: 20px;
  display: block;
}

.role-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 15px;
}

.role-description {
  font-size: 16px;
  color: var(--gray);
  line-height: 1.6;
  margin-bottom: 25px;
}

.role-features {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 30px;
}

.role-features span {
  font-size: 15px;
  color: var(--gray-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.role-features span::before {
  content: "✓";
  color: var(--success);
  font-weight: bold;
  font-size: 18px;
}

.role-btn {
  padding: 18px 40px;
  border: none;
  border-radius: var(--radius-md);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  width: 100%;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.master-btn {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: var(--white);
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.3);
}

.master-btn:hover {
  background: linear-gradient(135deg, var(--primary-dark), #1e40af);
  box-shadow: 0 12px 25px rgba(59, 130, 246, 0.4);
  transform: translateY(-2px);
}

.client-btn {
  background: linear-gradient(135deg, var(--secondary), var(--secondary-dark));
  color: var(--white);
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.3);
}

.client-btn:hover {
  background: linear-gradient(135deg, var(--secondary-dark), #047857);
  box-shadow: 0 12px 25px rgba(16, 185, 129, 0.4);
  transform: translateY(-2px);
}

/* Бейдж выбранной роли */
.role-badge {
  padding: 12px 28px;
  border-radius: var(--radius-sm);
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.role-badge.master {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
}

.role-badge.client {
  background: linear-gradient(135deg, var(--secondary), var(--secondary-dark));
}

.role-badge::before {
  font-size: 24px;
}

.role-badge.master::before {
  content: "👨‍🔧";
}

.role-badge.client::before {
  content: "👨‍💼";
}

.selected-role-info {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 30px;
  padding: 20px;
  background: linear-gradient(135deg, var(--lighter), var(--light));
  border-radius: var(--radius-md);
}

.change-role-btn {
  background: var(--gray);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  padding: 12px 24px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.change-role-btn:hover {
  background: var(--gray-dark);
}

.check-in-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.form-actions {
  display: flex;
  gap: 20px;
}

.btn-submit {
  flex: 1;
  padding: 20px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: var(--white);
  border: none;
  border-radius: var(--radius-md);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.btn-submit:hover {
  background: linear-gradient(135deg, var(--primary-dark), #1e40af);
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(59, 130, 246, 0.3);
}

.btn-submit:disabled {
  background: var(--gray-light);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  animation: pulse 1.5s infinite;
}

.btn-reset {
  padding: 20px 32px;
  background: var(--light);
  color: var(--gray-dark);
  border: 2px solid var(--gray-light);
  border-radius: var(--radius-md);
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-reset:hover {
  background: var(--gray-light);
  border-color: var(--gray);
}

.check-in-links {
  text-align: center;
  margin-top: 30px;
  font-size: 16px;
  color: var(--gray);
}

.check-in-links a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 700;
}

.check-in-links a:hover {
  text-decoration: underline;
}

.forgot-link {
  color: #667eea;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.2s;
  display: inline-flex;
  align-items: center;
}

.forgot-link:hover {
  color: #5a67d8;
  text-decoration: underline;
}

/* ========== ЛИЧНЫЙ КАБИНЕТ ========== */
.personal-cabinet {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--lighter) 0%, var(--light) 100%);
  padding: 30px 20px;
}

.personal-container {
  max-width: 1200px;
  margin: 0 auto;
}

.cabinet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
  padding: 25px 30px;
  background: #ecd887;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--light);
}

.cabinet-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--dark);
  display: flex;
  align-items: center;
  gap: 12px;
}

.cabinet-title::before {
  content: "👤";
  font-size: 32px;
}

.cabinet-nav {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--light);
  color: var(--gray-dark);
  text-decoration: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  transition: var(--transition);
  border: 2px solid var(--gray-light);
}

.nav-link:hover {
  background: var(--gray-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.nav-link.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: var(--white);
  border-color: var(--primary);
}

.nav-link.logout {
  background: #fef2f2;
  color: var(--danger);
  border-color: #fecaca;
}

.nav-link.logout:hover {
  background: #fee2e2;
}

/* Основной контент кабинета */
.cabinet-content {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 30px;
  margin-bottom: 40px;
}

/* Боковая панель */
.sidebar {
  background: #ecd887;
  border-radius: var(--radius-lg);
  padding: 25px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--light);
  height: fit-content;
}

.user-card {
  text-align: center;
  padding-bottom: 25px;
  margin-bottom: 25px;
  border-bottom: 2px solid var(--light);
}

.user-avatar {
  width: 100px;
  height: 100px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  font-weight: 700;
  margin: 0 auto 20px;
  border: 4px solid var(--white);
  box-shadow: 0 8px 25px rgba(59, 130, 246, 0.3);
}

.user-name {
  font-size: 22px;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 8px;
}

.user-role {
  display: inline-block;
  padding: 6px 16px;
  background: linear-gradient(135deg, var(--secondary), var(--secondary-dark));
  color: var(--white);
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.user-role.master {
  background: linear-gradient(135deg, var(--warning), #d97706);
}

.master-rating {
  margin-top: 10px;
  font-size: 16px;
  color: var(--warning);
  font-weight: 600;
}

/* Меню кабинета */
.sidebar-menu {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 18px 20px;
  background: var(--lighter);
  border: 2px solid var(--light);
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 600;
  color: var(--gray-dark);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.menu-item:hover {
  background: var(--light);
  border-color: var(--gray-light);
  transform: translateX(5px);
}

.menu-item.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: var(--white);
  border-color: var(--primary);
}

.menu-item i {
  font-size: 20px;
  width: 24px;
  text-align: center;
}

/* Основная область кабинета */
.main-content {
  background: url(/frontend/img/addvert.jpg);
  border-radius: var(--radius-lg);
  padding: 35px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--light);
}

.welcome-banner {
  background: linear-gradient(135deg, #dbeafe, #d1fae5);
  border-radius: var(--radius-md);
  padding: 25px;
  margin-bottom: 35px;
  border: 2px solid var(--primary);
  animation: slideDown 0.5s ease-out;
}

.welcome-content h2 {
  color: var(--primary-dark);
  margin-bottom: 10px;
  font-size: 24px;
}

.welcome-content p {
  color: var(--gray-dark);
  margin-bottom: 15px;
  font-size: 16px;
}

.stats-row {
  display: flex;
  gap: 20px;
  margin-top: 20px;
}

/* Информация о профиле */
.profile-section {
  margin-bottom: 40px;
}

.section-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 25px;
  padding-bottom: 15px;
  border-bottom: 2px solid var(--light);
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title::before {
  font-size: 24px;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.info-card {
  background: var(--lighter);
  padding: 22px;
  border-radius: var(--radius-md);
  border: 2px solid var(--light);
  transition: var(--transition);
}

.info-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.info-label {
  display: block;
  font-size: 14px;
  color: var(--gray);
  margin-bottom: 8px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.info-value {
  font-size: 18px;
  color: var(--dark);
  font-weight: 600;
}

/* Действия */
.actions-section {
  margin-top: 40px;
}

.actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.action-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 30px 25px;
  text-align: center;
  border: 2px solid var(--light);
  transition: var(--transition);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.action-card:hover {
  transform: translateY(-8px);
  border-color: var(--primary);
  box-shadow: 0 15px 35px rgba(59, 130, 246, 0.15);
}

.action-icon {
  font-size: 48px;
  margin-bottom: 20px;
  display: block;
  height: 60px;
}

.action-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 12px;
}

.action-description {
  font-size: 14px;
  color: var(--gray);
  line-height: 1.5;
}

/* Заказы */
.orders-section {
  margin-top: 40px;
}

.orders-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.order-card {
  background: var(--lighter);
  border-radius: var(--radius-md);
  padding: 25px;
  border: 2px solid var(--light);
  transition: var(--transition);
}

.order-card:hover {
  border-color: var(--primary);
  transform: translateY(-3px);
}

.order-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.order-id {
  font-size: 14px;
  color: var(--gray);
  font-weight: 600;
}

.order-status {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-new {
  background: #dbeafe;
  color: var(--primary-dark);
}

.status-in-progress {
  background: #fef3c7;
  color: #d97706;
}

.status-completed {
  background: #d1fae5;
  color: #065f46;
}

.order-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 10px;
}

.order-date {
  font-size: 14px;
  color: var(--gray);
  margin-bottom: 15px;
}

/* Статистика */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.stat-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 25px;
  text-align: center;
  border: 2px solid var(--light);
  transition: var(--transition);
}

.stat-card:hover {
  border-color: var(--secondary);
  transform: translateY(-3px);
}

.stat-value {
  font-size: 36px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
}

.stat-label {
  font-size: 14px;
  color: var(--gray);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

/* Пустое состояние */
.empty-state {
  text-align: center;
  padding: 60px 30px;
}

.empty-icon {
  font-size: 64px;
  color: var(--gray-light);
  margin-bottom: 20px;
  opacity: 0.7;
}

.empty-state h3 {
  font-size: 22px;
  color: var(--gray-dark);
  margin-bottom: 15px;
}

.empty-state p {
  color: var(--gray-light);
  margin-bottom: 25px;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

.cabinet-footer {
  text-align: center;
  padding: 25px;
  color: var(--gray);
  font-size: 14px;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--light);
}

#postOrderModal {
  display: none;
  align-items: center;
  justify-content: center;
}

/* ========== АДАПТИВНОСТЬ (единые медиа-запросы) ========== */

/* 1024px */
@media (max-width: 1024px) {
  .cabinet-content {
    grid-template-columns: 1fr;
  }

  .sidebar {
    order: 2;
  }
}

/* 768px */
@media (max-width: 768px) {

  /* Общие для контейнеров */
  .auth-container,
  .check-in-container,
  .personal-container {
    padding: 20px;
    margin: 20px;
  }

  .auth-title,
  .check-in-title {
    font-size: 28px;
  }

  .auth-subtitle,
  .check-in-subtitle {
    font-size: 16px;
    margin-bottom: 30px;
  }

  /* Кабинет */
  .cabinet-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
  }

  .cabinet-nav {
    width: 100%;
    flex-wrap: wrap;
    justify-content: center;
  }

  .nav-link {
    flex: 1;
    min-width: 140px;
    justify-content: center;
  }

  .main-content {
    padding: 25px 20px;
  }

  /* Сетки */
  .info-grid,
  .actions-grid,
  .orders-grid,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  /* Шапка */
  .header-inner {
    flex-direction: column;
    padding: 15px 0;
    gap: 15px;
  }

  .logo {
    justify-content: center;
    width: 100%;
  }

  .nav {
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    width: 100%;
  }

  .nav a {
    flex: 1 1 calc(50% - 10px);
    min-width: 140px;
    text-align: center;
    padding: 10px 8px;
    background: var(--lighter);
    border-radius: var(--radius-md);
    border: 1px solid var(--light);
    font-size: 14px;
    white-space: nowrap;
    transition: background 0.2s;
  }

  .nav a:hover {
    background: var(--light);
  }
}

/* 600px */
@media (max-width: 600px) {

  /* Страница регистрации/входа */
  .check-in-container {
    padding: 25px 20px;
    margin: 20px auto;
    border-radius: 20px;
  }

  .check-in-title {
    font-size: 26px;
    margin-bottom: 8px;
  }

  .check-in-subtitle {
    font-size: 16px;
    margin-bottom: 25px;
  }

  .role-selection {
    gap: 15px;
    margin-bottom: 20px;
  }

  .role-option {
    padding: 20px 15px;
    border-width: 2px;
  }

  .role-icon {
    font-size: 48px;
    margin-bottom: 10px;
  }

  .role-title {
    font-size: 22px;
    margin-bottom: 8px;
  }

  .role-description {
    font-size: 14px;
    margin-bottom: 15px;
  }

  .role-features {
    gap: 8px;
    margin-bottom: 20px;
  }

  .role-features span {
    font-size: 13px;
    gap: 6px;
  }

  .role-btn {
    padding: 14px 20px;
    font-size: 16px;
    border-radius: 40px;
    width: 100%;
    max-width: 280px;
    margin: 0 auto;
  }

  /* Форма входа */
  .form-group label {
    font-size: 14px;
    margin-bottom: 6px;
  }

  .form-input,
  .phone-wrapper {
    font-size: 14px;
    padding: 12px 15px;
  }

  .phone-prefix {
    padding: 12px 12px;
    font-size: 14px;
  }

  .checkbox-group label {
    font-size: 14px;
  }

  .form-actions {
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
  }

  .btn-submit,
  .btn-reset {
    width: 100%;
    padding: 16px;
    font-size: 16px;
    border-radius: 40px;
  }

  .forgot-link {
    font-size: 14px;
    justify-content: center;
    display: flex;
  }

  /* Очень маленькие экраны (вложенный запрос) */
  @media (max-width: 380px) {
    .check-in-title {
      font-size: 24px;
    }

    .role-icon {
      font-size: 40px;
    }

    .role-title {
      font-size: 20px;
    }

    .role-features span {
      font-size: 12px;
    }

    .role-btn {
      font-size: 14px;
      padding: 12px 16px;
    }
  }
}

/* 480px */
@media (max-width: 480px) {

  /* Личный кабинет */
  .personal-cabinet {
    padding: 20px 15px;
  }

  .user-avatar {
    width: 80px;
    height: 80px;
    font-size: 28px;
  }

  .menu-item {
    padding: 15px;
  }

  /* Шапка */
  .nav a {
    flex: 1 1 100%;
  }
}