/* Styles extracted from login.html */

/* =========================
   Global fixes (mobile-safe)
   ========================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background-image: url('/images/shop-bg.jpg');
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  background-attachment: fixed;

  min-height: 100vh;
  padding: 30px 20px 20px; /* Отступ сверху увеличен */

  color: #ffffff;
}

/* Prevent horizontal overflow on small screens */
html, body { width: 100%; overflow-x: hidden; }

img { max-width: 100%; height: auto; display: block; }
main, section, header, footer { min-width: 0; }
.container {
    max-width: 1200px;
    margin: 0 auto;
    min-width: 0;
    padding-left: 16px;
    padding-right: 16px;
}

button, a, input, select { -webkit-tap-highlight-color: transparent; }
button { touch-action: manipulation; }


/* =========================
   Header
   ========================= */
.header {
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
  border-radius: 6px;
  padding: 6px 8px;
  margin-bottom: 16px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  border: 1px solid rgba(255, 68, 68, 0.3);
}

.header-left {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-width: 0;
}

.profile-icon-img {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  object-fit: cover;
  border: 2px solid #ff4444;
  box-shadow: 0 0 10px rgba(255, 68, 68, 0.5);
  background: #1a1a1a;
  transition: transform 0.2s ease;
  flex: 0 0 auto;
}

.profile-icon-img:hover { transform: scale(1.05); }

.logo {
  font-size: 18px;
  font-weight: bold;
  color: #ff4444;
  text-shadow: 0 0 10px rgba(255, 68, 68, 0.5);
  white-space: nowrap;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
  min-width: 0;
}

.points-display {
  background: linear-gradient(135deg, #ff4444 0%, #cc0000 100%);
  color: white;
  padding: 6px 12px;
  border-radius: 12px;
  font-weight: bold;
  box-shadow: 0 2px 6px rgba(255, 68, 68, 0.3);
  white-space: nowrap;
}

.logout-btn {
  background: transparent;
  color: #ff4444;
  border: 1px solid #ff4444;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.3s ease;
  line-height: 1;
  flex: 0 0 auto;
}

.logout-btn:hover {
  background: rgba(255, 68, 68, 0.1);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(255, 68, 68, 0.3);
}


/* =========================
   Auth Card
   ========================= */
.auth-card {
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(12px);
  border-radius: 28px;
  padding: 20px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 68, 68, 0.45);
  max-width: 500px;
  margin: 0 auto;
  animation: slideUp 0.5s ease;
  position: relative;
  overflow: hidden;
}

.auth-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('https://molpatrul.ru/images/af9085d6-bd1a-4c32-b7e4-49d6bf57191d.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.2;
  pointer-events: none;
  z-index: 0;
  border-radius: 28px;
}

.auth-card > * {
  position: relative;
  z-index: 2;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.auth-title {
  text-align: center;
  color: #ff4444;
  margin-bottom: 16px;
  font-size: 18px;
  font-weight: 700;
  text-shadow: 0 0 10px rgba(255, 68, 68, 0.5);
  letter-spacing: -0.3px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  color: #ffbbbb;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group label .required {
  color: #ff4444;
  margin-left: 4px;
}

.form-group input,
.form-group select {
  padding: 12px 15px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 68, 68, 0.5);
  border-radius: 14px;
  font-size: 16px;
  transition: all 0.3s ease;
  width: 100%;
  color: #ffffff;
  cursor: pointer;
  backdrop-filter: blur(4px);
  min-width: 0;
  height: 52px;
}

.form-group select option {
  background: #1a1a1a;
  color: #ffffff;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #ff4444;
  box-shadow: 0 0 0 3px rgba(255, 68, 68, 0.2);
  background: rgba(0, 0, 0, 0.8);
}

.form-group input.error,
.form-group select.error { border-color: #ff4444; }

.password-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-input-wrapper input { padding-right: 45px; }

.password-toggle {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 20px;
  padding: 5px;
  color: #ff8888;
  transition: color 0.3s ease;
  line-height: 1;
}

.password-toggle:hover { color: #ff4444; }

.btn {
  padding: 14px 20px;
  border: none;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  min-height: 44px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* ВАШ СТИЛЬ КНОПОК ВОЗВРАЩЕН */
.btn-primary {
  background: transparent;
  color: #ff4444;
  border: 1px solid #ff4444;
  box-shadow: inset 0 0 0 rgba(255, 68, 68, 0.3), 0 4px 12px rgba(255, 68, 68, 0.3);
}

.btn-primary:hover:not(:disabled) {
  background: rgba(255, 68, 68, 0.08);
  transform: translateY(-2px);
  box-shadow: inset 0 0 0 rgba(255, 68, 68, 0.3), 0 10px 25px rgba(255, 68, 68, 0.4);
}

.btn-primary:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}


/* =========================
   Profile Card + Fix for "rounded-stremny menu"
   ========================= */
.profile-card {
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 68, 68, 0.3);
}

.profile-title {
  font-size: 18px;
  color: #ff4444;
  margin-bottom: 12px;
  border-bottom: 2px solid #ff4444;
  padding-bottom: 6px;
}

.profile-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 8px;
}

.info-item {
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.05);
  border-left: 4px solid #ff4444;
  border-radius: 0;
  width: 100%;
  border: 1px solid rgba(255, 68, 68, 0.35);
  box-shadow: none;
  min-width: 0;
}

.info-label {
  font-size: 12px;
  color: #ff8888;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.info-value {
  font-size: 18px;
  font-weight: bold;
  color: #ffffff;
}

.points-badge {
  background: linear-gradient(135deg, #ff4444 0%, #cc0000 100%);
  color: white;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 14px;
  display: inline-block;
  margin-left: 8px;
  white-space: nowrap;
}


/* =========================
   Events section
   ========================= */
.events-section {
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(12px);
  border-radius: 14px;
  padding: 18px 16px 18px;
  margin-top: 25px;
  border: 1px solid rgba(255, 68, 68, 0.4);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.5);
  transition: all 0.3s ease;
}

.section-title {
  font-size: 18px;
  font-weight: 700;
  color: #ff5555;
  margin-bottom: 20px;
  padding-left: 10px;
  border-left: 5px solid #ff4444;
  letter-spacing: -0.3px;
}

.events-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.event-card-modern {
  background: linear-gradient(145deg, rgba(20, 20, 30, 0.9) 0%, rgba(10, 10, 18, 0.85) 100%);
  border-radius: 12px;
  padding: 0;
  transition: all 0.35s cubic-bezier(0.2, 0.9, 0.4, 1.1);
  border: 1px solid rgba(255, 80, 80, 0.35);
  overflow: hidden;
  backdrop-filter: blur(4px);
  box-shadow: 0 8px 12px rgba(0, 0, 0, 0.4);
}

.event-card-modern:hover {
  transform: translateY(-6px) scale(1.01);
  border-color: rgba(255, 68, 68, 0.8);
  box-shadow: 0 20px 30px -10px rgba(255, 68, 68, 0.3);
  background: linear-gradient(145deg, rgba(35, 30, 45, 0.95) 0%, rgba(20, 18, 28, 0.9) 100%);
}

.event-header {
  padding: 18px 20px 12px;
  border-bottom: 1px dashed rgba(255, 100, 100, 0.4);
  background: rgba(0, 0, 0, 0.3);
}

.event-name {
  font-size: 1.35rem;
  font-weight: 800;
  color: #ff9f9f;
  letter-spacing: -0.2px;
}

.event-body { padding: 8px 12px 12px; }

.event-datetime {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  color: #e0e0e0;
  background: rgba(255, 255, 255, 0.05);
  padding: 10px 14px;
  border-radius: 10px;
  width: fit-content;
  margin-bottom: 0;
  backdrop-filter: blur(4px);
}

.event-date-text {
  font-weight: 600;
  font-family: monospace;
  letter-spacing: 0.3px;
}

.empty-state-events {
  text-align: center;
  padding: 28px 14px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 16px;
  color: #cccccc;
  font-size: 1.1rem;
  backdrop-filter: blur(8px);
  border: 1px dashed rgba(255, 100, 100, 0.5);
}

.error-message {
  margin-top: 20px;
  padding: 12px;
  background-color: rgba(255, 68, 68, 0.1);
  border: 1px solid #ff4444;
  border-radius: 10px;
  color: #ff8888;
  font-size: 14px;
  text-align: center;
}

.loading { position: relative; pointer-events: none; }

.loading::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  top: 50%;
  left: 50%;
  margin-left: -10px;
  margin-top: -10px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid #ff4444;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.message {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 15px 20px;
  border-radius: 10px;
  color: white;
  font-size: 14px;
  z-index: 1000;
  animation: slideInRight 0.3s ease;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(10px);
  border: 1px solid #ff4444;
  max-width: calc(100vw - 40px);
}

.message.success { border-color: #4caf50; color: #4caf50; }
.message.error { border-color: #ff4444; color: #ff8888; }

.nav-links {
  display: flex;
  gap: 8px;
  justify-content: flex-start;
}

.nav-links a {
  color: #ff4444;
  text-decoration: none;
  font-weight: 600;
  font-size: 12px;
  padding: 6px 8px;
  border-radius: 10px;
  transition: all 0.3s ease;
  background: transparent;
  border: 1px solid #ff4444;
  white-space: nowrap;
}

.nav-links a:hover {
  background: rgba(255, 68, 68, 0.1);
  transform: translateY(-2px);
}

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}


/* =========================
   Mobile overrides (main part)
   ========================= */
@media (max-width: 768px) {
  body { padding: 12px; }
  .container { padding-left: 12px; padding-right: 12px; max-width: 100%; width: 100%; }

  .header {
    padding: 10px 10px;
    border-radius: 14px;
    gap: 6px;
  }

  .header-left { gap: 6px; min-width: 0; }
  .logo { font-size: 16px; flex: 0 0 auto; }
  .user-info { gap: 6px; flex: 0 0 auto; min-width: 0; }

  .points-display {
    padding: 4px 8px;
    border-radius: 16px;
    font-size: 11px;
  }

  .logout-btn {
    font-size: 11px;
    padding: 8px 10px;
  }

  .profile-icon-img { width: 20px; height: 20px; border-radius: 5px; }

  .nav-links {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex: 1 1 auto;
    justify-content: flex-start;
    min-width: 0;
  }
  .nav-links::-webkit-scrollbar { display: none; }

  .nav-links a {
    padding: 6px 8px;
    font-size: 10px;
    border-radius: 10px;
    white-space: nowrap;
    flex: 0 0 auto;
  }

  .profile-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .info-item {
    border-radius: 0;
    padding: 12px 14px;
    border-left-width: 5px;
  }

  .info-value { font-size: 20px; }
  .info-label { font-size: 12px; }

  .events-grid { grid-template-columns: 1fr; gap: 10px; }
  .events-section { padding: 12px; margin-top: 18px; }
  .section-title { font-size: 18px; margin-bottom: 14px; }

  .auth-card {
    padding: 24px 16px;
    max-width: 95%;
    border-radius: 24px;
  }
  .auth-card::before { border-radius: 24px; }

  .auth-title { font-size: 18px; margin-bottom: 12px; }

  .event-name { font-size: 1.15rem; }
  .event-body { padding: 10px 12px 12px; }

  .event-datetime {
    font-size: 0.92rem;
    padding: 10px 12px;
    width: 100%;
    justify-content: flex-start;
  }

  .message {
    top: 12px;
    right: 12px;
    left: 12px;
    max-width: calc(100vw - 24px);
    font-size: 13px;
  }
}

/* Планшеты / Широкие экраны (16:9) */
@media (min-width: 768px) and (max-width: 1024px) {
    .container { padding-left: 24px; padding-right: 24px; }

    .header { padding: 10px 20px; gap: 12px; }
    .logo { font-size: 18px; }
    .nav-links a { font-size: 12px; padding: 8px 10px; }

    .auth-card { max-width: 600px; padding: 28px; }
    .auth-title { font-size: 20px; margin-bottom: 18px; }
    .form-group input, .form-group select { font-size: 17px; height: 56px; }
    .btn { font-size: 17px; padding: 16px 22px; }

    .profile-card { padding: 20px; }
    .profile-title { font-size: 20px; }
    .info-item { padding: 16px; }
    .info-value { font-size: 22px; }

    .events-section { padding: 20px; }
    .section-title { font-size: 20px; margin-bottom: 18px; }
    .event-name { font-size: 1.5rem; }
}
