/* style.css - Лимбанк. Корпоративный стиль */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.bank-wrapper {
    max-width: 1200px;
    width: 100%;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    overflow: hidden;
}

/* Шапка */
.bank-header {
    background: #1a2b4c;
    color: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid #ffd700;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    font-size: 32px;
}

.logo h1 {
    font-size: 28px;
    font-weight: 500;
    letter-spacing: 1px;
}

.security-badge {
    background: rgba(255,255,255,0.1);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 14px;
}

/* Контент */
.bank-content {
    padding: 40px;
    background: #f5f7fa;
}

/* Форма входа */
.login-container {
    max-width: 400px;
    margin: 0 auto;
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.login-container h2 {
    color: #1a2b4c;
    margin-bottom: 10px;
    font-size: 24px;
}

.login-subtitle {
    color: #666;
    margin-bottom: 25px;
    font-size: 14px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #333;
    font-weight: 500;
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input:focus {
    border-color: #1a2b4c;
    outline: none;
}

.hint {
    display: block;
    margin-top: 5px;
    color: #999;
    font-size: 12px;
}

.login-button, .recovery-button {
    width: 100%;
    padding: 14px;
    background: #1a2b4c;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.login-button:hover, .recovery-button:hover {
    background: #2a3c5c;
}

.forgot-password-link {
    text-align: center;
    margin-top: 20px;
}

.forgot-password-link a {
    color: #1a2b4c;
    text-decoration: none;
    font-size: 14px;
}

.forgot-password-link a:hover {
    text-decoration: underline;
}

.bank-info {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    font-size: 13px;
    color: #777;
}

.bank-info p {
    margin-bottom: 5px;
}

/* Ошибки */
.error-message {
    background: #fee;
    color: #c00;
    padding: 12px;
    border-radius: 6px;
    margin-top: 15px;
    font-size: 14px;
    border-left: 4px solid #c00;
}

/* Страница восстановления */
.recovery-container {
    max-width: 500px;
    margin: 0 auto;
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.recovery-subtitle {
    color: #666;
    margin-bottom: 25px;
}

.questions-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px dashed #ccc;
}

.questions-section h3 {
    color: #1a2b4c;
    margin-bottom: 20px;
}

.question-text {
    background: #f5f5f5;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 10px;
    font-weight: 500;
}

.recovery-result {
    margin-top: 20px;
}

.success-box {
    background: #e8f5e9;
    padding: 20px;
    border-radius: 6px;
    border-left: 4px solid #4caf50;
}

.success-box h4 {
    color: #2e7d32;
    margin-bottom: 15px;
}

.success-box .warning {
    color: #f57c00;
    font-size: 13px;
    margin: 15px 0;
}

.back-to-login {
    display: inline-block;
    padding: 10px 20px;
    background: #1a2b4c;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
}

.back-link {
    margin-top: 20px;
    text-align: center;
}

.back-link a {
    color: #666;
    text-decoration: none;
}

/* Почтовый интерфейс */
.mail-layout {
    display: flex;
    min-height: 500px;
}

.mail-sidebar {
    width: 250px;
    background: #2c3e50;
    color: white;
    padding: 20px 0;
}

.user-profile {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    border-bottom: 1px solid #3d5166;
}

.avatar {
    width: 50px;
    height: 50px;
    background: #ffd700;
    color: #1a2b4c;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 20px;
}

.user-details {
    flex: 1;
}

.user-details strong {
    display: block;
    margin-bottom: 5px;
}

.user-details span {
    font-size: 12px;
    color: #a0a0a0;
}

.mail-folders ul {
    list-style: none;
    padding: 20px 0;
}

.mail-folders li {
    padding: 12px 25px;
    cursor: pointer;
    transition: background 0.3s;
    display: flex;
    justify-content: space-between;
}

.mail-folders li:hover {
    background: #3d5166;
}

.mail-folders li.active {
    background: #1a2b4c;
    border-left: 4px solid #ffd700;
}

.count {
    background: #ffd700;
    color: #1a2b4c;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
}

.mail-content {
    flex: 1;
    background: white;
    padding: 20px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.logout-link {
    color: #ffd700;
    text-decoration: none;
    font-size: 14px;
}

.mail-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.mail-table th {
    text-align: left;
    padding: 12px;
    background: #f5f5f5;
    color: #333;
    font-weight: 600;
    font-size: 14px;
}

.mail-table td {
    padding: 15px 12px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
}

.mail-table tr:hover td {
    background: #f9f9f9;
}

/* Детальная страница письма */
.email-detail-container {
    padding: 30px;
    background: white;
}

.email-nav {
    margin-bottom: 25px;
}

.back-button {
    color: #1a2b4c;
    text-decoration: none;
    font-size: 16px;
}

.back-button:hover {
    text-decoration: underline;
}

.email-header {
    border-bottom: 2px solid #eee;
    padding-bottom: 20px;
    margin-bottom: 25px;
}

.email-header h2 {
    color: #1a2b4c;
    margin-bottom: 15px;
}

.email-meta {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 6px;
}

.email-meta p {
    margin: 5px 0;
    color: #555;
}

.email-body {
    line-height: 1.8;
    color: #333;
    min-height: 300px;
}

.email-body p {
    margin-bottom: 15px;
}

/* Подвал */
.bank-footer {
    background: #1a2b4c;
    color: white;
    padding: 15px 30px;
    text-align: center;
    border-top: 1px solid #3d5166;
}

.footer-small {
    font-size: 12px;
    color: #a0a0a0;
    margin-top: 5px;
}
.secondary-button {
    width: 100%;
    padding: 12px;
    background: #4a5a7a;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    margin-bottom: 20px;
    transition: background 0.3s;
}

.secondary-button:hover {
    background: #5a6a8a;
}
.avatar-image {
    width: 50px;
    height: 50px;
    border-radius: 50%;  /* Делает картинку круглой */
    object-fit: cover;   /* Чтобы картинка не искажалась */
    border: 2px solid #ffd700;  /* Золотая рамка */
}
/* Стили для бейджей в почте */
.email-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
    margin-right: 8px;
    color: white;
}

.email-badge.today {
    background: #ff4444;
    animation: pulse 2s infinite;
}

.email-badge.yesterday {
    background: #ff8800;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

/* Счётчик писем в папках */
.mail-folders li .count {
    background: #ffd700;
    color: #1a2b4c;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
}

/* Активное письмо в списке */
.mail-table tr:hover td {
    background: #f0f7ff;
    cursor: pointer;
}

.mail-table td {
    transition: background 0.2s;
}

/* Иконки для разных типов писем */
.mail-table td:first-child {
    position: relative;
    padding-left: 35px;
}

.mail-table td:first-child::before {
    content: "📧";
    position: absolute;
    left: 12px;
    opacity: 0.5;
}

.mail-table tr td:first-child:contains("СРОЧНО")::before {
    content: "❗";
    color: red;
}
/* ========== ИСПРАВЛЕНИЕ ВЫРАВНИВАНИЯ ПОЧТОВЫХ ЯЩИКОВ ========== */

/* Фиксируем ширину боковой панели */
.mail-sidebar {
    width: 280px !important; /* Фиксированная ширина */
    min-width: 280px;
    flex-shrink: 0; /* Запрещаем сжиматься */
}

/* Фиксируем ширину контентной области */
.mail-content {
    flex: 1; /* Занимает оставшееся пространство */
    min-width: 600px; /* Минимальная ширина */
}

/* Выравниваем почтовый контейнер */
.mail-layout {
    display: flex;
    min-height: 600px;
    width: 100%;
    max-width: 1200px; /* Ограничиваем максимальную ширину */
    margin: 0 auto; /* Центрируем */
}

/* Исправляем отступы в боковой панели */
.mail-folders ul {
    padding: 0;
    margin: 0;
    list-style: none;
}

.mail-folders li {
    padding: 12px 20px;
    margin: 0;
    white-space: nowrap; /* Запрещаем перенос текста */
}

/* Фиксируем размеры аватарки */
.user-profile {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    min-height: 90px; /* Фиксированная высота */
}

.avatar {
    width: 50px;
    height: 50px;
    flex-shrink: 0; /* Запрещаем сжиматься */
}

/* Выравниваем таблицу с письмами */
.mail-table {
    width: 100%;
    table-layout: fixed; /* Фиксированная разметка таблицы */
}

.mail-table th,
.mail-table td {
    padding: 12px 15px;
    overflow: hidden;
    text-overflow: ellipsis; /* Добавляем многоточие для длинного текста */
    white-space: nowrap;
}

/* Задаем пропорции колонок */
.mail-table th:nth-child(1),
.mail-table td:nth-child(1) {
    width: 30%; /* От кого */
}

.mail-table th:nth-child(2),
.mail-table td:nth-child(2) {
    width: 50%; /* Тема */
}

.mail-table th:nth-child(3),
.mail-table td:nth-child(3) {
    width: 20%; /* Дата */
}

/* Исправляем отображение счетчиков */
.mail-folders li .count {
    float: right;
    background: #ffd700;
    color: #1a2b4c;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
}

/* Выравниваем заголовок */
.mail-toolbar {
    padding: 15px 20px;
    border-bottom: 2px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mail-toolbar h2 {
    margin: 0;
    font-size: 20px;
    color: #1a2b4c;
}

/* Исправляем информацию о пользователе */
.user-info {
    display: flex;
    align-items: center;
    gap: 20px;
    min-width: 200px;
    justify-content: flex-end;
}

/* Добавляем плавность при наведении */
.mail-table tr {
    transition: background-color 0.2s;
}

.mail-table tr:hover {
    background-color: #f5f5f5;
    cursor: pointer;
}

/* Исправляем отображение бейджей */
.email-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
    margin-right: 8px;
    color: white;
}

.email-badge.today {
    background: #ff4444;
}

.email-badge.yesterday {
    background: #ff8800;
}

/* Адаптация для мобильных */
@media (max-width: 900px) {
    .mail-layout {
        flex-direction: column;
    }
    
    .mail-sidebar {
        width: 100% !important;
    }
    
    .mail-content {
        min-width: auto;
    }
}
/* === Адаптация для мобильных устройств (главная страница) === */
@media (max-width: 600px) {
    .bank-header {
        flex-direction: column;
        align-items: center;
        padding: 10px;
    }
    .logo {
        margin-bottom: 5px;
    }
    .security-badge {
        margin: 0; /* убираем margin-left: auto */
        text-align: center;
        white-space: normal;
        word-break: break-word;
        max-width: 100%;
        background: rgba(255,255,255,0.1);
        padding: 5px 15px;
        border-radius: 20px;
        font-size: 14px;
    }
}
/* === Отступы на странице восстановления === */
.recovery-container h2 {
    margin-bottom: 15px;   /* увеличивает расстояние между заголовком и подзаголовком */
}

.recovery-subtitle {
    margin-bottom: 25px;   /* увеличивает расстояние между подзаголовком и формой */
    line-height: 1.4;       /* делает текст более читаемым, если он переносится */
}

/* Для мобильных устройств можно добавить чуть больше отступов */
@media (max-width: 600px) {
    .recovery-container h2 {
        margin-bottom: 20px;
    }
    .recovery-subtitle {
        margin-bottom: 30px;
    }
}