* { 
  margin: 0; 
  padding: 0; 
  box-sizing: border-box; 
}
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, black, red);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  color: white;
}
.auth-container {
  width: 100%;
  max-width: 400px;
  background: #0a0a0a;
  border-radius: 12px;
  box-shadow: 0 0 20px rgba(255, 0, 0, 0.4);
  overflow: hidden;
  border: 1px solid #333;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.8s forwards 0.3s ease-out;
}


.tabs {
  display: flex;
}
.tab-btn {
  flex: 1;
  padding: 16px;
  text-align: center;
  font-weight: 700;
  cursor: pointer;
  background: #111;
  border: none;
  color: #aaa;
  text-decoration: none;
}
.tab-btn.active {
  background: red;
  color: white;
}

.form-container {
  padding: 30px;
}
.form-group {
  margin-bottom: 18px;
  position: relative;
}
.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  color: #ddd;
}
.form-group input {
  width: 100%;
  padding: 12px 40px 12px 12px;
  border: 1px solid #444;
  border-radius: 6px;
  font-size: 16px;
  background: #111;
  color: white;
}
.form-group input[type="date"] {
  padding: 12px 12px; 
}
.form-group input:focus {
  outline: none;
  border-color: red;
  box-shadow: 0 0 6px red;
}

.toggle-password {
  position: absolute;
  right: 12px;
  top: 42px;
  cursor: pointer;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.messages {
  margin-bottom: 20px;
}
.messages li {
  background: #ff3333;
  color: white;
  padding: 10px;
  border-radius: 4px;
  list-style: none;
}
.btn {
  width: 100%;
  padding: 12px;
  background: red;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}
.btn:hover {
  background: darkred;
}

/* Profile */

.body_profile {
      font-family: 'Segoe UI', system-ui, sans-serif;
      background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
      display: flex;
      justify-content: center;
      align-items: center;
      padding: 20px;
      color: #333;
    }

    .profile-card {
      background: white;
      border-radius: 20px;
      box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
      width: 100%;
      max-width: 650px; /* Увеличена максимальная ширина */
      overflow: hidden;
    }

    .cover {
      height: 80px;
      background: linear-gradient(90deg, #000000, #222222);
    }

    .info {
      padding: 30px 40px 30px; /* Увеличены боковые отступы */
      text-align: center;
    }

    .avatar {
      width: 120px;
      height: 120px;
      border: 4px solid white;
      border-radius: 50%;
      background: url('https://via.placeholder.com/120') center / cover no-repeat;
      margin: -60px auto 20px;
      box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    }

    .name {
      font-size: 28px; /* Немного увеличен шрифт */
      font-weight: 700;
      margin-bottom: 8px;
      color: #222;
    }

    .username {
      font-size: 18px;
      color: #666;
      margin-bottom: 20px;
    }

    .bio {
      color: #555;
      line-height: 1.6;
      margin-bottom: 24px;
      font-size: 16px;
      padding: 0 20px; /* Добавлены отступы для лучшего чтения */
    }

    .stats {
      display: flex;
      justify-content: center;
      gap: 40px; /* Увеличен промежуток между элементами */
      margin-bottom: 24px;
      flex-wrap: wrap; /* Адаптация на маленьких экранах */
    }

    .stat-item {
      text-align: center;
      min-width: 100px; /* Минимальная ширина для элементов */
    }

    .stat-value {
      font-size: 20px; /* Увеличен размер цифр */
      font-weight: 700;
      color: #e53935;
    }

    .stat-label {
      font-size: 14px;
      color: #888;
    }

    .details {
      background: #fafafa;
      padding: 25px; /* Увеличены отступы внутри блока */
      border-radius: 16px;
      text-align: left;
      margin-bottom: 24px;
    }

    .detail-row {
      display: flex;
      margin-bottom: 14px;
      gap: 15px; /* Пространство между колонками */
    }

    .detail-label {
      font-weight: 600;
      color: #555;
      flex: 0 0 140px; /* Фиксированная ширина для лейблов */
    }

    .detail-value {
      color: #333;
      flex: 1; /* Занимает оставшееся пространство */
    }

    .btn {
      display: block;
      width: 100%;
      padding: 16px; /* Увеличена высота кнопки */
      background: #e53935;
      color: white;
      border: none;
      border-radius: 12px;
      font-weight: 600;
      font-size: 17px;
      cursor: pointer;
      transition: background 0.2s;
    }

    .btn:hover {
      background: #d32f2f;
    }

    /* Адаптивность для мобильных устройств */
    @media (max-width: 480px) {
      .profile-card {
        max-width: 100%;
        margin: 0 10px;
      }
      
      .info {
        padding: 30px 20px 30px;
      }
      
      .stats {
        gap: 20px;
      }
      
      .detail-label {
        flex: 0 0 110px;
      }
    }






      .password-reset-link {
      display: inline-block;
      color: #aaa;
      text-decoration: none;
      font-size: 14px;
      font-weight: 500;
      padding: 8px 16px;
      border: 1px solid transparent;
      border-radius: 6px;
      transition: all 0.3s ease;
    }

    .password-reset-link:hover {
      color: white;
      background: linear-gradient(135deg, black, red);
      border-color: red;
      transform: scale(1.05);
      box-shadow: 0 0 10px rgba(255, 0, 0, 0.4);
    }

    .form-group label {
      display: block;
      margin-bottom: 6px;
      font-weight: 600;
      color: #ddd;
    }

    .form-group input {
      width: 100%;
      padding: 12px 40px 12px 12px;
      border: 1px solid #444;
      border-radius: 6px;
      font-size: 16px;
      background: #111;
      color: white;
    }

    .error {
      color: red;
      font-size: 14px;
      margin-top: 5px;
    }


    /* Анимация появления */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Анимация заголовка */
h2 {
  animation: fadeInDown 0.6s forwards 0.5s ease-out;
  opacity: 0;
  transform: translateY(-10px);
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Анимация табов */
.tabs {
  display: flex;
  animation: slideInLeft 0.6s forwards 0.4s ease-out;
  opacity: 0;
  transform: translateX(-10px);
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Анимация формы */
.form-container {
  padding: 30px;
  animation: fadeIn 0.8s forwards 0.6s ease-out;
  opacity: 0;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Анимация кнопки */
.btn {
  animation: pulse 2s infinite 1.5s;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 0, 0, 0.4);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(255, 0, 0, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 0, 0, 0);
  }
}












/* === Регистрация с подсказками === */
.register-with-hints {
    max-width: 700px;
    margin: 40px auto;
}

.form-fields-wrapper {
    position: relative;
}

.form-fields-wrapper p {
    position: relative;
    margin-bottom: 20px;
}

.form-fields-wrapper label {
    display: block;
    color: #e2e8f0;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-fields-wrapper input {
    width: 100%;
    padding: 14px 45px 14px 20px;
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 12px;
    color: white;
    font-size: 16px;
    transition: all 0.3s ease;
}

.form-fields-wrapper input:focus {
    outline: none;
    border-color: #ff6b6b;
    background: rgba(30, 41, 59, 0.8);
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.2);
}

.hint-icon {
    position: absolute;
    right: 15px;
    top: 38px;
    color: #ff6b6b;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.hint-icon:hover {
    transform: scale(1.2);
}

.tooltip-popup {
    position: absolute;
    right: 40px;
    top: 0;
    background: rgba(15, 23, 42, 0.95);
    color: #e2e8f0;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    max-width: 280px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 107, 107, 0.3);
    z-index: 100;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateX(10px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Информационные блоки */
.info-block {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 107, 107, 0.2);
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.info-block:hover {
    border-color: rgba(255, 107, 107, 0.5);
    background: rgba(255, 255, 255, 0.08);
}

.info-block-header {
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    color: #e2e8f0;
    font-weight: 600;
    transition: all 0.3s ease;
}

.info-block-header:hover {
    background: rgba(255, 107, 107, 0.1);
}

.info-block-header i:first-child {
    font-size: 1.2rem;
}

.toggle-icon {
    margin-left: auto;
    transition: transform 0.3s ease;
}

.toggle-icon.rotated {
    transform: rotate(180deg);
}

.info-block-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
    background: rgba(0, 0, 0, 0.2);
}

.info-block-content.active {
    max-height: 300px;
}

.info-block-content p {
    padding: 15px 20px 5px;
    color: #94a3b8;
    margin: 0;
}

.info-block-content ul {
    padding: 5px 20px 15px 40px;
    color: #cbd5e1;
    margin: 0;
}

.info-block-content li {
    margin-bottom: 8px;
    line-height: 1.5;
}

.bonus-hint {
    background: rgba(255, 209, 102, 0.1);
    border: 1px solid rgba(255, 209, 102, 0.3);
    padding: 10px 15px;
    margin: 10px 20px 15px;
    border-radius: 8px;
    color: #ffd166;
    font-size: 14px;
}

/* Энергия блок */
.energy-block .info-block-header i:first-child {
    color: #ffd166;
}

/* Рейтинг блок */
.rating-block .info-block-header i:first-child {
    color: #ff6b6b;
}

/* Подписки блок */
.follow-block .info-block-header i:first-child {
    color: #4ecdc4;
}

/* Модальное окно приветствия */
.modal-overlay {
    display: none;
    position: fixed;
    top: -60px !important;
    left: 0;
    width: 100%;
    height: calc(100% + 60px) !important;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10001 !important;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.95) !important;
}

.modal-overlay.active {
    display: flex;
}

.modal-content-welcome {
    background: linear-gradient(135deg, #1e1e2e, #2a2a3e);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    max-width: 400px;
    border: 2px solid rgba(255, 107, 107, 0.5);
    animation: zoomIn 0.4s ease;
}

.welcome-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    animation: bounce 1s infinite;
}

.modal-content-welcome h2 {
    color: #ff6b6b;
    margin-bottom: 15px;
}

.modal-content-welcome p {
    color: #cbd5e1;
    margin-bottom: 25px;
    line-height: 1.6;
}

.btn-close-modal {
    background: linear-gradient(90deg, #ff6b6b, #fb7185);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-close-modal:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
}

@keyframes zoomIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.login-link {
    text-align: center;
    margin-top: 20px;
    color: #94a3b8;
}

.login-link a {
    color: #ff6b6b;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.login-link a:hover {
    color: #ff9a8b;
    text-decoration: underline;
}

/* Скрываем help_text от Django форм */
.form-fields-wrapper .helptext {
    display: none;
}


/* Посты блок */
.posts-block .info-block-header i:first-child {
    color: #95e1d3;
}

.posts-block .bonus-hint {
    background: rgba(78, 205, 196, 0.1);
    border: 1px solid rgba(78, 205, 196, 0.3);
    padding: 10px 15px;
    margin: 10px 20px 15px;
    border-radius: 8px;
    color: #4ecdc4;
    font-size: 14px;
}


/* === Индикатор доступности никнейма === */
.username-status {
    margin-top: 8px;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(-10px);
    display: none; /* Скрыт по умолчанию */
}

.username-status.status-success {
    display: block; /* Показываем при успехе */
    background: rgba(76, 175, 80, 0.2);
    color: #4CAF50;
    border: 1px solid rgba(76, 175, 80, 0.5);
    opacity: 1;
    transform: translateY(0);
}

.username-status.status-error {
    display: block; /* Показываем при ошибке */
    background: rgba(244, 67, 54, 0.2);
    color: #f44336;
    border: 1px solid rgba(244, 67, 54, 0.5);
    opacity: 1;
    transform: translateY(0);
}

.username-status.status-warning {
    display: block; /* Показываем при предупреждении */
    background: rgba(255, 152, 0, 0.2);
    color: #ff9800;
    border: 1px solid rgba(255, 152, 0, 0.5);
    opacity: 1;
    transform: translateY(0);
}

/* Блокировка кнопки отправки */
.btn:disabled {
    background: #666;
    cursor: not-allowed;
    opacity: 0.6;
}



/* =====================================================
   📱 АДАПТИВНАЯ ВЁРСТКА ДЛЯ МОБИЛЬНЫХ УСТРОЙСТВ
   ===================================================== */

/* Планшеты и небольшие экраны (до 768px) */
@media (max-width: 768px) {
  /* === Auth Container === */
  .auth-container {
    max-width: 95vw;
    margin: 10px;
    border-radius: 16px;
  }
  
  .form-container {
    padding: 20px 25px;
  }
  
  .form-group input {
    padding: 14px 40px 14px 14px;
    font-size: 15px;
  }
  
  .toggle-password {
    top: 44px;
    right: 14px;
  }
  
  /* === Tabs === */
  .tab-btn {
    padding: 14px 10px;
    font-size: 14px;
  }
  
  /* === Profile Card === */
  .profile-card {
    max-width: 95vw;
    margin: 10px;
    border-radius: 16px;
  }
  
  .cover {
    height: 60px;
  }
  
  .info {
    padding: 25px 20px;
  }
  
  .avatar {
    width: 100px;
    height: 100px;
    margin: -50px auto 15px;
    border-width: 3px;
  }
  
  .name {
    font-size: 24px;
  }
  
  .username {
    font-size: 16px;
    margin-bottom: 15px;
  }
  
  .bio {
    font-size: 14px;
    padding: 0 10px;
    margin-bottom: 20px;
  }
  
  .stats {
    gap: 25px;
    margin-bottom: 20px;
  }
  
  .stat-value {
    font-size: 18px;
  }
  
  .stat-label {
    font-size: 13px;
  }
  
  .details {
    padding: 20px;
    margin-bottom: 20px;
  }
  
  .detail-row {
    flex-direction: column;
    gap: 8px;
  }
  
  .detail-label {
    flex: none;
    width: 100%;
  }
  
  .btn {
    padding: 14px;
    font-size: 16px;
  }
  
  /* === Info Blocks (подсказки) === */
  .register-with-hints {
    max-width: 95vw;
    margin: 20px auto;
    padding: 0 10px;
  }
  
  .form-fields-wrapper input {
    padding: 14px 45px 14px 16px;
    font-size: 15px;
  }
  
  .hint-icon {
    right: 12px;
    top: 40px;
    font-size: 18px;
  }
  
  .tooltip-popup {
    right: 0;
    left: 0;
    margin: 0 auto;
    max-width: 90vw;
    top: 50px;
    font-size: 12px;
    padding: 10px 14px;
  }
  
  .info-block-header {
    padding: 12px 16px;
    font-size: 14px;
  }
  
  .info-block-content p,
  .info-block-content ul {
    padding: 12px 16px;
    font-size: 13px;
  }
  
  .bonus-hint {
    margin: 8px 16px 12px;
    font-size: 13px;
    padding: 8px 12px;
  }
  
  /* === Username Status === */
  .username-status {
    font-size: 13px;
    padding: 8px 12px;
    margin-top: 6px;
  }
  
  /* === Modal Windows === */
  .modal-content-welcome,
  .modal-content-energy {
    max-width: 90vw;
    padding: 25px 20px;
    margin: 10px;
  }
  
  .welcome-icon {
    font-size: 3rem;
  }
  
  /* === Forms General === */
  .form-group label {
    font-size: 14px;
    margin-bottom: 5px;
  }
  
  input[type="date"],
  input[type="email"],
  input[type="text"],
  input[type="password"],
  textarea {
    font-size: 16px !important; /* Предотвращает зум на iOS */
  }
}

/* Смартфоны (до 480px) */
@media (max-width: 480px) {
  /* === Body & Layout === */
  body {
    padding: 10px;
    align-items: flex-start;
    padding-top: 20px;
  }
  
  /* === Auth Container === */
  .auth-container {
    max-width: 100vw;
    margin: 0;
    border-radius: 12px;
    border: none;
    box-shadow: 0 4px 20px rgba(255, 0, 0, 0.3);
  }
  
  .tabs {
    flex-direction: row;
  }
  
  .tab-btn {
    padding: 12px 8px;
    font-size: 13px;
    font-weight: 600;
  }
  
  .form-container {
    padding: 20px;
  }
  
  .form-group {
    margin-bottom: 16px;
  }
  
  .form-group input {
    padding: 12px 38px 12px 12px;
    font-size: 14px;
    border-radius: 8px;
  }
  
  .toggle-password {
    top: 38px;
    right: 10px;
    width: 18px;
    height: 18px;
    font-size: 14px;
  }
  
  .btn {
    padding: 14px;
    font-size: 15px;
    border-radius: 8px;
  }
  
  .password-reset-link {
    font-size: 13px;
    padding: 6px 12px;
  }
  
  .messages li {
    font-size: 13px;
    padding: 8px 10px;
  }
  
  /* === Profile Card === */
  .profile-card {
    max-width: 100vw;
    margin: 0;
    border-radius: 12px;
  }
  
  .cover {
    height: 50px;
  }
  
  .info {
    padding: 20px 15px;
  }
  
  .avatar {
    width: 80px;
    height: 80px;
    margin: -40px auto 12px;
    border-width: 2px;
  }
  
  .name {
    font-size: 20px;
    margin-bottom: 4px;
  }
  
  .username {
    font-size: 14px;
    margin-bottom: 12px;
  }
  
  .bio {
    font-size: 13px;
    line-height: 1.5;
    padding: 0;
    margin-bottom: 16px;
  }
  
  .stats {
    gap: 15px;
    margin-bottom: 16px;
    justify-content: space-around;
  }
  
  .stat-item {
    min-width: 70px;
  }
  
  .stat-value {
    font-size: 16px;
  }
  
  .stat-label {
    font-size: 11px;
  }
  
  .details {
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 16px;
  }
  
  .detail-row {
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
  }
  
  .detail-label {
    font-size: 13px;
  }
  
  .detail-value {
    font-size: 14px;
  }
  
  .btn {
    padding: 12px;
    font-size: 15px;
    border-radius: 8px;
  }
  
  /* === Info Blocks === */
  .register-with-hints {
    max-width: 100vw;
    margin: 15px 0;
    padding: 0 5px;
  }
  
  .form-fields-wrapper p {
    margin-bottom: 16px;
  }
  
  .form-fields-wrapper label {
    font-size: 13px;
    margin-bottom: 6px;
  }
  
  .form-fields-wrapper input {
    padding: 12px 40px 12px 14px;
    font-size: 14px;
    border-radius: 10px;
  }
  
  .hint-icon {
    right: 10px;
    top: 36px;
    font-size: 16px;
  }
  
  .tooltip-popup {
    position: fixed;
    bottom: 20px;
    left: 10px;
    right: 10px;
    top: auto;
    max-width: none;
    font-size: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    animation: slideUp 0.3s ease;
  }
  
  @keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
  }
  
  .info-block {
    margin-bottom: 12px;
    border-radius: 10px;
  }
  
  .info-block-header {
    padding: 10px 14px;
    font-size: 13px;
    gap: 8px;
  }
  
  .info-block-header i:first-child {
    font-size: 1rem;
  }
  
  .info-block-content p,
  .info-block-content ul {
    padding: 10px 14px;
    font-size: 12px;
    line-height: 1.4;
  }
  
  .info-block-content li {
    margin-bottom: 6px;
  }
  
  .bonus-hint {
    margin: 6px 14px 10px;
    font-size: 12px;
    padding: 8px 10px;
    border-radius: 6px;
  }
  
  .toggle-icon {
    font-size: 14px;
  }
  
  /* === Username Status === */
  .username-status {
    font-size: 12px;
    padding: 8px 10px;
    margin-top: 4px;
    border-radius: 6px;
  }
  
  /* === Modal Windows === */
  .modal-content-welcome,
  .modal-content-energy {
    max-width: 95vw;
    padding: 20px 15px;
    border-radius: 16px;
  }
  
  .modal-content-welcome h2 {
    font-size: 18px;
    margin-bottom: 12px;
  }
  
  .modal-content-welcome p {
    font-size: 13px;
    margin-bottom: 20px;
  }
  
  .welcome-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
  }
  
  .btn-close-modal,
  .btn-submit,
  .btn-cancel {
    padding: 10px 20px;
    font-size: 14px;
    border-radius: 8px;
  }
  
  .modal-actions {
    flex-direction: column;
    gap: 10px;
  }
  
  /* === Forms General === */
  .form-group label {
    font-size: 13px;
  }
  
  .error {
    font-size: 12px;
  }
  
  /* === Buttons === */
  .btn,
  .btn-submit,
  .btn-cancel,
  .btn-close-modal {
    min-height: 44px; /* Минимальная высота для удобного тапа */
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  /* === Links === */
  .login-link {
    font-size: 13px;
    margin-top: 16px;
  }
  
  .login-link a {
    font-size: 14px;
  }
  
  /* === Prevent Zoom on Input Focus (iOS) === */
  @supports (-webkit-touch-callout: none) {
    input:focus,
    textarea:focus,
    select:focus {
      font-size: 16px !important;
    }
  }
  
  /* === Touch Feedback === */
  .btn:active,
  .tab-btn:active,
  .hint-icon:active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
  }
  
  /* === Hide Hover Effects on Touch Devices === */
  @media (hover: none) {
    .tab-btn:hover,
    .btn:hover,
    .info-block:hover,
    .hint-icon:hover {
      transform: none;
      box-shadow: none;
    }
    
    .tab-btn.active {
      background: red;
      color: white;
    }
  }
}

/* === Ultra-small screens (до 360px) === */
@media (max-width: 360px) {
  .auth-container,
  .profile-card,
  .register-with-hints {
    max-width: 100vw;
    border-radius: 8px;
  }
  
  .form-container,
  .info {
    padding: 15px;
  }
  
  .name {
    font-size: 18px;
  }
  
  .username {
    font-size: 13px;
  }
  
  .stats {
    gap: 10px;
  }
  
  .stat-value {
    font-size: 14px;
  }
  
  .stat-label {
    font-size: 10px;
  }
  
  .form-fields-wrapper input {
    padding: 10px 36px 10px 10px;
    font-size: 13px;
  }
  
  .hint-icon {
    top: 34px;
    right: 8px;
    font-size: 14px;
  }
  
  .btn {
    font-size: 14px;
    padding: 12px;
  }
}

/* === Landscape Mode Optimization === */
@media (max-height: 500px) and (orientation: landscape) {
  body {
    padding: 10px;
    align-items: center;
  }
  
  .auth-container,
  .profile-card {
    max-height: 90vh;
    overflow-y: auto;
  }
  
  .form-container {
    padding: 15px 20px;
  }
  
  .info-block-content.active {
    max-height: 150px;
    overflow-y: auto;
  }
}

/* === High DPI / Retina Displays === */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .avatar,
  .avatar-menu,
  .followers-avatar {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

/* === Dark Mode Support (если система в тёмной теме) === */
@media (prefers-color-scheme: dark) {
  body {
    background: linear-gradient(135deg, #0a0a0a, #1a1a2e);
  }
  
  .auth-container,
  .profile-card {
    background: #121218;
    border-color: #333;
  }
  
  .form-group input {
    background: #1e1e2e;
    border-color: #444;
  }
}

/* === Reduced Motion Preference === */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .auth-container,
  .profile-card,
  .info-block {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}