﻿:root {
    --primary: #72b543;
    --primary-dark: #5b9836;
    --primary-light: #f3f8ef;

    --background: #f5f7f3;
    --surface: #ffffff;

    --text: #2d2d2d;
    --text-light: #666666;

    --border: #d9e4d2;

    --success: #3ca84a;
    --danger: #d9534f;

    --shadow: 0 2px 8px rgba(0, 0, 0, .08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-family: Segoe UI, Arial, sans-serif;
    font-size: 15px;

    scrollbar-gutter: stable; /* Резервирует место под скроллбар, иначе съезжает немного вправо, когда карточек нет */
}

body {
    background: var(--background);
    color: var(--text);
}

.container {
    width: min(1400px, 95%);
    margin: auto;
}

/**************************************************
 HEADER
 **************************************************/

.header {
    background: white;
    border-bottom: 4px solid var(--primary);
    box-shadow: var(--shadow);
}

.header-content {
    display: flex;
    align-items: center;
    padding: 20px 0;

}

.logo-block {
    display: flex;
    align-items: center;
    gap: 18px;
}

.logo {

    width: 58px;
    height: 58px;

    border-radius: 8px;
    background: var(--primary);
    color: white;

    display: flex;
    justify-content: center;
    align-items: center;

    font-size: 30px;
    font-weight: bold;

}

.site-title {
    color: var(--primary-dark);
    font-size: 30px;
}

.site-subtitle {
    margin-top: 5px;
    color: var(--text-light);
}

/**************************************************
 MAIN
 **************************************************/

main {
    padding: 30px 0;
}

.section-title {
    font-size: 26px;
    margin-bottom: 20px;
    color: var(--primary-dark);
}

/**************************************************
 FILTERS
 **************************************************/

/*.filters {*/
/*    display: flex;*/
/*    gap: 15px;*/
/*    flex-wrap: wrap;*/
/*    margin-bottom: 35px;*/
/*}*/

.filters {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 35px;
    align-items: center;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.cards-count {
    color: var(--text-light);
    font-size: 14px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 6px 14px;
}

.filters input,
.filters select {
    border: 1px solid var(--border);
    border-radius: 6px;
    background: white;
    padding: 12px 14px;
    font-size: 15px;
}

.filters input {
    flex: 1;
    min-width: 300px;
}

.filters select {
    width: 220px;
}

/**************************************************
 Загрузчик карточек
 **************************************************/

.loader {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 60px 0;
    gap: 15px;
    color: var(--text-light);
    font-size: 16px;
}

.loader-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loader-small {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    padding: 20px 0;
    color: var(--text-light);
}

.loader-small .loader-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid var(--border);
    border-top: 2px solid var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    font-weight: 500;
}

/**************************************************
 CARDS
 **************************************************/

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 22px;
}

.ced-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: .2s;
}

.ced-card:hover {
    transform: translateY(-3px);
}

.card-header {
    background: var(--primary-light);
    border-bottom: 1px solid var(--border);
    padding: 18px 20px;
}

.ced-name {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.35;
}

.card-header-bottom {
    margin-top: 10px;

    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ced-code {
    color: #777;
    font-size: 14px;
    font-family: Consolas, monospace;
}

.card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.details-button {

    width: 26px;
    height: 26px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: transparent;
    border: none;
    border-radius: 50%;
    color: #666;
    cursor: pointer;
    transition: .15s;

}

.details-button:hover {
    background: var(--primary);
    color: white;
}

.details-button svg {
    width: 16px;
    height: 16px;

}

.status-placeholder {
    width: 15px;
    height: 15px;

    border-radius: 50%;
    background: #cccccc;

}

.card-body {
    padding: 20px;
}

.info-row {
    display: flex;
    margin-bottom: 14px;
    align-items: flex-start;
}

.info-row:last-child {
    margin-bottom: 0;
}

.label {
    width: 110px;
    flex-shrink: 0;
    color: var(--text-light);
    font-weight: 600;
}

.value {
    flex: 1;
    word-break: break-word;
}

.email a {
    color: #005ea8;
    text-decoration: none;
}

.email a:hover {
    text-decoration: underline;
}


/* ===========================================
   MODAL
   =========================================== */

.modal{
    position:fixed;
    inset:0;
    background:rgba(0,0,0,.45);
    display:none;
    justify-content:center;
    align-items:center;
    z-index:9999;
}

.modal.show{
    display:flex;
}

.modal-window{
    width:min(900px,95vw);
    max-height:90vh;
    overflow:auto;
    background:white;
    border-radius:10px;
    box-shadow:0 20px 60px rgba(0,0,0,.25);
}

.modal-header{
    background:var(--primary-light);
    border-bottom:1px solid var(--border);
    padding:20px 24px;
    display:flex;
    justify-content:space-between;
    align-items:flex-start;
}

.modal-title{
    font-size:24px;
    font-weight:600;
    color:var(--primary-dark);
}

.modal-subtitle{
    margin-top:6px;
    color:#666;
}

.modal-code{
    margin-top:10px;
    display:inline-block;
    padding:4px 10px;
    border-radius:12px;
    background:#eaf4df;
    color:var(--primary-dark);
    font-family:Consolas, monospace;
}

.close-button{
    border:none;
    background:none;
    font-size:28px;
    cursor:pointer;
    color:#666;
}

.close-button:hover{
    color:var(--primary-dark);
}

.modal-content{
    padding:25px;
}

.modal-section{
    margin-bottom:30px;
}

.modal-section-title{
    font-size:18px;
    color:var(--primary-dark);
    margin-bottom:14px;
    padding-bottom:6px;
    border-bottom:2px solid var(--primary-light);
}

.modal-grid{
    display:grid;
    grid-template-columns:220px 1fr;
    row-gap:12px;
}

.modal-label{
    color:#666;
    font-weight:600;
}

.modal-value{
    word-break:break-word;
}


/**************************************************
 TOOLS
 **************************************************/

.tools {
    margin-top: 50px;
}

.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;

}

.tool-card {
    display: block;
    text-decoration: none;
    color: inherit;
    background: white;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 28px;
    box-shadow: var(--shadow);
    transition: .2s;
}

.tool-card:hover {
    border-color: var(--primary);
    transform: translateY(-3px);
}

.tool-icon {
    font-size: 42px;
}

.tool-title {
    margin-top: 15px;
    font-size: 19px;
    font-weight: 600;
    color: var(--primary-dark);
}

.tool-description {
    margin-top: 10px;
    color: var(--text-light);
    line-height: 1.5;
}

.services-menu .tool-card {
    display: flex;
    align-items: center;
    gap: 18px;
}

.currency-date {
    color: var(--text-light);
    font-size: 14px;
}

.up {
    color: #2e7d32;
    font-weight: 600;
}

.down {
    color: #c62828;
    font-weight: 600;
}

.currency-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 30px;
    margin-bottom: 24px;
    padding: 14px 20px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow);
    text-decoration: none;
    color: inherit;
    transition: .2s;
}

.currency-banner:hover {
    border-color: var(--primary);
}

.currency-banner-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.currency-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-dark);
}

.currency-date {
    font-size: 14px;
    color: var(--text-light);
}

.currency-values {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.currency-item {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    font-size: 15px;
}

.currency-item strong {
    font-size: 18px;
    font-weight: 600;
}

.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

@media (max-width: 900px) {
    .currency-banner {
        flex-direction: column;
        align-items: flex-start;
    }

    .currency-values {
        width: 100%;
        justify-content: space-between;
        gap: 16px;
    }
}

/**************************************************
 CURRENCY POPUP
 **************************************************/

.currency-popup {
    position: fixed;
    z-index: 1000;
    min-width: 560px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0,0,0,.15);
    padding: 14px;
    font-size: 14px;
}

.currency-popup.hidden {
    display: none;
}

.currency-popup table {
    width: 100%;
    border-collapse: collapse;
}

.currency-popup th,
.currency-popup td {
    padding: 6px 10px;
    border-bottom: 1px solid #eee;
    text-align: right;
}

.currency-popup th:first-child,
.currency-popup td:first-child {
    text-align: left;
}

.currency-popup tr:last-child td {
    border-bottom: none;
}

.currency-popup .up {
    color: #2e7d32;
}

.currency-popup .down {
    color: #c62828;
}

/**************************************************
 FOOTER
 **************************************************/

footer {
    margin-top: 50px;
    padding: 25px;
    border-top: 1px solid var(--border);
    color: #777;
    text-align: center;
    background: white;
}

/**************************************************
 MOBILE
 **************************************************/

@media (max-width: 900px) {

    .cards {
        grid-template-columns:1fr;
    }

    .filters {
        flex-direction: column;
    }

    .filters input,
    .filters select {
        width: 100%;
    }

}

@media (max-width: 600px) {

    .logo {
        width: 48px;
        height: 48px;
        font-size: 24px;
    }

    .site-title {
        font-size: 24px;
    }

    .section-title {
        font-size: 22px;
    }

    .info-row {
        flex-direction: column;
        gap: 4px;
    }

    .label {
        width: auto;
    }

}