:root {
    --bg-color: #0d0d11;
    --card-color: #1a1a21;
    --border-color: #2a2a33;
    --text-color: #eaeaef;
    --text-secondary: #8d8d9a;
    --primary-color: #00e079;
    --accent-color: #0088cc;
    --red-color: #ff4d4d;
    --ticker-height: 60px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding-top: var(--ticker-height);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* Preloader */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--bg-color);
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.preloader.fade-out {
    opacity: 0;
    pointer-events: none;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.hidden {
    display: none !important;
}

/* Ticker */
.crypto-ticker {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--ticker-height);
    overflow: hidden;
    white-space: nowrap;
    z-index: 1000;
    display: flex;
    align-items: center;
    background-color: var(--card-color);
    border-bottom: 1px solid var(--border-color);
}

.ticker-content {
    display: inline-flex;
    align-items: center;
    animation: ticker-scroll 40s linear infinite;
}

.ticker-item {
    display: inline-flex;
    align-items: center;
    margin: 0 20px;
    height: 100%;
}

.crypto-icon {
    width: 32px;
    height: 32px;
    margin-right: 12px;
    flex-shrink: 0;
}

.crypto-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.crypto-info .name {
    font-weight: bold;
    font-size: 16px;
    color: var(--text-color);
}

.crypto-info .price {
    font-size: 14px;
    color: var(--text-secondary);
}

.sparkline {
    width: 80px;
    height: 30px;
    margin: 0 12px;
    flex-shrink: 0;
}

.crypto-change {
    font-size: 16px;
    font-weight: 700;
}

.change-up { color: var(--primary-color); }
.change-down { color: var(--red-color); }

@keyframes ticker-scroll {
    0% { transform: translateX(0%); }
    100% { transform: translateX(-50%); }
}

/* Main Container */
.container {
    padding: 16px;
    max-width: 600px;
    margin: 0 auto;
}

.card {
    background-color: var(--card-color);
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 16px;
    border: 1px solid var(--border-color);
}

.animated-card {
    opacity: 0;
    transform: translateY(20px);
    animation: card-fade-in 0.6s ease-out forwards;
}

.animated-card:nth-of-type(1) { animation-delay: 0.1s; }
.animated-card:nth-of-type(2) { animation-delay: 0.2s; }
.animated-card:nth-of-type(3) { animation-delay: 0.3s; }
.animated-card:nth-of-type(4) { animation-delay: 0.4s; }
.animated-card:nth-of-type(5) { animation-delay: 0.5s; }

@keyframes card-fade-in {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Typography */
h1, h2 {
    text-align: center;
    font-weight: 800;
    color: var(--text-color);
    margin-top: 0;
}

h1 {
    font-size: clamp(1.8em, 5vw, 2.2em);
    margin-bottom: 10px;
}

h2 {
    font-size: clamp(1.4em, 4vw, 1.8em);
    margin-bottom: 20px;
}

p {
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.hero p {
    text-align: center;
    margin-bottom: 25px;
}

/* Buttons */
.btn {
    text-decoration: none;
    padding: 14px 16px;
    border-radius: 14px;
    font-weight: 700;
    font-size: 16px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    width: 100%;
    text-align: center;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background-color: var(--primary-color);
    color: #000;
}

.btn-secondary {
    background-color: #3a3a3c;
    color: var(--text-color);
}

.btn-icon {
    margin-right: 8px;
    font-size: 20px;
}

.hero-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}


/* --- 🔥🔥🔥 НАЧАЛО: СТИЛИ КАЛЬКУЛЯТОРА (с <select>) 🔥🔥🔥 --- */
.calculator.card {
    overflow: visible;
}

.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.input-group input[type="number"] {
    flex-grow: 1;
    padding: 14px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-color);
    color: var(--text-color);
    font-size: 1.2em;
    font-weight: 700;
    box-sizing: border-box;
    -moz-appearance: textfield;
}

.input-group input[type="number"]::-webkit-outer-spin-button,
.input-group input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Стили для "таблеток" */
.currency-pills {
    display: flex;
    gap: 8px;
    background-color: var(--bg-color);
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 16px; /* Отступ до нового dropdown */
}

.currency-pill {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 10px 5px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 700;
    font-family: 'Manrope', sans-serif;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.currency-pill.active {
    background-color: var(--card-color);
    color: var(--text-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.currency-pill:not(.active):active {
    background-color: rgba(255, 255, 255, 0.05);
}

/* 🔥 НОВЫЕ СТИЛИ ДЛЯ <select> (копируем стили из .form-group) */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 0.9em;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-group input[type="text"],
.form-group input[type="number"], /* Добавили для калькулятора */
.form-group textarea,
.form-group select { /* 🔥 Вот он */
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-color);
    color: var(--text-color);
    font-size: 1em;
    font-weight: 600;
    box-sizing: border-box;
    font-family: 'Manrope', sans-serif;
    -webkit-appearance: none; /* Убираем стандартный вид */
    -moz-appearance: none;
    appearance: none;
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%238d8d9a%22%20d%3D%22M287%2069.4a17.6%2017.6%0%200%200-13-5.4H18.4c-5%200-9.3%201.8-13%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2013l128%20128c3.6%203.6%207.8%205.4%2013%205.4s9.4-1.8%2013-5.4l128-128c3.6-3.6%205.4-7.8%205.4-13%200-5-1.8-9.4-5.4-13z%22%2F%3E%3C%2Fsvg%3E');
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 10px 10px;
    padding-right: 40px; /* Место для стрелки */
}
/* 🔥 КОНЕЦ НОВЫХ СТИЛЕЙ */


.commission-result p {
    margin: 8px 0;
    font-size: 1.1em;
    text-align: center;
}

.commission-result span {
    font-weight: bold;
    color: var(--primary-color);
}

/* Стили для 3D-анимации "переворота" */
.value-wrapper {
    display: inline-block;
    perspective: 300px;
}

.value-wrapper > span {
    display: inline-block;
    transition: all 0.2s ease;
}

.value-wrapper > span.value-flip {
    animation: flip-in 0.4s ease-out;
}

@keyframes flip-in {
    from {
        transform: rotateX(-90deg);
        opacity: 0;
    }
    to {
        transform: rotateX(0);
        opacity: 1;
    }
}
/* --- 🔥🔥🔥 КОНЕЦ: СТИЛИ КАЛЬКУЛЯТОРА 🔥🔥🔥 --- */


/* Features (Выравнивание "кривых" блоков) */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
}

.feature-item {
    background-color: var(--bg-color);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.feature-icon {
    font-size: 2.5em;
    margin-bottom: 12px;
}

.feature-item h3 {
    font-size: 1.1em;
    font-weight: 700;
    color: var(--text-color);
    margin: 0 0 8px 0;
}

.feature-item p {
    font-size: 0.9em;
    margin: 0;
    flex-grow: 1; 
}

/* Live Feed */
.feed-container {
    max-height: 250px;
    overflow-y: auto;
    display: flex;
    flex-direction: column-reverse;
}

.feed-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 5px;
    border-bottom: 1px solid var(--border-color);
    opacity: 0;
    animation: feed-fade-in 0.5s ease forwards;
}

@keyframes feed-fade-in {
    to { opacity: 1; }
}

.feed-info {
    display: flex;
    align-items: center;
}

.feed-status {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 12px;
    flex-shrink: 0;
}

.status-completed { background-color: #2979ff; }
.status-paid { background-color: var(--primary-color); }
.status-pending { background-color: #ffab00; }

.feed-id {
    font-size: 0.9em;
    color: var(--text-secondary);
}

.feed-amount {
    font-weight: bold;
    font-size: 1.1em;
    color: var(--text-color);
    white-space: nowrap;
    margin-left: 10px;
}

/* FAQ */
details {
    border-bottom: 1px solid var(--border-color);
}

details:last-of-type {
    border-bottom: none;
}

summary {
    list-style: none;
    cursor: pointer;
    padding: 15px 5px;
    font-size: 1em;
    font-weight: 700;
    color: var(--text-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    -webkit-tap-highlight-color: transparent;
}

summary::-webkit-details-marker { display: none; }

summary::after {
    content: '+';
    font-size: 1.5em;
    color: var(--text-secondary);
    transition: transform 0.3s ease;
}

details[open] > summary::after {
    transform: rotate(45deg);
}

.faq-answer {
    padding: 0 5px 15px;
    animation: faq-fade-in 0.3s ease-out;
}

@keyframes faq-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Tariffs (Выравнивание "кривых" блоков) */
.tariffs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
}

.tariff-card {
    background-color: var(--bg-color);
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    font-size: 1.5em;
    font-weight: bold;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.tariff-card span {
    display: block;
    font-size: 0.6em;
    font-weight: normal;
    color: var(--text-secondary);
    margin-top: 5px;
}

/* Modal */
.deal-form-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}

.deal-form-modal.visible {
    opacity: 1;
    visibility: visible;
    transition-delay: 0s;
}

.deal-form-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
}

.deal-form-modal .deal-form-content {
    z-index: 2010;
    width: 90%;
    max-width: 500px;
    margin: 0;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.deal-form-modal.visible .deal-form-content {
    transform: scale(1);
}

/* Стили для <select> в модальном окне */
.deal-form-modal .form-group {
    margin-bottom: 16px;
}

.deal-form-modal .form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 24px;
}

/* Utility */
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Responsive */
@media (max-width: 480px) {
    .container {
        padding: 12px;
    }
    
    .card {
        padding: 20px;
    }
    
    .hero-buttons {
        grid-template-columns: 1fr;
    }
    
    .features-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    .currency-pills {
        flex-wrap: wrap; 
    }
    .currency-pill {
        flex-basis: 18%;
        flex-grow: 1;
    }
}