/* Login Container */
.login-container {
    min-height: 100vh;
    background: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

/* Login Card */
.login-cardMain,
.login-card {
    display: flex;
    width: 100%;
    max-width: 700px;
    min-height: 600px;
    background: #2a2a2a;
    border-radius: 8px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

/* Left Panel */
.left-panel {
    background: #0f0f0f;
    width: 200px;
    min-width: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-wrapper {
    position: relative;
    width: 160px;
    height: 160px;
}

.logo-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 160px;
    height: 160px;
}

/* Базовый веном - всегда виден */
.logo-image.base {
    opacity: 1;
    z-index: 1;
}

/* Глаза - поверх базы, пульсируют */
.logo-image.eyes {
    opacity: 0;
    z-index: 2;
    transition: opacity 0.8s ease-in-out;
}

.logo-image.eyes.visible {
    opacity: 1;
}

/* Right Panel */
.right-panel {
    flex: 1;
    background: #2a2a2a;
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Login Header */
.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.brand {
    font-size: 1.6rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 2px;
    margin-bottom: 0.25rem;
}

.brand-accent,
.accent {
    color: #26c6da;
}

.brand-subtitle {
    font-size: 0.75rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 1.5rem;
}

.title {
    color: #fff;
    font-size: 1.4rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

/* Login Form */
.login-form {
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    color: #e9ecef;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.form-label i {
    color: #26c6da;
    margin-right: 0.5rem;
}

.form-control {
    width: 100%;
    background: #1a1a1a;
    border: 1px solid #444;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: #fff;
    font-size: 1rem;
    transition: all 0.2s ease;
    outline: none;
}

.form-control:focus {
    color: #fff;
    background: #1a1a1a;
    border-color: #26c6da;
    box-shadow: 0 0 0 0.2rem rgba(38, 198, 218, 0.25);
}

.form-control::placeholder {
    color: #6c757d;
}

/* Form text helper */
.form-text {
    color: #6c757d;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: block;
}

/* Автозаполнение браузера */
.form-control:-webkit-autofill,
.form-control:-webkit-autofill:hover,
.form-control:-webkit-autofill:focus,
.form-control:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px #1a1a1a inset !important;
    -webkit-text-fill-color: #fff !important;
    box-shadow: 0 0 0 1000px #1a1a1a inset !important;
    caret-color: #fff;
    transition: background-color 5000s ease-in-out 0s;
}

/* Password Input */
.password-input-container {
    position: relative;
}

.password-input-container .form-control {
    padding-right: 3rem;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 0.75rem;
    transform: translateY(-50%);
    border: none;
    background: none;
    color: #6c757d;
    padding: 0.25rem;
    cursor: pointer;
    transition: color 0.2s ease;
    z-index: 10;
}

.password-toggle:hover,
.password-toggle:focus {
    color: #26c6da;
    outline: none;
}

/* Error Message */
.error-message {
    background: #4d1a1a;
    border: 1px solid #ef4444;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    color: #fff;
    font-size: 0.9rem;
}

.error-message strong {
    color: #ef4444;
    margin-right: 0.5rem;
}

/* Captcha */
.captcha-container {
    margin-bottom: 1rem;
}

.captcha-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    justify-content: center;
}

.captcha-image {
    min-width: 180px;
    min-height: 60px;
    border-radius: 6px;
    overflow: hidden;
    background: #1a1a2e;
}

.captcha-image svg {
    display: block;
    vertical-align: top;
}

.captcha-refresh {
    flex-shrink: 0;
    padding: 0.5rem;
}

.checkbox-container {
    background: #1a1a1a;
    border: 1px solid #444;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    transition: all 0.2s ease;
    width: 50%;
    margin: 0 auto;
}

.checkbox-container:focus-within {
    border-color: #26c6da;
    box-shadow: 0 0 0 0.2rem rgba(38, 198, 218, 0.25);
}

.checkbox-label {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    margin: 0;
}

.captcha-checkbox {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: relative;
    height: 16px;
    width: 16px;
    background: #2a2a2a;
    border: 2px solid #444;
    border-radius: 3px;
    margin-right: 8px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.checkbox-label:hover .checkmark {
    border-color: #26c6da;
}

.captcha-checkbox:checked ~ .checkmark {
    background: #26c6da;
    border-color: #26c6da;
}

.captcha-checkbox:checked ~ .checkmark::after {
    content: "";
    position: absolute;
    display: block;
    left: 4px;
    top: 1px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.label-text {
    color: #e9ecef;
    font-weight: 500;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    text-transform: uppercase;
}

.label-text i {
    color: #26c6da;
    margin-right: 0.5rem;
}

/* me-2 Bootstrap spacing */
.me-2 {
    margin-right: 0.5rem !important;
}

/* Спиннер загрузки для капчи */
.captcha-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #444;
    border-top-color: #26c6da;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Скрываем чекмарк во время загрузки */
.checkbox-label.loading .checkmark {
    display: none;
}

/* Отключаем клик во время загрузки */
.checkbox-label.loading {
    pointer-events: none;
}

.checkbox-label.verified {
    pointer-events: none;
}

.checkbox-label.verified .checkmark {
    background: #26c6da;
    border-color: #26c6da;
}

.checkbox-label.verified .checkmark::after {
    content: "";
    position: absolute;
    display: block;
    left: 4px;
    top: 1px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Login Button */
.login-button {
    width: 100%;
    background: #26c6da;
    border: 1px solid #26c6da;
    border-radius: 4px;
    padding: 0.75rem 1rem;
    font-weight: 600;
    font-size: 1rem;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.login-button:hover:not(:disabled) {
    background: #00acc1;
    border-color: #00acc1;
}

.login-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Login Footer */
.login-footer {
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid #444;
}

.login-footer p {
    color: #6c757d;
    font-size: 0.875rem;
    margin: 0;
}

.login-footer i {
    margin-right: 0.25rem;
}

/* Test Credentials */
.test-credentials {
    margin-top: 1rem;
    padding: 1rem;
    background: #1a1a1a;
    border-radius: 8px;
    border: 1px solid #444;
    text-align: center;
    font-size: 0.875rem;
    color: #6c757d;
}

.test-credentials strong {
    color: #26c6da;
    display: block;
    margin-bottom: 0.5rem;
}

.test-credentials code {
    background: #2a2a2a;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    color: #fff;
    font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 768px) {
    .login-cardMain {
        flex-direction: column;
        max-width: 500px;
        min-height: auto;
    }
    
    .left-panel {
        width: 100%;
        min-width: 100%;
        padding: 2rem;
    }
    
    .right-panel {
        padding: 2rem;
    }
    
    .title {
        font-size: 1.5rem;
    }
}

@media (max-width: 576px) {
    .login-container {
        padding: 1rem;
    }
    
    .left-panel,
    .right-panel {
        padding: 1rem;
    }
    
    .title {
        font-size: 1.3rem;
    }
    .login-header{
        margin-bottom: 1rem;
    }
    .brand {
        font-size: 1.3rem;
    }
    .brand-subtitle {
        font-size: 0.55rem;
        margin-bottom: 1rem;
    }
    .image-wrapper {
        width: 120px;
        height: 120px;
    }
    .logo-image {
        width: 120px;
        height: 120px;
    }
    .test-credentials {
        margin-top: 0rem;
        padding: 0.5rem;
    }
    .test-credentials strong{
        margin-bottom: 0rem;
    }
    .checkbox-container{
        width: 65%;
    } 
    .login-footer{
        border-top: none;
    }
}

/* Селектор типа контакта */
.contact-type-selector {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.contact-type-option {
    flex: 1;
}

.contact-type-option input {
    display: none;
}

.contact-type-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.375rem;
    padding: 0.75rem 0.5rem;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    color: #888;
    font-size: 0.8125rem;
    cursor: pointer;
    transition: all 0.3s;
}

.contact-type-btn i {
    font-size: 1.25rem;
}

.contact-type-option input:checked + .contact-type-btn {
    background: rgba(38,198,218,0.15);
    border-color: #26c6da;
    color: #26c6da;
}

.contact-type-btn:hover {
    border-color: rgba(255,255,255,0.3);
    color: #fff;
}

/* Счётчик символов */
.char-counter {
    float: right;
    color: #666;
}

/* Регистрация */
.auth-divider {
    text-align: center;
    margin: 1.5rem 0;
    position: relative;
}

.auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(255,255,255,0.1);
}

.auth-divider span {
    position: relative;
    background: #2a2a2a;
    padding: 0 1rem;
    color: #666;
    font-size: 0.875rem;
}

.btn-outline-primary {
    width: 100%;
    padding: 0.875rem;
    background: transparent;
    border: 1px solid #26c6da;
    color: #26c6da;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s;
}

.btn-outline-primary:hover {
    background: #26c6da;
    color: #000;
}

.btn-text {
    width: 100%;
    padding: 0.75rem;
    background: transparent;
    border: none;
    color: #888;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.btn-text:hover {
    color: #fff;
}

.message-box {
    padding: 0.875rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.9375rem;
}

.message-box--error {
    background: rgba(255,68,68,0.15);
    border: 1px solid rgba(255,68,68,0.3);
    color: #ff6b6b;
}

.message-box--success {
    background: rgba(0,212,106,0.15);
    border: 1px solid rgba(0,212,106,0.3);
    color: #00d46a;
}

/* Модалка с данными (регистрация партнёра + CSS-confirm) */
.credentials-modal {
    border: none;
    border-radius: 16px;
    background: #1a1a1a;
    padding: 0;
    max-width: 480px;
    width: 90%;
    overflow: visible;
}

.credentials-modal::backdrop {
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(4px);
}

.confirm-toggle-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 0;
    height: 0;
    margin: 0;
}

.reg-success-modal {
    position: relative;
    background: #1a1a1a;
    border-radius: 16px;
    padding: 2rem 1.75rem;
    max-width: 100%;
    overflow: hidden;
}

.reg-success-content {
    position: relative;
    z-index: 0;
}

.reg-success-icon {
    text-align: center;
    margin-bottom: 0.75rem;
}

.reg-success-icon i {
    font-size: 3rem;
    color: #00d46a;
    vertical-align: middle;
}

.reg-success-title {
    text-align: center;
    color: #00d4aa;
    font-size: 1.35rem;
    margin: 0 0 0.5rem;
    font-weight: 600;
}

.reg-success-subtitle {
    text-align: center;
    color: #999;
    font-size: 0.8125rem;
    margin: 0 0 1.25rem;
    line-height: 1.45;
}

.credentials-block {
    background: #0d0d0d;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 1rem 1.125rem;
    font-family: 'SF Mono', Monaco, Consolas, monospace;
    font-size: 0.8125rem;
    line-height: 1.55;
}

.credentials-header,
.credentials-subheader {
    color: #888;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.credentials-sep {
    border-top: 1px dashed rgba(255,255,255,0.12);
    margin: 0.5rem 0;
}

.credentials-row {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    margin: 0.4rem 0;
}

.credentials-label {
    color: #888;
    font-size: 0.6875rem;
}

.credentials-value {
    color: #fff;
    word-break: break-all;
}

.credentials-link {
    color: #00d4aa;
    text-decoration: none;
}

.credentials-link:hover {
    text-decoration: underline;
}

.credentials-secret {
    color: #f5a623;
    font-weight: 600;
}

.btn-copy-credentials {
    width: 100%;
    margin-top: 0.75rem;
    padding: 0.625rem;
    background: transparent;
    border: 1px solid rgba(0, 212, 170, 0.35);
    border-radius: 8px;
    color: #00ffc8;
    cursor: pointer;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: background 0.2s;
}

.btn-copy-credentials:hover {
    background: rgba(0, 255, 200, 0.08);
}

.reg-warning-banner {
    margin-top: 1rem;
    padding: 0.75rem;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    background: rgba(245, 166, 35, 0.1);
    border: 1px solid rgba(245, 166, 35, 0.3);
    border-radius: 8px;
    color: #f5a623;
    font-size: 0.8125rem;
    line-height: 1.45;
}

.reg-warning-banner i {
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.btn-go-cabinet-label {
    display: flex;
    width: 100%;
    margin-top: 1rem;
    padding: 0.875rem;
    background: #26c6da;
    border: none;
    border-radius: 8px;
    color: #000;
    font-size: 0.9375rem;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: filter 0.2s;
    box-sizing: border-box;
}

.btn-go-cabinet-label:hover {
    filter: brightness(1.08);
}

.confirm-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: inherit;
    z-index: 10;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    padding: 1rem;
}

.confirm-toggle-input:checked ~ .confirm-overlay {
    opacity: 1;
    visibility: visible;
}

.confirm-toggle-input:checked ~ .reg-success-content {
    pointer-events: none;
    filter: blur(2px);
    transition: filter 0.2s ease;
}

.confirm-box {
    background: #1a1a2e;
    border: 1px solid rgba(245, 166, 35, 0.55);
    border-radius: 12px;
    padding: 1.5rem 1.25rem;
    max-width: 340px;
    width: 100%;
    text-align: center;
    box-sizing: border-box;
}

.confirm-icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
    color: #f5a623;
}

.confirm-title {
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.35;
}

.confirm-text {
    color: #999;
    font-size: 0.8125rem;
    line-height: 1.5;
    margin: 0 0 1.25rem;
}

.confirm-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.btn-confirm-back {
    flex: 1;
    min-width: 6rem;
    padding: 0.6875rem;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    font-size: 0.8125rem;
    text-align: center;
    transition: background 0.2s;
    box-sizing: border-box;
}

.btn-confirm-back:hover {
    background: rgba(255,255,255,0.08);
}

.btn-confirm-yes {
    flex: 1;
    min-width: 6rem;
    padding: 0.6875rem;
    background: #f5a623;
    border: none;
    border-radius: 8px;
    color: #000;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.8125rem;
    text-align: center;
    text-decoration: none;
    transition: opacity 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.btn-confirm-yes:hover {
    opacity: 0.92;
}

@media screen and (max-width: 460px) {
    .confirm-actions {
        flex-direction: column;
    }
}

/* Переключатель языка */
.language-switcher {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 100;
}

.lang-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    color: #888;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.lang-btn:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.2);
    color: #fff;
}

.lang-btn i {
    font-size: 0.75rem;
    transition: transform 0.2s ease;
}

.lang-dropdown.hidden {
    display: none;
}

.lang-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    min-width: 200px;
    max-height: 400px;
    overflow-y: auto;
    background: #1a1a1a;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    padding: 0.5rem 0;
    z-index: 1000;
}

.lang-dropdown button {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0.625rem 1rem;
    background: transparent;
    border: none;
    color: #e9ecef;
    font-size: 0.875rem;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease;
}

.lang-dropdown button:hover {
    background: rgba(38,198,218,0.1);
    color: #26c6da;
}

.lang-dropdown hr {
    margin: 0.25rem 0;
    border: none;
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* Кастомная полоса прокрутки - маленькая и тёмная */
.lang-dropdown {
    scrollbar-width: thin;
    scrollbar-color: #333 #1a1a1a;
}

.lang-dropdown::-webkit-scrollbar {
    width: 6px;
}

.lang-dropdown::-webkit-scrollbar-track {
    background: #1a1a1a;
    border-radius: 3px;
}

.lang-dropdown::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 3px;
}

.lang-dropdown::-webkit-scrollbar-thumb:hover {
    background: #444;
}

/* RTL поддержка */
[dir="rtl"] .language-switcher {
    right: auto;
    left: 1rem;
}

[dir="rtl"] .lang-dropdown {
    right: auto;
    left: 0;
}

[dir="rtl"] .lang-dropdown button {
    text-align: right;
}

/* Тост: правый нижний угол viewport (узел внутри <dialog> — остаётся в top layer) */
.credentials-modal .login-toast-container {
    position: fixed;
    bottom: max(1.25rem, env(safe-area-inset-bottom, 0px));
    right: max(1.25rem, env(safe-area-inset-right, 0px));
    left: auto;
    top: auto;
    z-index: 2;
    display: flex;
    flex-direction: column-reverse;
    gap: 0.5rem;
    align-items: flex-end;
    pointer-events: none;
    max-width: min(420px, calc(100vw - 2rem));
}

.login-toast-container .login-toast {
    pointer-events: auto;
}

.login-toast {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 240px;
    max-width: min(420px, calc(100vw - 2rem));
    padding: 0.875rem 1.125rem;
    border-radius: 10px;
    background: #252525;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
    color: #e9ecef;
    font-size: 0.9rem;
    line-height: 1.35;
    animation: loginToastIn 0.28s ease;
}

@keyframes loginToastIn {
    from {
        opacity: 0;
        transform: translateX(12px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.login-toast.login-toast--success {
    border-left: 4px solid #00d46a;
}

.login-toast.login-toast--error {
    border-left: 4px solid #f44336;
}

.login-toast i {
    font-size: 1.15rem;
    flex-shrink: 0;
}

.login-toast--success i {
    color: #00d46a;
}

.login-toast--error i {
    color: #f44336;
}

[dir="rtl"] .credentials-modal .login-toast-container {
    right: auto;
    left: max(1.25rem, env(safe-area-inset-left, 0px));
    align-items: flex-start;
}

[dir="rtl"] .credentials-modal .login-toast {
    animation-name: loginToastInRtl;
}

@keyframes loginToastInRtl {
    from {
        opacity: 0;
        transform: translateX(-12px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}
