/* login.css - ИСПРАВЛЕННАЯ ВЕРСИЯ С УЛУЧШЕННОЙ МОБИЛЬНОЙ АДАПТАЦИЕЙ */
:root {
  /* iOS Dark Theme Colors - ОСНОВНАЯ ТЕМА */
  --system-background: #000000;
  --secondary-background: #1c1c1e;
  --tertiary-background: #2c2c2e;
  --system-label: #ffffff;
  --secondary-label: #ebebf5;
  --tertiary-label: #ebebf599;
  --system-blue: #0a84ff;
  --system-green: #30d158;
  --system-red: #ff453a;
  --system-gray: #8e8e93;
  --separator: #38383a;
  --surface-color: #1c1c1e;
  --border-color: #38383a;
  --primary-color: #0a84ff;
  --text-primary: #ffffff;
  --text-secondary: #ebebf5;
  --background-color: #000000;
}

[data-theme="light"] {
  /* iOS Light Theme Colors */
  --system-background: #ffffff;
  --secondary-background: #f2f2f7;
  --tertiary-background: #ffffff;
  --system-label: #000000;
  --secondary-label: #3c3c43;
  --tertiary-label: #3c3c4399;
  --system-blue: #007aff;
  --system-green: #34c759;
  --system-red: #ff3b30;
  --system-gray: #c7c7cc;
  --separator: #c6c6c8;
  --surface-color: #f2f2f7;
  --border-color: #c6c6c8;
  --primary-color: #007aff;
  --text-primary: #000000;
  --text-secondary: #3c3c43;
  --background-color: #ffffff;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "SF Pro Display", "Segoe UI", sans-serif;
  background: var(--system-background);
  color: var(--system-label);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  line-height: 1.4;
  letter-spacing: -0.02em;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.login-container {
  width: 100%;
  max-width: 400px;
  padding: 2rem 1rem;
  animation: fadeIn 0.5s ease-out;
}

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

.login-header {
  text-align: center;
  margin-bottom: 3rem;
}

/* Новые стили для логотипа со стеклянным морфизмом */
.logo {
  width: 100px;
  height: 100px;
  border-radius: 24px;
  margin: 0 auto 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.logo-content {
  text-align: center;
  position: relative;
  z-index: 2;
}

.logo-main-text {
  font-size: 2.2rem;
  font-weight: 800;
  background: linear-gradient(135deg, #000000 0%, #222222 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -2px;
  line-height: 1;
  position: relative;
  text-shadow: 1px 0 0 rgba(120, 120, 120, 0.8),
    2px 0 0 rgba(150, 150, 150, 0.5);
}

.logo-sub-text {
  font-size: 0.9rem;
  font-weight: 600;
  color: #333333;
  margin-top: 4px;
  letter-spacing: 0.3px;
  text-shadow: 0.5px 0 0 rgba(120, 120, 120, 0.7),
    1px 0 0 rgba(150, 150, 150, 0.4);
}

/* Стили для темной темы */
[data-theme="dark"] .logo {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .logo-main-text {
  background: linear-gradient(135deg, #ffffff 0%, #cccccc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 1px 0 0 rgba(0, 0, 0, 0.4), 2px 0 0 rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .logo-sub-text {
  color: #cccccc;
  text-shadow: 0.5px 0 0 rgba(0, 0, 0, 0.4), 1px 0 0 rgba(0, 0, 0, 0.2);
}

/* Анимация для логотипа */
@keyframes subtleGlow {
  0%,
  100% {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2),
      inset 0 1px 0 rgba(255, 255, 255, 0.1);
  }
  50% {
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.25),
      inset 0 1px 0 rgba(255, 255, 255, 0.15),
      0 0 20px rgba(255, 255, 255, 0.05);
  }
}

.logo {
  animation: subtleGlow 4s ease-in-out infinite;
}

/* Убираем старые стили SVG логотипа */
.logo svg {
  display: none;
}

.login-tabs {
  display: flex;
  background: var(--secondary-background);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 2rem;
  border: 1px solid var(--separator);
}

.tab-btn {
  flex: 1;
  padding: 0.875rem 1rem;
  border: none;
  background: transparent;
  color: var(--secondary-label);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 500;
  position: relative;
  overflow: hidden;
}

.tab-btn::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.1);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.tab-btn:active::after {
  opacity: 1;
}

.tab-btn.active {
  background: var(--system-blue);
  color: white;
  box-shadow: 0 2px 8px rgba(0, 122, 255, 0.3);
}

.form {
  display: none;
  animation: slideIn 0.3s ease-out;
}

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

.form.active {
  display: block;
}

.input-group {
  margin-bottom: 1.5rem;
}

.input-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--secondary-label);
  font-size: 0.95rem;
  font-weight: 500;
}

.ios-input {
  width: 100%;
  padding: 1rem 1.25rem;
  border: 2px solid var(--separator);
  border-radius: 12px;
  background: var(--secondary-background);
  color: var(--system-label);
  font-size: 1.1rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: inherit;
  appearance: none;
  -webkit-appearance: none;
}

.ios-input:focus {
  outline: none;
  border-color: var(--system-blue);
  background: var(--tertiary-background);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.ios-input::placeholder {
  color: var(--tertiary-label);
  font-weight: 400;
}

/* Enhanced security visual indicators */
.ios-input:valid {
  border-color: var(--system-green);
}

.ios-input:invalid:not(:focus):not(:placeholder-shown) {
  border-color: var(--system-red);
}

.ios-checkbox {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-size: 0.95rem;
  color: var(--secondary-label);
  margin-bottom: 1rem;
  user-select: none;
}

.ios-checkbox input {
  display: none;
}

.ios-checkmark {
  width: 22px;
  height: 22px;
  border: 2px solid var(--system-gray);
  border-radius: 6px;
  margin-right: 0.75rem;
  position: relative;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: var(--secondary-background);
  flex-shrink: 0;
}

.ios-checkbox input:checked + .ios-checkmark {
  background: var(--system-blue);
  border-color: var(--system-blue);
}

.ios-checkbox input:checked + .ios-checkmark::after {
  content: "✓";
  position: absolute;
  color: white;
  font-size: 14px;
  font-weight: 600;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.ios-button {
  width: 100%;
  padding: 1.125rem;
  background: var(--system-blue);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: inherit;
  margin-top: 0.5rem;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.ios-button::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.1);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.ios-button:active::after {
  opacity: 1;
}

.ios-button:hover {
  background: #0072e5;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 122, 255, 0.4);
}

.ios-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.ios-button.secondary {
  background: var(--secondary-background);
  color: var(--system-blue);
  border: 2px solid var(--system-blue);
}

.ios-button.secondary:hover {
  background: var(--system-blue);
  color: white;
}

/* Loading state for buttons */
.ios-button.loading {
  position: relative;
  color: transparent;
}

.ios-button.loading::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.security-options,
.terms {
  margin: 1.5rem 0;
}

.alternative-auth {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--separator);
}

.alternative-auth p {
  text-align: center;
  margin-bottom: 1.25rem;
  color: var(--tertiary-label);
  font-size: 0.95rem;
}

.auth-buttons {
  display: flex;
  gap: 0.75rem;
}

.theme-switcher {
  margin: 2rem 0;
  text-align: center;
}

.theme-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--secondary-background);
  color: var(--system-label);
  border: 2px solid var(--separator);
  border-radius: 12px;
  padding: 0.875rem 1.5rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: inherit;
  font-weight: 500;
}

.theme-btn:hover {
  border-color: var(--system-blue);
  transform: translateY(-1px);
}

.language-links {
  text-align: center;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--separator);
}

.lang-link {
  color: var(--system-blue);
  text-decoration: none;
  transition: all 0.3s ease;
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
}

.lang-link:hover {
  background: rgba(0, 122, 255, 0.1);
}

.lang-link.active {
  color: var(--system-blue);
  font-weight: 600;
  background: rgba(0, 122, 255, 0.1);
}

.lang-separator {
  color: var(--separator);
  margin: 0 0.5rem;
}

/* Recovery Link Styles */
.recovery-link {
  text-align: center;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--separator);
}

.recovery-link a {
  color: var(--system-blue);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: opacity 0.3s ease;
}

.recovery-link a:hover {
  opacity: 0.8;
  text-decoration: underline;
}

/* Recovery Modal Styles */
.recovery-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
  animation: fadeIn 0.3s ease;
}

.recovery-content {
  background: var(--secondary-background);
  padding: 24px;
  border-radius: 14px;
  width: 100%;
  max-width: 400px;
  border: 1px solid var(--separator);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  animation: slideInUp 0.3s ease;
}

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

.recovery-content h3 {
  margin-bottom: 20px;
  text-align: center;
  color: var(--system-label);
  font-size: 1.4rem;
  font-weight: 600;
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 24px;
}

.modal-actions .ios-button {
  margin-top: 0;
  flex: 1;
}

#recoveryMessage {
  margin-top: 16px;
  padding: 12px;
  border-radius: 8px;
  display: none;
  font-size: 14px;
  text-align: center;
  font-weight: 500;
}

/* Notification Styles */
.notification {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  background: var(--system-blue);
  color: white;
  padding: 12px 20px;
  border-radius: 10px;
  z-index: 10000;
  transition: transform 0.3s ease;
  font-size: 14px;
  max-width: 300px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.notification.success {
  background: var(--system-green);
}

.notification.error {
  background: var(--system-red);
}

/* SMS Verification Styles */
.sms-verification-container {
  background: var(--secondary-background);
  border-radius: 16px;
  padding: 24px;
  margin: 20px 0;
  border: 1px solid var(--separator);
  animation: slideInUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.sms-header {
  text-align: center;
  margin-bottom: 24px;
}

.sms-header h3 {
  margin: 0 0 8px 0;
  color: var(--system-label);
  font-size: 1.4rem;
  font-weight: 700;
}

.sms-header p {
  margin: 0;
  color: var(--secondary-label);
  font-size: 0.95rem;
  line-height: 1.4;
}

.sms-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.sms-actions .ios-button {
  flex: 1;
  margin-top: 0;
}

.sms-actions .ios-button.secondary {
  background: var(--secondary-background);
  color: var(--system-blue);
  border: 2px solid var(--system-blue);
}

.sms-actions .ios-button.secondary:hover {
  background: var(--system-blue);
  color: white;
}

#smsCode {
  text-align: center;
  font-size: 20px;
  letter-spacing: 8px;
  font-weight: 600;
  padding: 1rem 1.25rem;
  background: var(--tertiary-background);
  border: 2px solid var(--separator);
}

#smsCode:focus {
  border-color: var(--system-blue);
  background: var(--secondary-background);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 122, 255, 0.2);
}

/* УЛУЧШЕННАЯ МОБИЛЬНАЯ АДАПТАЦИЯ */
@media (max-width: 480px) {
  body {
    padding: 0.5rem;
    align-items: flex-start;
    padding-top: 1rem;
    min-height: 100vh;
    display: flex;
  }

  .login-container {
    padding: 0.75rem 0.5rem;
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
  }

  /* Уменьшаем логотип */
  .logo {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    margin-bottom: 0.75rem;
  }

  .logo-main-text {
    font-size: 1.5rem;
    letter-spacing: -1px;
  }

  .logo-sub-text {
    font-size: 0.7rem;
    margin-top: 2px;
  }

  .login-header {
    margin-bottom: 1.5rem;
  }

  .login-header h1 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
  }

  /* Уменьшаем табы */
  .login-tabs {
    margin-bottom: 1.25rem;
    padding: 3px;
  }

  .tab-btn {
    padding: 0.6rem 0.4rem;
    font-size: 0.9rem;
    border-radius: 8px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Уменьшаем поля ввода */
  .ios-input {
    padding: 0.75rem 0.875rem;
    font-size: 0.95rem;
    border-radius: 10px;
    margin-bottom: 0.5rem;
    font-size: 16px; /* Предотвращает zoom в iOS */
  }

  /* Уменьшаем кнопки */
  .ios-button {
    padding: 0.875rem;
    font-size: 0.95rem;
    border-radius: 10px;
    margin-top: 0.25rem;
    min-height: 44px;
  }

  /* Уменьшаем отступы между группами */
  .input-group {
    margin-bottom: 1rem;
  }

  .input-group label {
    font-size: 0.9rem;
    margin-bottom: 0.375rem;
  }

  /* Уменьшаем чекбоксы */
  .ios-checkbox {
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .ios-checkmark {
    width: 18px;
    height: 18px;
    margin-right: 0.5rem;
  }

  /* Уменьшаем дополнительные секции */
  .security-options,
  .terms {
    margin: 1rem 0;
  }

  .alternative-auth {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
  }

  .alternative-auth p {
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
  }

  .theme-switcher {
    margin: 1.25rem 0;
  }

  .theme-btn {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    border-radius: 10px;
    min-height: 44px;
  }

  .language-links {
    margin-top: 1rem;
    padding-top: 1rem;
  }

  .lang-link {
    font-size: 0.85rem;
    padding: 0.2rem 0.4rem;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* Улучшаем recovery modal для мобильных */
  .recovery-modal {
    padding: 0.5rem;
    align-items: center;
    padding-top: 10%;
  }

  .recovery-content {
    padding: 1.25rem;
    margin: 0;
  }

  .recovery-content h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
  }

  .modal-actions {
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1.25rem;
  }

  /* Улучшаем SMS verification */
  .sms-verification-container {
    padding: 1.25rem 1rem;
    margin: 1rem 0;
  }

  .sms-header h3 {
    font-size: 1.2rem;
  }

  .sms-header p {
    font-size: 0.85rem;
  }

  .sms-actions {
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1.25rem;
  }

  #smsCode {
    font-size: 16px;
    letter-spacing: 4px;
    padding: 0.75rem 0.875rem;
  }

  /* Улучшаем уведомления */
  .notification {
    top: 10px;
    left: 10px;
    right: 10px;
    max-width: none;
    transform: translateX(0) translateY(-100px);
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
  }
}

/* Дополнительные улучшения для очень маленьких экранов */
@media (max-width: 360px) {
  .login-container {
    padding: 0.5rem 0.25rem;
  }

  .logo {
    width: 50px;
    height: 50px;
    border-radius: 14px;
  }

  .logo-main-text {
    font-size: 1.3rem;
  }

  .logo-sub-text {
    font-size: 0.65rem;
  }

  .login-header h1 {
    font-size: 1.3rem;
  }

  .tab-btn {
    font-size: 0.85rem;
    padding: 0.5rem 0.3rem;
  }

  .ios-input {
    padding: 0.675rem 0.75rem;
    font-size: 0.9rem;
  }

  .ios-button {
    padding: 0.75rem;
    font-size: 0.9rem;
  }
}

/* Улучшения для landscape ориентации */
@media (max-height: 600px) and (orientation: landscape) {
  body {
    align-items: flex-start;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
  }

  .login-container {
    padding: 0.25rem;
    max-width: 100%;
  }

  .login-header {
    margin-bottom: 1rem;
  }

  .logo {
    width: 40px;
    height: 40px;
    margin-bottom: 0.25rem;
  }

  .logo-main-text {
    font-size: 1.1rem;
  }

  .logo-sub-text {
    font-size: 0.6rem;
  }

  .login-header h1 {
    font-size: 1.2rem;
    margin-bottom: 0;
  }

  .login-tabs {
    margin-bottom: 1rem;
  }

  /* Уменьшаем высоту полей ввода для landscape */
  .ios-input {
    padding: 0.5rem 0.75rem;
  }

  .input-group {
    margin-bottom: 0.75rem;
  }
}

/* Улучшаем читаемость на очень маленьких устройствах */
@media (max-width: 320px) {
  .login-container {
    padding: 0.25rem;
  }

  .ios-input {
    font-size: 16px;
  }

  .tab-btn {
    font-size: 0.8rem;
  }
}

/* Улучшаем анимации для производительности на мобильных */
@media (max-width: 480px) {
  .login-container {
    animation: fadeInMobile 0.4s ease-out;
  }

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

  /* Упрощаем анимации для лучшей производительности */
  .ios-input:focus {
    transform: translateY(-1px);
    transition: all 0.2s ease;
  }

  .ios-button:hover {
    transform: none;
  }
}

/* High DPI screens */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .ios-input {
    border-width: 1.5px;
  }

  .ios-button.secondary {
    border-width: 1.5px;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Dark mode auto-detection */
@media (prefers-color-scheme: dark) {
  body:not([data-theme]) {
    --system-background: #000000;
    --secondary-background: #1c1c1e;
    --system-label: #ffffff;
  }
}

@media (prefers-color-scheme: light) {
  body:not([data-theme]) {
    --system-background: #ffffff;
    --secondary-background: #f2f2f7;
    --system-label: #000000;
  }
}
/* ДОПОЛНИТЕЛЬНЫЕ ИСПРАВЛЕНИЯ ДЛЯ МОБИЛЬНОЙ ВЕРСИИ */
@media (max-width: 480px) {
  /* Уменьшаем общий контейнер */
  .login-container {
    padding: 0.5rem;
    max-width: 100%;
    margin: 0 auto;
  }

  /* Уменьшаем логотип */
  .logo {
    width: 70px;
    height: 70px;
    border-radius: 18px;
    margin-bottom: 1rem;
  }

  .logo-main-text {
    font-size: 1.8rem;
  }

  .logo-sub-text {
    font-size: 0.75rem;
  }

  /* Уменьшаем заголовок */
  .login-header h1 {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
  }

  /* Уменьшаем табы */
  .login-tabs {
    margin-bottom: 1.5rem;
    padding: 3px;
  }

  .tab-btn {
    padding: 0.7rem 0.5rem;
    font-size: 0.85rem;
    border-radius: 8px;
    min-height: 40px;
  }

  /* Уменьшаем поля ввода - ВАЖНОЕ ИСПРАВЛЕНИЕ */
  .ios-input {
    padding: 0.7rem 0.8rem;
    font-size: 14px;
    border-radius: 10px;
    margin-bottom: 0.5rem;
    min-height: 44px;
  }

  /* Уменьшаем кнопки */
  .ios-button {
    padding: 0.8rem;
    font-size: 0.9rem;
    border-radius: 10px;
    margin-top: 0.25rem;
    min-height: 44px;
  }

  /* Уменьшаем отступы между группами */
  .input-group {
    margin-bottom: 0.8rem;
  }

  .input-group label {
    font-size: 0.85rem;
    margin-bottom: 0.3rem;
  }

  /* Уменьшаем чекбоксы */
  .ios-checkbox {
    font-size: 0.8rem;
    margin-bottom: 0.7rem;
    min-height: 40px;
  }

  .ios-checkmark {
    width: 18px;
    height: 18px;
    margin-right: 0.5rem;
  }

  /* Уменьшаем дополнительные секции */
  .security-options,
  .terms {
    margin: 0.8rem 0;
  }

  .alternative-auth {
    margin-top: 1rem;
    padding-top: 1rem;
  }

  .alternative-auth p {
    font-size: 0.8rem;
    margin-bottom: 0.7rem;
  }

  .theme-switcher {
    margin: 1rem 0;
  }

  .theme-btn {
    padding: 0.7rem 1rem;
    font-size: 0.85rem;
    border-radius: 10px;
    min-height: 40px;
  }

  .language-links {
    margin-top: 0.8rem;
    padding-top: 0.8rem;
  }

  .lang-link {
    font-size: 0.8rem;
    padding: 0.2rem 0.4rem;
    min-height: 40px;
  }
}

/* ДОПОЛНИТЕЛЬНЫЕ ИСПРАВЛЕНИЯ ДЛЯ ОЧЕНЬ МАЛЕНЬКИХ ЭКРАНОВ */
@media (max-width: 360px) {
  .login-container {
    padding: 0.3rem;
  }

  .logo {
    width: 60px;
    height: 60px;
    border-radius: 16px;
  }

  .logo-main-text {
    font-size: 1.5rem;
  }

  .logo-sub-text {
    font-size: 0.7rem;
  }

  .login-header h1 {
    font-size: 1.3rem;
  }

  .tab-btn {
    font-size: 0.8rem;
    padding: 0.6rem 0.4rem;
  }

  .ios-input {
    padding: 0.6rem 0.7rem;
    font-size: 13px;
  }

  .ios-button {
    padding: 0.7rem;
    font-size: 0.85rem;
  }

  .input-group label {
    font-size: 0.8rem;
  }
}

/* ИСПРАВЛЕНИЕ ДЛЯ LANDSCAPE РЕЖИМА */
@media (max-height: 500px) and (orientation: landscape) {
  body {
    align-items: flex-start;
    padding-top: 0.3rem;
    padding-bottom: 0.3rem;
  }

  .login-container {
    padding: 0.2rem;
    max-width: 100%;
  }

  .login-header {
    margin-bottom: 0.8rem;
  }

  .logo {
    width: 50px;
    height: 50px;
    margin-bottom: 0.3rem;
  }

  .logo-main-text {
    font-size: 1.3rem;
  }

  .logo-sub-text {
    font-size: 0.65rem;
  }

  .login-header h1 {
    font-size: 1.1rem;
    margin-bottom: 0;
  }

  .login-tabs {
    margin-bottom: 0.8rem;
  }

  .ios-input {
    padding: 0.5rem 0.6rem;
    font-size: 13px;
    min-height: 38px;
  }

  .input-group {
    margin-bottom: 0.6rem;
  }

  .ios-button {
    padding: 0.6rem;
    min-height: 38px;
    font-size: 0.8rem;
  }
}

/* ОПТИМИЗАЦИЯ ДЛЯ IPHONE */
@supports (-webkit-touch-callout: none) {
  .ios-input {
    font-size: 16px; /* Предотвращает zoom в iOS */
  }
}
/* ЭКСТРЕННОЕ ИСПРАВЛЕНИЕ ДЛЯ МОБИЛЬНОЙ ВЕРСИИ */
@media (max-width: 480px) {
  body {
    display: flex !important;
    justify-content: center !important;
    align-items: flex-start !important;
    padding: 10px !important;
    background: var(--system-background) !important;
  }

  .login-container {
    width: 100% !important;
    max-width: 340px !important;
    margin: 0 auto !important;
    padding: 15px 12px !important;
    background: var(--system-background) !important;
  }

  /* Принудительно ограничиваем ширину всех элементов */
  .login-tabs,
  .form,
  .input-group,
  .ios-input,
  .ios-button,
  .security-options,
  .terms,
  .alternative-auth,
  .theme-switcher,
  .language-links {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Центрируем кнопку темы */
  .theme-switcher {
    display: flex !important;
    justify-content: center !important;
  }

  .theme-btn {
    width: auto !important;
    min-width: 200px !important;
  }
}

/* Для очень маленьких экранов */
@media (max-width: 320px) {
  .login-container {
    max-width: 300px !important;
    padding: 12px 10px !important;
  }
}
/* PIN Modal Styles */
.pin-verification-modal,
.pin-setup-modal {
  animation: fadeIn 0.4s ease-out;
}

.pin-input {
  font-family: "SF Mono", "Monaco", "Inconsolata", "Roboto Mono",
    "Source Code Pro", monospace;
  border: 2px solid var(--separator);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.pin-input:focus {
  border-color: var(--system-blue);
  background: var(--secondary-background);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 122, 255, 0.3);
}

.pin-input::placeholder {
  letter-spacing: 0;
  color: var(--tertiary-label);
  opacity: 0.6;
}

/* Mobile optimizations for PIN modal */
@media (max-width: 480px) {
  .pin-verification-content,
  .pin-setup-content {
    padding: 30px 20px !important;
    margin: 20px;
    width: calc(100% - 40px) !important;
  }

  .pin-input {
    font-size: 24px !important;
    padding: 18px !important;
    letter-spacing: 8px !important;
  }

  .pin-actions,
  .pin-setup-actions {
    flex-direction: column;
    gap: 8px !important;
  }

  .pin-actions .ios-button,
  .pin-setup-actions .ios-button {
    margin: 0 !important;
    padding: 14px !important;
  }
}

/* Very small screens */
@media (max-width: 360px) {
  .pin-verification-content,
  .pin-setup-content {
    padding: 25px 15px !important;
    margin: 15px;
    width: calc(100% - 30px) !important;
  }

  .pin-input {
    font-size: 22px !important;
    padding: 16px !important;
    letter-spacing: 6px !important;
  }
}

/* Landscape orientation */
@media (max-height: 600px) and (orientation: landscape) {
  .pin-verification-content,
  .pin-setup-content {
    padding: 25px 20px !important;
  }

  .pin-input {
    padding: 12px !important;
    font-size: 22px !important;
  }
}

/* Animation for PIN modal */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Success state for PIN input */
.pin-input:valid {
  border-color: var(--system-green);
}

/* Error state for PIN input */
.pin-input:invalid:not(:focus):not(:placeholder-shown) {
  border-color: var(--system-red);
}
