/* Импорт общих стилей */
@import url('./common.css');

/* Navigation */
.nav-links {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.nav-links {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-md);
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-links a {
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    text-decoration: none;
    font-weight: 500;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
    position: relative;
}

.nav-links a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.nav-links a.active {
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    background: rgba(102, 126, 234, 0.3);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Animations */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

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

/* Alert styles */
.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* Контейнер уже определен в common.css */

/* Выравнивание отступов на главной странице */
body:not(.order-page) .container {
    padding-top: 24px;
}

header {
    text-align: center;
    color: white;
    margin-bottom: 24px;
    position: relative;
    z-index: 1;
}

.logo-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    text-decoration: none;
    color: inherit;
    transition: opacity 0.3s ease;
    margin-bottom: 8px;
}

.logo-link:hover {
    opacity: 0.85;
}

.logo-img {
    width: 64px;
    height: 64px;
    object-fit: contain;
}

.logo-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1;
}

.logo-benefit {
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.logo-exchange {
    font-size: 1.4rem;
    font-weight: 300;
    letter-spacing: 4px;
    color: rgba(255, 255, 255, 0.8);
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.2);
}

header h1 {
    font-size: var(--font-size-4xl);
    margin-bottom: 0;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
    font-weight: 700;
    letter-spacing: -0.5px;
}

header h1 a {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: opacity 0.3s ease;
    display: inline-block;
}

header h1 a:hover {
    opacity: 0.8;
}

.subtitle {
    font-size: var(--font-size-lg);
    opacity: 0.95;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    font-weight: 400;
    color: rgba(255, 255, 255, 0.95);
}

.exchange-form {
    padding: 0;
    position: relative;
    max-width: 100%;
}

.exchange-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    margin-bottom: 24px;
    max-width: 100%;
}

.currency-input-row {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    position: relative;
}

.currency-input-row {
    max-width: 100%;
    width: 100%;
    min-width: 0;
}

.currency-input-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
}

.currency-input-row label {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    font-size: calc(var(--font-size-sm) * 1.2);
}

.input-currency-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
    margin-bottom: 20px; /* Постоянный отступ для лимитов - не прыгает */
}

.amount-currency-row {
  display: flex;
  gap: 0;
  align-items: stretch;
  background: rgba(15, 15, 25, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius-md);
  border: 1px solid rgba(102, 126, 234, 0.25);
  overflow: visible !important; /* Важно: не обрезаем dropdown */
  transition: all var(--transition-base);
  height: 70px;
  position: relative;
  z-index: 1;
}

/* Когда dropdown открыт, изменяем скругление только сверху для визуального соединения */
.amount-currency-row.dropdown-open {
    border-radius: var(--radius-md) var(--radius-md) 0 0 !important;
    border-bottom: none !important;
    /* Усиливаем эффект стекла для визуального соединения */
    box-shadow: 
        0 -4px 16px rgba(0, 0, 0, 0.2),
        0 4px 16px rgba(102, 126, 234, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        inset 0 -1px 0 rgba(255, 255, 255, 0.1) !important;
}

.amount-currency-row:focus-within {
  border-color: rgba(102, 126, 234, 0.5);
  box-shadow: 0 0 15px rgba(102, 126, 234, 0.15);
}

.amount-currency-row .amount-input,
.amount-currency-row .amount-input-search {
    flex: 1;
    padding: 20px 20px;
    border: none;
    background: transparent;
    font-size: calc(var(--font-size-lg) * 1.2);
    font-weight: 700;
    color: rgba(255, 255, 255, 0.95);
    outline: none;
    box-sizing: border-box;
    transition: all var(--transition-base);
    min-width: 150px;
    display: flex;
    align-items: center;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.amount-currency-row .amount-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.amount-currency-row .amount-input-search::placeholder {
    color: rgba(255, 255, 255, 0.6);
    opacity: 0.7;
    font-size: calc(var(--font-size-base) * 1.1);
}

.amount-currency-row .amount-input-search {
    display: none;
}

.amount-currency-row .amount-input-search.active {
    display: block;
}

.amount-currency-row .amount-input-search:focus {
    outline: none;
}

/* Убираем стрелки у number input */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
}

.amount-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.amount-input[readonly] {
    opacity: 0.8;
    cursor: default;
}

.input-currency-wrapper .currency-selector-wrapper {
    position: absolute !important;
    top: calc(100% - 1px) !important; /* Точное соединение без зазора (минус 1px для перекрытия границы) */
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    z-index: 10000 !important;
    overflow: visible !important;
    display: none !important;
    visibility: hidden !important;
    margin-top: 0 !important;
    pointer-events: none !important;
    transform: translateY(-10px);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

.input-currency-wrapper .currency-selector-wrapper.active {
    display: block !important;
    visibility: visible !important;
    transform: translateY(0) !important;
    pointer-events: auto !important;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

.amount-currency-row .currency-selector-btn {
    flex-shrink: 0;
    width: 150px;
    min-width: 155px;
    max-width: 150px;
    padding: 20px 40px 20px 20px;
    border: none;
    background: transparent;
    font-size: calc(var(--font-size-base) * 1.2);
    transition: all var(--transition-base);
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    text-align: right;
    box-sizing: border-box;
    overflow: hidden;
    position: relative;
}

.amount-currency-row .currency-selector-btn:hover {
    background: transparent;
    opacity: 0.8;
}

.amount-currency-row .currency-selector-btn.active {
    background: transparent;
    opacity: 1;
}

.currency-selector-placeholder {
    color: rgba(255, 255, 255, 0.6);
    font-size: var(--font-size-sm);
}

.currency-selector-selected {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    width: 100%;
}

.currency-logo-wrapper {
    position: relative;
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.currency-selector-logo {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.currency-network-logo {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(30, 30, 40, 0.98);
    background: rgba(30, 30, 40, 0.98);
    z-index: 10;
}

.currency-selector-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
    align-items: flex-end;
    justify-content: center;
}

.currency-selector-name {
    font-weight: 600;
    font-size: calc(var(--font-size-sm) * 1.3);
    color: rgba(255, 255, 255, 0.95);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    display: block;
    line-height: 1.2;
    text-align: right;
}

.currency-network-badge {
    display: none;
    font-size: 12px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    padding: 2px 7px;
    white-space: nowrap;
    line-height: 1.2;
    text-align: right;
    /* Цвета задаются динамически через JavaScript в зависимости от сети */
}

.currency-selector-code {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.6);
    display: none;
}

.currency-selector-arrow {
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
    transition: transform var(--transition-base);
    flex-shrink: 0;
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

.currency-selector-btn.active .currency-selector-arrow {
    transform: translateY(-50%) rotate(180deg);
}

/* Старые стили для совместимости */
.currency-input {
    display: flex;
    flex-direction: column;
}

.currency-input label {
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.currency-input input,
.currency-input select {
    padding: 14px 18px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    font-size: var(--font-size-base);
    transition: all var(--transition-base);
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: var(--text-primary);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.currency-input input:focus,
.currency-input select:focus {
    outline: none;
    border-color: rgba(102, 126, 234, 0.5);
    background: rgba(255, 255, 255, 0.2);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05), 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.currency-input input[readonly] {
    background: rgba(248, 249, 250, 0.3);
    opacity: 0.8;
}

.swap-btn {
    width: auto;
    height: auto;
    min-width: 32px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.8);
    font-size: var(--font-size-xl);
    cursor: pointer;
    transition: transform 0.3s ease, color 0.3s ease;
    align-self: center;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-top: 18px;
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

.swap-btn:hover {
    color: rgba(102, 126, 234, 1);
    background: transparent;
}

/* Анимация через JS-класс */
.swap-btn.swapping {
    transform: rotate(180deg) !important;
    color: rgba(102, 126, 234, 1);
}

@keyframes swapGlow {
    0%, 100% {
        color: rgba(102, 126, 234, 1);
        text-shadow: 0 0 5px rgba(102, 126, 234, 0.5);
    }
    50% {
        color: rgba(102, 126, 234, 0.7);
        text-shadow: 0 0 10px rgba(102, 126, 234, 0.8), 0 0 20px rgba(102, 126, 234, 0.4);
    }
}

/* Rate info removed - курс рассчитывается автоматически */

.address-input {
    margin-bottom: 20px;
}

.address-input label {
    display: block;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    font-size: calc(var(--font-size-sm) * 1.2);
}

.address-input input {
  width: 100%;
  height: 70px;
  padding: 20px 30px;
  font-size: calc(var(--font-size-base) * 1.3);
  border: 1px solid rgba(102, 126, 234, 0.25);
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
  background: rgba(15, 15, 25, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: rgba(255, 255, 255, 0.95);
  box-shadow: none;
  box-sizing: border-box;
}

.address-input input:focus {
  outline: none;
  border-color: rgba(102, 126, 234, 0.5);
  background: rgba(20, 20, 35, 0.9);
  box-shadow: 0 0 15px rgba(102, 126, 234, 0.15);
}

.address-input input::placeholder {
    color: rgba(255, 255, 255, 0.6);
    opacity: 0.7;
}


.order-type {
    margin-bottom: 30px;
}

.order-type label {
    display: block;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.type-buttons {
    display: flex;
    gap: var(--spacing-sm);
}

.type-btn {
  flex: 1;
  padding: 14px;
  border: 1px solid rgba(102, 126, 234, 0.2);
  border-radius: var(--radius-md);
  background: rgba(15, 15, 25, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  cursor: pointer;
  transition: all var(--transition-base);
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  text-shadow: none;
  box-shadow: none;
}

.type-btn:hover {
  background: rgba(25, 25, 40, 0.9);
  border-color: rgba(102, 126, 234, 0.4);
  transform: translateY(-1px);
}

.type-btn.active {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.9) 0%, rgba(118, 75, 162, 0.9) 100%);
  color: rgba(255, 255, 255, 0.95);
  text-shadow: none;
  border-color: rgba(102, 126, 234, 0.6);
  box-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
}

.exchange-btn {
  width: 100%;
  padding: 16px;
  background: rgba(40, 40, 60, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: rgba(255, 255, 255, 0.6);
  text-shadow: none;
  border: 1px solid rgba(102, 126, 234, 0.2);
  border-radius: var(--radius-md);
  font-size: var(--font-size-lg);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-base);
  box-shadow: none;
  position: relative;
  overflow: hidden;
}

.exchange-btn.active {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.9) 0%, rgba(118, 75, 162, 0.9) 100%);
  color: rgba(255, 255, 255, 0.95);
  border-color: rgba(102, 126, 234, 0.5);
  box-shadow: 0 0 25px rgba(102, 126, 234, 0.3);
}

.exchange-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.exchange-btn:hover:not(:disabled)::before {
    left: 100%;
}

.exchange-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, rgba(102, 126, 234, 1) 0%, rgba(118, 75, 162, 1) 100%);
  color: rgba(255, 255, 255, 0.95);
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 0 30px rgba(102, 126, 234, 0.4);
}

.exchange-btn:disabled {
  background: rgba(40, 40, 60, 0.6);
  color: rgba(255, 255, 255, 0.4);
  cursor: not-allowed;
  opacity: 0.6;
  box-shadow: none;
}

.order-result {
    margin-top: var(--spacing-xl);
    padding: var(--spacing-lg);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-glass);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.order-result::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
}

@media (max-width: 768px) {
    .exchange-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .swap-btn {
        transform: rotate(90deg);
        align-self: center;
        margin-top: 0;
        margin-bottom: 0;
    }
    
    /* Анимация через JS-класс на мобильных */
    .swap-btn.swapping {
        transform: rotate(270deg) !important;
    }

    header h1 {
        font-size: 2rem;
    }
}

/* Предотвращаем горизонтальный скролл глобально */
html, body {
    overflow-x: hidden !important;
    max-width: 100vw;
}

/* ===== FOOTER STYLES ===== */
footer {
    margin-top: 60px;
    padding: 40px 0 20px;
    background: linear-gradient(180deg, transparent 0%, rgba(10, 10, 20, 0.5) 100%);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1.5fr;
    gap: 40px;
    margin-bottom: 32px;
}

.footer-section h3 {
    font-size: 1rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 16px;
}

.footer-section p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    line-height: 1.6;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: rgba(255, 255, 255, 0.95);
}

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

.social-link {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    padding: 6px 0;
}

.social-link:hover {
    color: rgba(255, 255, 255, 0.95);
}

.social-link svg {
    flex-shrink: 0;
}

.copy-tooltip {
    position: absolute;
    right: -90px;
    background: rgba(16, 185, 129, 0.9);
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s ease;
    pointer-events: none;
    white-space: nowrap;
}

.copy-tooltip.show {
    opacity: 1;
    transform: translateX(0);
}

.social-link.email-link {
    position: relative;
}

.footer-bottom {
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    text-align: center;
}

.footer-bottom p {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.85rem;
}

.footer-terms-link {
    display: inline-block;
    margin-top: 12px;
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.footer-terms-link:hover {
    color: rgba(255, 255, 255, 0.8);
}

/* ===== ORDER TYPE HELP BUTTON ===== */
.type-buttons {
    display: flex;
    align-items: center;
}

.type-help-btn {
    position: relative;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.3), rgba(139, 92, 246, 0.3));
    border: 1px solid rgba(99, 102, 241, 0.4);
    color: #a5b4fc;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 10px;
    flex-shrink: 0;
    padding: 0;
    line-height: 1;
}

.type-help-btn:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.5), rgba(139, 92, 246, 0.5));
    border-color: rgba(99, 102, 241, 0.6);
    color: #c4b5fd;
}

.type-help-tooltip {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 10px);
    transform: translateX(-50%) translateY(5px);
    background: linear-gradient(135deg, rgba(30, 30, 50, 0.98), rgba(20, 20, 40, 0.98));
    border: 1px solid rgba(99, 102, 241, 0.4);
    border-radius: 8px;
    padding: 8px 14px;
    white-space: nowrap;
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
    font-weight: 500;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    z-index: 100;
    pointer-events: none;
}

.type-help-btn:hover .type-help-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.type-help-tooltip::before {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -6px;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(99, 102, 241, 0.4);
}

.type-help-tooltip::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -4px;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(30, 30, 50, 0.98);
}

/* ===== MODAL STYLES ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.modal-content {
    background: linear-gradient(145deg, rgba(25, 25, 45, 0.98), rgba(15, 15, 30, 0.98));
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 20px;
    padding: 32px;
    max-width: 560px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5), 0 0 40px rgba(99, 102, 241, 0.1);
    animation: modalSlideIn 0.3s ease;
}

.modal-section-last {
    border-bottom: none !important;
    margin-bottom: 16px !important;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-30px) scale(0.95);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.modal-close:hover {
    background: rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    transform: rotate(90deg);
}

.modal-title {
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 24px;
    padding-right: 40px;
    text-align: center;
}

.modal-section {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-section:last-of-type {
    border-bottom: none;
    margin-bottom: 20px;
}

.modal-section h3 {
    font-size: 1.15rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 12px;
}

.modal-section p {
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.7;
    margin-bottom: 12px;
}

.modal-section ul {
    list-style: none;
    padding: 0;
    margin: 0 0 12px 0;
}

.modal-section li {
    color: rgba(255, 255, 255, 0.7);
    padding: 6px 0 6px 24px;
    position: relative;
    line-height: 1.6;
}

.modal-section li::before {
    content: "•";
    position: absolute;
    left: 8px;
    color: #a5b4fc;
}

.modal-highlight {
    padding: 14px 18px;
    border-radius: 12px;
    margin-top: 12px;
}

.modal-highlight.warning {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.15), rgba(245, 158, 11, 0.1));
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.modal-highlight.warning strong {
    color: #fcd34d;
}

.modal-highlight.info {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(139, 92, 246, 0.1));
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.modal-highlight.info strong {
    color: #a5b4fc;
}

.modal-highlight p,
.modal-highlight {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.92rem;
    line-height: 1.6;
    margin: 0;
}

.modal-ok-btn {
    display: block;
    width: 100%;
    max-width: 200px;
    margin: 0 auto;
    padding: 14px 28px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-ok-btn:hover {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
}

/* Modal scrollbar */
.modal-content::-webkit-scrollbar {
    width: 6px;
}

.modal-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.4);
    border-radius: 3px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, 0.6);
}

@media (max-width: 768px) {
    .modal-content {
        padding: 24px;
        max-height: 90vh;
    }
    
    .modal-title {
        font-size: 1.25rem;
    }
    
    .modal-section h3 {
        font-size: 1.05rem;
    }
    
    .type-help-btn {
        width: 24px;
        height: 24px;
        font-size: 12px;
    }
}

@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 24px;
        text-align: center;
    }
    
    .footer-links {
        align-items: center;
    }
    
    .social-links {
        justify-content: center;
        flex-wrap: wrap;
    }
}

/* ===== CONTACT BUTTON ===== */
.contact-button-wrapper {
    text-align: center;
    margin-top: 32px;
}

.contact-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    background: linear-gradient(145deg, rgba(30, 30, 50, 0.8), rgba(20, 20, 35, 0.9));
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.contact-btn:hover {
    background: linear-gradient(145deg, rgba(40, 40, 60, 0.9), rgba(30, 30, 50, 0.95));
    border-color: rgba(99, 102, 241, 0.3);
    color: rgba(255, 255, 255, 0.95);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.contact-btn svg {
    flex-shrink: 0;
}

/* ===== LANGUAGE SWITCHER ===== */
.language-switcher {
    position: relative;
    z-index: 99999;
}

.lang-current {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: rgba(30, 30, 50, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.lang-current:hover {
    background: rgba(40, 40, 60, 0.9);
    border-color: rgba(99, 102, 241, 0.3);
}

.lang-flag {
    font-size: 1.1rem;
}

.lang-code {
    font-weight: 600;
    font-size: 0.85rem;
}

.lang-arrow {
    font-size: 0.7rem;
    opacity: 0.6;
    transition: transform 0.3s ease;
}

.language-switcher.open .lang-arrow {
    transform: rotate(180deg);
}

.lang-dropdown {
    position: fixed;
    min-width: 160px;
    background: rgba(25, 25, 40, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transform: scaleY(0);
    transform-origin: top center;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    z-index: 999999;
}

.language-switcher.open .lang-dropdown {
    opacity: 1;
    visibility: visible;
    transform: scaleY(1);
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.lang-option:hover {
    background: rgba(99, 102, 241, 0.2);
    color: rgba(255, 255, 255, 1);
}

.lang-option.active {
    background: rgba(99, 102, 241, 0.15);
    color: rgba(99, 102, 241, 1);
}

.lang-name {
    flex: 1;
}

.lang-code-small {
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(99, 102, 241, 0.8);
    min-width: 24px;
}

.lang-check {
    color: rgba(99, 102, 241, 1);
    font-weight: bold;
}

/* Header with language switcher */
.header-top {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    position: relative;
    overflow: visible;
}

.header-top .logo-link {
    /* Логотип остается по центру */
}

.header-top .language-switcher {
    position: absolute;
    right: 0;
    top: 0;
}

header {
    position: relative;
    z-index: 99999;
    overflow: visible;
}

.container {
    overflow: visible;
}

/* ===== FOOTER LINKS (Terms + Partner) ===== */
.footer-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 16px;
}

.footer-terms-link,
.footer-partner-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.7) !important;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.footer-terms-link:hover,
.footer-partner-link:hover {
    color: rgba(255, 255, 255, 1) !important;
}

/* Currency unavailable warning */
.currency-dropdown-item.currency-item-disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.currency-dropdown-item.currency-item-disabled:hover {
    background: rgba(255, 255, 255, 0.03);
}

.currency-item-warning {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    padding: 4px 8px;
    background: rgba(251, 191, 36, 0.15);
    border: 1px solid rgba(251, 191, 36, 0.3);
    border-radius: 6px;
    font-size: 0.7rem;
    color: #fcd34d;
}

.currency-item-warning .warning-icon {
    font-size: 0.8rem;
}

.currency-item-warning .warning-text {
    line-height: 1.3;
}


