:root {
    --tenant-primary-color: #1778bc;
    --tenant-secondary-color: #fbba10;
    --tenant-logo-primary-color: #1778bc;
    --tenant-logo-secondary-color: #fbba10;
    --tenant-primary-button-bg-color: #fbba10;
    --tenant-primary-button-hover-bg-color: #e1a70e;
    --tenant-secondary-button-bg-color: #2e85c2;
    --tenant-secondary-button-hover-bg-color: #1778bc;
    --tenant-primary-bg-color: #1778bc;
    --tenant-secondary-bg-color: #ececf0;
    --tenant-link-color: #146ca9;
    --primary-font-family: "Lexend", Roboto, Helvetica, Arial, sans-serif;
    --secondary-font-family: Roboto, Helvetica, "Segoe UI", Arial, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--secondary-font-family);
    background: #f4f4f7;
    color: #444;
    line-height: 1.6;
}

/* Header */
#header {
    background: var(--tenant-primary-bg-color);
    padding: 12px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
}

.logo {
    color: white;
    font-family: var(--primary-font-family);
    font-size: 32px;
    font-weight: 800;
    font-style: italic;
    text-decoration: none;
    display: inline-block;
}

.logo .t1 {
    text-transform: lowercase;
}

.logo .t2 {
    color: var(--tenant-secondary-color);
}

.logo .t3 {
    color: white;
}

/* Container */
.rmd-container {
    max-width: 500px;
    margin: 40px auto;
    padding: 0 20px;
}

.login-page-content {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.content-data {
    padding: 40px 35px;
}

.text-center {
    text-align: center;
}

/* Заголовки */
h1 {
    font-family: var(--primary-font-family);
    font-size: 26px;
    font-weight: 600;
    color: #222;
    margin-bottom: 25px;
}

h2 {
    font-family: var(--primary-font-family);
    font-size: 20px;
    font-weight: 600;
    color: #222;
    margin-bottom: 15px;
}

/* Кнопки социальных сетей */
.login-buttons-row {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 25px;
}

.facebook-login-btn,
.google-login-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 20px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
    color: #444;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.facebook-login-btn:hover {
    background: #f8f8f8;
    border-color: #3b5998;
}

.google-login-btn:hover {
    background: #f8f8f8;
    border-color: #4285f4;
}

.facebook-login-icon svg,
.google-login-icon svg {
    width: 20px;
    height: 20px;
    fill: #3b5998;
}

.google-login-icon svg {
    fill: #4285f4;
}

/* Разделитель ИЛИ */
.separator {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 25px 0;
    color: #999;
    font-size: 13px;
}

.separator::before,
.separator::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #ddd;
}

.separator span {
    padding: 0 15px;
}

/* Форма */
form {
    text-align: left;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #444;
    font-size: 14px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    font-size: 14px;
    font-family: var(--secondary-font-family);
    transition: border-color 0.3s, box-shadow 0.3s;
    background: white;
}

input:focus,
textarea:focus {
    outline: none;
    border-color: var(--tenant-primary-color);
    box-shadow: 0 0 0 3px rgba(23, 120, 188, 0.1);
}

input::placeholder,
textarea::placeholder {
    color: #999;
}

/* Основная кнопка */
.btn,
input[type="submit"] {
    width: 100%;
    padding: 14px;
    background: var(--tenant-primary-button-bg-color);
    color: #222;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--primary-font-family);
    transition: background 0.3s;
    margin-top: 5px;
}

.btn:hover,
input[type="submit"]:hover {
    background: var(--tenant-primary-button-hover-bg-color);
}

.btn:disabled,
input[type="submit"]:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.successbg {
    background: var(--tenant-primary-button-bg-color) !important;
}

.radius {
    border-radius: 6px !important;
}

.expand {
    width: 100%;
}

/* Ссылки */
.row.text-center {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.row.text-center a {
    color: var(--tenant-link-color);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s;
}

.row.text-center a:hover {
    color: var(--tenant-primary-color);
    text-decoration: underline;
}

.maincolor {
    color: var(--tenant-link-color) !important;
}

/* Ошибки */
.error,
.alert-box.errormessage {
    background: #fef3f2;
    border: 1px solid #fac6bd;
    color: #f04124;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 14px;
    display: none;
}

.error.show,
.alert-box.errormessage:not(.hidden) {
    display: block;
}

.validation-summary-errors {
    background: #fef3f2;
    border: 1px solid #fac6bd;
    color: #f04124;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 14px;
}

.validation-summary-errors ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.validation-summary-errors ul li {
    margin-bottom: 5px;
}

.validation-summary-valid {
    display: none;
}

.hidden {
    display: none !important;
}

/* Дополнительный текст внизу формы */
.more-tenants-title {
    font-size: 15px;
    font-weight: 500;
    color: #666;
    margin: 30px 0 15px;
    text-align: center;
}

.line-tenants {
    border: 0;
    height: 1px;
    background: #e0e0e0;
    margin: 15px 0;
}

.row-with-logos {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin: 20px 0;
}

.row-with-logos div {
    color: #666;
    font-size: 14px;
}

.row-with-logos span {
    font-weight: 500;
}

/* Информационные блоки */
.info-text {
    background: #fff9e6;
    border: 1px solid #ffd966;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #666;
}

.success {
    background: #e8f5e9;
    border: 1px solid #5da423;
    color: #2e7d32;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 14px;
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--tenant-primary-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Footer */
.footer {
    text-align: center;
    padding: 20px;
    color: #999;
    font-size: 12px;
    margin-top: 30px;
}

/* Card inputs */
.card-input-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* Support chat messages */
.support-chat {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 15px;
    background: #fafafa;
}

.message {
    margin-bottom: 15px;
    padding: 10px;
    border-radius: 6px;
}

.message.user {
    background: #e3f2fd;
    margin-left: 20px;
}

.message.admin {
    background: #f5f5f5;
    margin-right: 20px;
}

.message-time {
    font-size: 11px;
    color: #999;
    margin-top: 5px;
}

/* Waiting animation */
.waiting-animation {
    text-align: center;
    padding: 40px 20px;
}

.dots {
    display: inline-flex;
    gap: 8px;
}

.dot {
    width: 12px;
    height: 12px;
    background: var(--tenant-primary-color);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.dot:nth-child(1) {
    animation-delay: -0.32s;
}

.dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounce {
    0%,
    80%,
    100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

/* Notifications */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 8px;
    padding: 15px 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    min-width: 300px;
    max-width: 400px;
    animation: slideIn 0.3s ease-out;
    display: flex;
    align-items: center;
    gap: 12px;
}

.notification.success {
    border-left: 4px solid #5da423;
}

.notification.error {
    border-left: 4px solid #f04124;
}

.notification.info {
    border-left: 4px solid var(--tenant-primary-color);
}

.notification-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.notification-content {
    flex: 1;
}

.notification-title {
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 14px;
}

.notification-message {
    font-size: 13px;
    color: #666;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Support widget */
.support-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

.support-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--tenant-primary-color);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: transform 0.3s, background 0.3s;
}

.support-button:hover {
    transform: scale(1.1);
    background: var(--tenant-secondary-button-hover-bg-color);
}

.support-window {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 350px;
    max-width: calc(100vw - 40px);
    height: 500px;
    max-height: calc(100vh - 120px);
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 40px rgba(0, 0, 0, 0.16);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 999;
}

.support-window.active {
    display: flex;
}

.support-window-header {
    background: var(--tenant-primary-color);
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.support-window-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.close-chat {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.support-window-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background: #f9f9f9;
}

.support-window-input {
    padding: 15px;
    border-top: 1px solid #ddd;
    background: white;
}

.support-window-input form {
    display: flex;
    gap: 10px;
}

.support-window-input textarea {
    flex: 1;
    min-height: 40px;
    max-height: 80px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: vertical;
    font-size: 14px;
}

.support-window-input button {
    padding: 10px 20px;
    background: var(--tenant-primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s;
}

.support-window-input button:hover {
    background: var(--tenant-secondary-button-hover-bg-color);
}

.support-window-input button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.chat-message {
    margin-bottom: 12px;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-message.user .message-bubble {
    background: #e3f2fd;
    margin-left: 30px;
}

.chat-message.admin .message-bubble {
    background: white;
    margin-right: 30px;
}

.message-bubble {
    padding: 10px 12px;
    border-radius: 12px;
    word-wrap: break-word;
}

.message-sender {
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 4px;
    color: #666;
}

.message-text {
    font-size: 14px;
    color: #222;
    line-height: 1.4;
}

.message-time {
    font-size: 10px;
    color: #999;
    margin-top: 4px;
    text-align: right;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 5px;
}

.read-status {
    color: #4caf50;
    font-size: 12px;
    font-weight: bold;
}

.empty-chat {
    text-align: center;
    color: #999;
    padding: 40px 20px;
    font-size: 14px;
}

/* Mobile responsive */
@media (max-width: 640px) {
    .rmd-container {
        margin: 20px auto;
        padding: 0 15px;
    }

    .content-data {
        padding: 30px 25px;
    }

    h1 {
        font-size: 22px;
    }

    .card-input-group {
        grid-template-columns: 1fr;
    }

    .support-window {
        bottom: 80px;
        right: 10px;
        width: calc(100vw - 20px);
    }

    .support-widget {
        bottom: 10px;
        right: 10px;
    }

    .logo {
        font-size: 28px;
    }
}
