:root {
    --bg-color: #121212;
    --surface-color: #1E1E1E;
    --primary-green: #5A7256; 
    --primary-hover: #6B8567;
    --text-main: #FFFFFF;
    --text-secondary: #A0A0A0;
    --input-bg: #2A2A2A;
    --border-color: #333333;
    --error-color: #FF5252;
    --disabled-btn: #4D4D4D; 
    --disabled-text: #999999;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Inter', sans-serif; }

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.lang-switcher { position: absolute; top: 20px; right: 20px; display: flex; gap: 8px; }
.lang-btn {
    background: none; border: 1px solid var(--border-color);
    color: var(--text-secondary); padding: 6px 12px; border-radius: 6px;
    cursor: pointer; font-size: 11px; transition: 0.3s; font-weight: 600;
}
.lang-btn.active { border-color: var(--primary-green); color: var(--text-main); background: rgba(90, 114, 86, 0.1); }

.login-container { width: 100%; max-width: 400px; padding: 20px; text-align: center; }
.logo { font-size: 28px; font-weight: 300; letter-spacing: 6px; color: var(--primary-green); margin-bottom: 40px; text-transform: none; }
.card { background-color: var(--surface-color); padding: 32px; border-radius: 20px; border: 1px solid var(--border-color); min-height: 420px; display: flex; flex-direction: column; }

h1 { font-size: 22px; font-weight: 500; margin-bottom: 8px; letter-spacing: -0.5px; }
.subtitle { color: var(--text-secondary); font-size: 14px; margin-bottom: 30px; }

.form-group { text-align: left; margin-bottom: 24px; }
/* .label-row удален из HTML, стили можно оставить или удалить - они не мешают */
.label-row { display: flex; justify-content: space-between; margin-bottom: 10px; }
label { font-size: 11px; color: var(--text-secondary); text-transform: none; letter-spacing: 1px; }

.input-wrapper {
    display: flex; align-items: center; background-color: var(--input-bg);
    border: 1px solid var(--border-color); border-radius: 12px;
    padding: 16px; transition: 0.3s;
}
.input-wrapper:focus-within { border-color: var(--primary-green); }

input {
    background: transparent; border: none; color: var(--text-main);
    font-size: 18px; width: 100%; outline: none; letter-spacing: 1px;
    font-weight: 500;
}

.prefix { color: var(--text-main); margin-right: 12px; font-weight: 600; border-right: 1px solid var(--border-color); padding-right: 12px; }

.consent-wrapper { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 24px; text-align: left; cursor: pointer; }
.custom-checkbox {
    width: 20px; height: 20px; border: 2px solid var(--border-color);
    border-radius: 6px; flex-shrink: 0; position: relative; transition: 0.2s; margin-top: 2px;
}
#consent-check { display: none; }
#consent-check:checked + .custom-checkbox { background-color: var(--primary-green); border-color: var(--primary-green); }
#consent-check:checked + .custom-checkbox::after { content: '✓'; position: absolute; color: white; font-size: 14px; top: 50%; left: 50%; transform: translate(-50%, -50%); }
.consent-text { font-size: 12px; color: var(--text-secondary); line-height: 1.5; }
.consent-text a { color: var(--primary-green); text-decoration: none; font-weight: 500; }

.main-btn {
    width: 100%; padding: 18px; background-color: var(--primary-green);
    border: none; border-radius: 12px; color: white;
    font-size: 16px; font-weight: 600; cursor: pointer; 
    transition: transform 0.2s ease, background-color 0.3s ease;
}
.main-btn:hover:not(:disabled) {
    background-color: var(--primary-hover);
    transform: scale(1.02);
}
.main-btn:active:not(:disabled) {
    transform: scale(0.98);
}
.main-btn:disabled { background-color: var(--disabled-btn); color: var(--disabled-text); cursor: not-allowed; }

#otp-section { display: none; }
.otp-input { text-align: center; letter-spacing: 15px; font-size: 24px; font-weight: 700; color: var(--primary-green); }

.otp-center-group { 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    gap: 15px; 
    margin-top: 15px; 
}

.timer-text { font-size: 13px; color: var(--text-secondary); }

#otp-error { 
    color: var(--error-color); font-size: 13px; 
    text-align: center; display: none; width: 100%; 
}

.footer-links { margin-top: auto; padding-top: 24px; font-size: 14px; color: var(--text-secondary); }
.footer-links a { color: var(--primary-green); text-decoration: none; font-weight: 600; }

.error-msg a {
    color: var(--primary-green);
    text-decoration: none;
    font-weight: 600;
}
.error-msg a:hover {
    text-decoration: underline;
}
/* --- DASHBOARD EXTENSIONS --- */

/* Новое поведение для страниц личного кабинета */
.dashboard-body {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: stretch;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--surface-color);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 24px;
    flex-shrink: 0;
}

.sidebar .logo {
    text-align: center;
}

/* логотип-картинка из настроек по центру */
.sidebar #sidebar-container > img {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.nav-group { margin-bottom: 8px; }
.nav-header { 
    font-size: 11px;
    font-weight: 700;
    color: #666;
    text-transform: uppercase; 
    letter-spacing: 2px; 
    margin: 18px 0 6px 0;
    padding: 0;
    background: transparent;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}
.nav-header::before,
.nav-header::after {
    content: '';
    height: 1px;
    background: #333;
    flex: 1;
    opacity: 0.6;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 4px;
    transition: 0.3s;
    font-size: 14px;
}

.nav-item:hover, .nav-item.active {
    background-color: rgba(90, 114, 86, 0.1);
    color: var(--text-main);
}

.nav-item.active { color: var(--primary-green); font-weight: 600; }

.nav-icon {
    font-size: 18px;
    min-width: 24px;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Sidebar Badge */
.sidebar-badge {
    margin-left: auto;
    background-color: var(--error-color);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    line-height: 1.2;
}

/* Main Content Area */
.main-content {
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* Header Alert (Trial) */
.trial-banner {
    background-color: var(--primary-green);
    color: white;
    padding: 10px 24px;
    font-size: 13px;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
}

.trial-banner button {
    background: white;
    color: var(--primary-green);
    border: none;
    padding: 4px 12px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    font-size: 12px;
}

/* Dashboard Grid */
.dashboard-grid {
    padding: 32px;
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 32px;
}

/* Timeline */
.timeline-card {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 24px;
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.timeline-item {
    display: flex;
    gap: 20px;
    padding: 16px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.time-col { width: 50px; font-size: 13px; color: var(--text-secondary); font-weight: 500; }
.event-col { 
    flex-grow: 1; 
    background: var(--input-bg); 
    padding: 12px 16px; 
    border-radius: 12px; 
    border-left: 3px solid var(--primary-green);
}
/* --- UI IMPROVEMENTS --- */
.timeline-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.slot {
    display: flex;
    gap: 20px;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid transparent;
    transition: 0.2s;
    cursor: pointer;
}

.slot.free {
    border: 1px dashed var(--border-color);
    color: var(--text-secondary);
}

.slot.free:hover {
    border-color: var(--primary-green);
    background: rgba(90, 114, 86, 0.05);
}

.slot.busy {
    background: var(--input-bg);
    border-left: 4px solid var(--primary-green);
}

.slot-actions {
    margin-left: auto;
    display: flex;
    gap: 8px;
    opacity: 0;
    transition: 0.2s;
}

.slot.busy:hover .slot-actions { opacity: 1; }

.action-btn {
    background: var(--border-color);
    border: none;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
}

.action-btn.cancel { background: var(--error-color); }

/* Кнопка добавления */
.add-record-btn {
    background: var(--primary-green);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}
/* Анимация кнопок действий в слотах */
.action-btn {
    transition: transform 0.2s ease, background-color 0.2s ease;
}
.action-btn:hover {
    transform: scale(1.1);
}
/* Специфические цвета при наведении */
.btn-confirm:hover { background-color: #6B8567 !important; } /* primary-hover */
.btn-edit:hover { background-color: #555 !important; }
.btn-cancel:hover { background-color: #ff3333 !important; }

/* --- TOAST NOTIFICATIONS (GLOBAL) --- */
.toast-container { 
    position: fixed; 
    bottom: 30px; 
    right: 30px; 
    z-index: 9999; 
    display: flex; 
    flex-direction: column; 
    gap: 10px; 
}

.toast { 
    background: #1a1a1a; 
    border: 1px solid var(--primary-green); 
    border-left: 6px solid var(--primary-green); 
    color: #fff; 
    padding: 16px 20px; 
    border-radius: 8px; 
    width: 340px; 
    box-shadow: 0 0 15px rgba(90, 114, 86, 0.4); 
    display: flex; 
    justify-content: space-between; 
    align-items: flex-start; 
    animation: slideInRight 0.3s ease; 
    position: relative;
    height: auto;
    min-height: 60px;
}

.toast.warning {
    border: 1px solid #f39c12;
    border-left: 6px solid #f39c12;
    background: #2a200a; /* Dark yellow background */
    box-shadow: 0 0 15px rgba(243, 156, 18, 0.4);
}
.toast.warning .toast-title { color: #f39c12; }

@keyframes slideInRight { 
    from { transform: translateX(100%); opacity: 0; } 
    to { transform: translateX(0); opacity: 1; } 
}

.toast-content { 
    flex-grow: 1; 
    margin-right: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px; 
}

.toast-title { 
    font-weight: 700; 
    font-size: 15px; 
    margin-bottom: 2px; 
    color: var(--primary-green); 
}

.toast-msg { 
    font-size: 14px; 
    color: #ddd; 
    line-height: 1.5;
    white-space: pre-wrap; /* Allows multiline */
    word-wrap: break-word; 
}

.toast-close-btn { 
    background: transparent; 
    border: none; 
    color: #888; 
    font-size: 20px; 
    cursor: pointer; 
    line-height: 1; 
    padding: 2px; 
    margin: -4px -4px 0 0; 
    transition: 0.2s; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    width: 24px; 
    height: 24px; 
    border-radius: 4px; 
    flex-shrink: 0; 
}

.toast-close-btn:hover { 
    color: #fff; 
    background: rgba(255, 255, 255, 0.1); 
}

.toast.error {
    border: 1px solid var(--error-color); 
    border-left: 6px solid var(--error-color);
    background: #2c0b0e; 
    box-shadow: 0 0 15px rgba(231, 76, 60, 0.4); 
}
.toast.error .toast-title { color: var(--error-color); }

/* --- PROFILE TAB STYLES --- */
.profile-tabs {
    display: flex;
    gap: 20px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 30px;
}

.tab-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 12px 0;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    transition: 0.3s;
}

.tab-btn:hover {
    color: var(--text-main);
}

.tab-btn.active {
    color: var(--primary-green);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary-green);
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

/* --- SINGLE PROFILE CARD LAYOUT --- */
.single-profile-card {
    display: flex;
    background-color: var(--surface-color);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    margin-bottom: 30px;
    overflow: hidden; /* Ensures child backgrounds don't bleed */
}

.profile-left-col {
    width: 280px;
    flex-shrink: 0;
    padding: 40px 30px;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.02); /* Subtle contrast */
}

.profile-right-col {
    flex-grow: 1;
    padding: 40px;
    display: flex;
    flex-direction: column;
}

.form-section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-green);
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-section-title::after {
    content: '';
    flex-grow: 1;
    height: 1px;
    background: var(--border-color);
    opacity: 0.5;
}

.form-grid-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.form-grid-3 {
    grid-template-columns: 1fr 1fr 1fr;
}

/* Schedule Tab - Equal Height Cards */
.schedule-grid {
    display: flex;
    gap: 30px;
    align-items: stretch; /* Ensures equal height */
}

.schedule-grid .settings-card {
    flex: 1; /* Each card takes 50% width */
    display: flex;
    flex-direction: column;
    min-height: 500px; /* Minimum height for consistency */
}

.schedule-list, .mini-calendar-grid {
    flex-grow: 1; /* Pushes content to fill space */
}

.save-btn-wrapper {
    margin-top: 30px;
    display: flex;
    justify-content: flex-end;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 992px) {
    .single-profile-card {
        flex-direction: column;
    }
    .profile-left-col {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 30px;
    }
    .profile-right-col {
        padding: 30px;
    }
    .form-grid-row, .form-grid-3 {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .schedule-grid {
        flex-direction: column;
    }
    .schedule-grid .settings-card {
        min-height: auto;
    }
}
