:root {
  --bg: #0f1115;
  --card: #1a1d24;
  --card-2: #20242c;
  --accent: #4da3ff;
  --text: #e6e9ef;
  --muted: #9aa3b2;
  --green: #2ecc71;
  --border: rgba(255, 255, 255, 0.06);
}

* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family: "Roboto", serif !important;
  background: radial-gradient(circle at top, #2a2f45, var(--bg));
  color: var(--text);
}

.container {
  max-width: 420px;
  margin: 0 auto;
  padding: 16px;
  min-height: 100vh;
  height: auto;
  padding-bottom: 90px;
}

/* Блок выбора города */
.city-selector {
  background: var(--card);
  border-radius: 20px;
  padding: 12px 16px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  position: relative;
}

.city-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.city-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.city-text {
  display: flex;
  flex-direction: column;
}

.city-label {
  font-size: 12px;
  color: var(--muted);
}

.city-name {
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
}

.city-chevron {
  color: var(--muted);
  font-size: 18px;
  transition: transform 0.3s;
}

.city-selector.open .city-chevron {
  transform: rotate(180deg);
}

/* Выпадающий список городов */
.city-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 8px;
  background: var(--card-2);
  border-radius: 16px;
  z-index: 1000;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  display: none;
  border: 1px solid var(--border);
}

.city-dropdown.show {
  display: block;
}

.city-option {
  padding: 14px 16px;
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  gap: 12px;
}

.city-option:hover {
  background: var(--card);
}

.city-option:not(:last-child) {
  border-bottom: 1px solid var(--border);
}

.city-option-icon {
  font-size: 20px;
}

.city-option-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.city-option.active {
  background: var(--card);
  color: var(--accent);
}

.city-option.active .city-option-name {
  color: var(--accent);
}

.card {
  background: var(--card);
  border-radius: 20px;
  padding: 16px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
}

.cardex input {
  background-color: #1a1d24;
  border: 0px solid;
  color: #fff;
  font-size: 32px;
  font-weight: 400;
  padding: 0px 0px 0px 0px;
  width: 100%;
}

.cardex input:active,
.cardex input:hover,
.cardex input:focus {
  outline: 0;
  outline-offset: 0;
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.label {
  font-size: 14px;
  color: var(--muted);
}

.value {
  font-size: 32px;
  margin: 6px 0;
}

.currency {
  font-size: 20px;
  color: var(--text);
  text-align: end;
  display: flex;
  justify-content: end;
  cursor: pointer;
  position: relative;
}

.currency .ctext {
  margin-right: 5px;
}
.currency .cimg img {
  height: 20px;
}

.badge {
  background: rgba(46, 204, 113, 0.15);
  color: var(--green);
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 6px;
  margin-left: 6px;
}

.btn {
  width: 100%;
  padding: 14px;
  border-radius: 14px;
  border: none;
  background: #2a2f3a;
  color: var(--muted);
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn.primary {
  background: var(--accent);
  color: #fff;
}

.btn.primary:hover {
  opacity: 0.9;
  transform: scale(0.98);
}

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

.list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: var(--card-2);
  border-radius: 12px;
}

.tag {
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 6px;
  margin-right: 8px;
}

.tag.eur {
  background: #6c5ce7;
}
.tag.usdt {
  background: #00b894;
}
.tag.aed {
  background: #e67e22;
}
.tag.kzt {
  background: #e84393;
}
.tag.try {
  background: #d63031;
}

.tag.create {
  background: #6c5ce7;
}
.tag.good {
  background: #00b894;
}
.tag.process {
  background: #2539adff;
}
.tag.cancel {
  background: #d63031;
}

/* ========== НОВОЕ МЕНЮ С ЭФФЕКТОМ СТЕКЛА ========== */
.bottom-nav {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 400px;
  background: rgba(26, 29, 36, 0.15);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 32px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  display: flex;
  justify-content: space-around;
  padding: 8px 12px;
  z-index: 1000;
  transition: all 0.3s ease;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 6px 12px;
  border-radius: 24px;
  flex: 1;
}

.nav-item:hover {
  background: rgba(77, 163, 255, 0.1);
}

.nav-item.active {
  color: var(--accent);
  background: rgba(77, 163, 255, 0.15);
}

/* Иконки для меню */
.nav-icon {
  font-size: 22px;
  margin-bottom: 2px;
  transition: transform 0.2s ease;
}

.nav-item:hover .nav-icon {
  transform: translateY(-2px);
}

.nav-item.active .nav-icon {
  transform: translateY(0);
}

.nav-label {
  font-weight: 500;
  font-size: 11px;
}

.input,
textarea {
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card-2);
  color: var(--text);
}

.section-title {
  font-size: 14px;
  margin-bottom: 8px;
  color: var(--muted);
}

.swappicon {
  position: absolute;
  background: #4d5057;
  border-radius: 34px;
  width: 40px;
  height: 40px;
  margin: auto;
  right: 25px;
  top: 90px;
  cursor: pointer;
  transition: transform 0.3s;
  z-index: 10;
  border: 1px solid #727479;
}

.swappicon:hover {
  transform: scale(1.1);
}

.swappicon img {
  width: 30px;
  margin: auto;
  margin-top: 4px;
  margin-left: 4px;
}

/* Стили для выпадающих списков валют */
.currency {
  position: relative;
}

.currency-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  background: var(--card-2);
  border-radius: 12px;
  min-width: 100px;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  display: none;
}

.currency-dropdown.show {
  display: block;
}

.currency-option {
  padding: 12px 16px;
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
}

.currency-option:hover {
  background: var(--card);
}

.currency-option:not(:last-child) {
  border-bottom: 1px solid var(--border);
}

.currency-option-icon {
  font-size: 20px;
  width: 28px;
  text-align: center;
}

.currency-option-code {
  flex: 1;
  text-align: center;
}

/* Анимация для появления меню */
@keyframes floatUp {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.bottom-nav {
  animation: floatUp 0.4s ease-out;
}

/* --- НОВЫЙ СТИЛЬ: шапка с заголовком "Обмен" и селектором языка (только флаг) в одной линии --- */
.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  margin-top: 0;
}
.header-row h3 {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  color: var(--text);
}

/* Компактный блок выбора языка — только флаг, без текста, не фиксированный, статический */
.lang-selector-static {
  position: relative;
  display: inline-block;
  z-index: 105;
}
.lang-btn-static {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 40px;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 24px;
  backdrop-filter: blur(4px);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}
.lang-btn-static:hover {
  background: var(--card-2);
  border-color: var(--accent);
  transform: scale(0.96);
}
.lang-dropdown-static {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--card-2);
  backdrop-filter: blur(12px);
  background: rgba(32, 36, 44, 0.98);
  border-radius: 20px;
  min-width: 50px;
  overflow: hidden;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border);
  display: none;
  flex-direction: column;
}
.lang-selector-static.open .lang-dropdown-static {
  display: flex;
}
.lang-option-static {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: background 0.2s;
  font-weight: 500;
  font-size: 14px;
  color: var(--text);
}
.lang-option-static:hover {
  background: var(--card);
}
.lang-option-static.active {
  background: rgba(77, 163, 255, 0.2);
  color: var(--accent);
}
.lang-flag-small {
  font-size: 22px;
}
.lang-name {
  flex: 1;
}

.lang-name img,
#currentFlagOnly img {
  width: 30px;
}

/* Стили для блока офисов */
.offices-block {
  margin-top: 20px;
}
.office-card {
  background: var(--card-2);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
  transition: transform 0.2s;
}
.office-card:hover {
  transform: translateY(-2px);
}
.office-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.office-icon {
  font-size: 24px;
}
.office-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}
.office-address,
.office-hours,
.office-phone {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.office-phone {
  color: var(--accent);
  margin-bottom: 0;
}

/* HTML: <div class="loader"></div> */
.position_loader {
  width: 100vw;
  height: 100vh;
  position: fixed;
  background: radial-gradient(circle at top, #2a2f45, var(--bg));
  z-index: 9999;
  text-align: center;
}
.loader {
  margin: auto;
  margin-top: 100px;
  --s: 20px;

  --_d: calc(0.353 * var(--s));
  width: calc(var(--s) + var(--_d));
  aspect-ratio: 1;
  display: grid;
}
.loader:before,
.loader:after {
  content: "";
  grid-area: 1/1;
  clip-path: polygon(
    var(--_d) 0,
    100% 0,
    100% calc(100% - var(--_d)),
    calc(100% - var(--_d)) 100%,
    0 100%,
    0 var(--_d)
  );
  background: conic-gradient(
    from -90deg at calc(100% - var(--_d)) var(--_d),
    #fff 135deg,
    #666 0 270deg,
    #aaa 0
  );
  animation: l6 2s infinite;
}
.loader:after {
  animation-delay: -1s;
}
@keyframes l6 {
  0% {
    transform: translate(0, 0);
  }
  25% {
    transform: translate(30px, 0);
  }
  50% {
    transform: translate(30px, 30px);
  }
  75% {
    transform: translate(0, 30px);
  }
  100% {
    transform: translate(0, 0);
  }
}

.errborder {
  border: 1px solid #ff1414;
}
