:root {
    --bg: #121212;
    --bg-alt: #0B0807;
    --accent: #fa965f;
    --accent-soft: rgba(255, 255, 255, 0.08);
    --accent-2: #abbaaa;
    --text: #f5f6ff;
    --text-muted: #3EA488;
    --border: rgba(255, 255, 255, 0.08);
    --danger: #ff6b6b;
    --danger-soft: rgba(255, 107, 107, 0.16);
    --shadow-soft: 0 18px 45px rgba(255,255,255,0.1);
    --radius-lg: 20px;
    --radius-pill: 999px;
    --transition-fast: 0.18s ease-out;
    --transition-med: 0.26s ease-out;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    /* ИЗМЕНЕНИЕ: Фиксируем высоту окна и запрещаем скролл страницы */
    height: 100vh;
    overflow: hidden;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Segoe UI", sans-serif;
    background-color: var(--bg);
    color: var(--text);
}

body {
    display: flex;
    justify-content: center;
    align-items: stretch;
    color: var(--text);
    width: 100%;
}

.app {
    width: 100%;
    /* Оставляем max-width для дашборда, чтобы он не растягивался слишком сильно на больших экранах */
    max-width: 1100px; 
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    /* ИЗМЕНЕНИЕ: Заставляем app занимать всю высоту body */
    height: 100%;
}

/* Header & Nav */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(16, 22, 36, 0.9), rgba(6, 12, 26, 0.9));
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    flex-shrink: 0; /* Чтобы хедер не сжимался */
}

.brand {
    display: flex;
    align-items: center;
    gap: 8px;
}

.brand-logo {
    width: 28px;
    height: 28px;
    border-radius: 12px;
    background: radial-gradient(circle at 30% 30%, var(--accent), var(--accent-2));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.brand-text {
    font-weight: 600;
    letter-spacing: 0.04em;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-user {
    font-size: 14px;
    color: var(--text-muted);
}

.app-nav {
    display: flex;
    align-items: center;
    gap: 6px;
}

button {
    font-family: inherit;
}

/* Logo Container (New) */
.logo-container {
    height: 20vmin;
    width: auto;
    margin-bottom: 6vh;
    flex-shrink: 0;
    display: flex;
    justify-content: center;
}

.logo-container img {
    height: 100%;
    width: 100%;
    object-fit: contain;
}

/* Main Content Area */
.app-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    
    /* Добавлено из new-auth-view для правильного скроллинга внутри контента */
    height: 100%;
    min-height: 0;
    overflow-y: auto;
    width: 100%;
}

/* Buttons */
.nav-link {
    border: none;
    background: transparent;
    color: var(--text-muted);
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 13px;
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast),
    transform 0.12s ease-out;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    transform: translateY(-1px);
}

.nav-link-active {
    background: var(--accent-soft);
    color: var(--accent);
}

.nav-logout {
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.btn {
    border-radius: 999px;
    padding: 10px 18px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.02em;
    transition: background var(--transition-fast), transform var(--transition-fast),
    box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.primary-btn {
    /* Сохраняем градиент из styles.css, так как он выглядит лучше flat-цвета */
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #05060f;
    box-shadow: var(--shadow-soft);
    transition: transform var(--transition-med);
}

.primary-btn:hover {
    transform: translateY(-2px);
}

.ghost-btn {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.ghost-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-1px);
}

.danger-btn {
    background: var(--danger);
    color: #fff;
}

.danger-btn.outline-btn {
    background: transparent;
    color: var(--danger);
    border: 1px solid var(--danger);
}

.danger-btn.outline-btn:hover {
    background: var(--danger-soft);
}

/* Cards & Layout */
.card {
    /* Используем градиент из styles.css как основной стиль */
    background: radial-gradient(circle at top left, #1a2140, #070b18 60%);
    border-radius: var(--radius-lg);
    padding: 18px 18px 20px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
    -webkit-backdrop-filter: blur(22px);
    backdrop-filter: blur(22px);
    
    margin-bottom: 14px;
    flex-shrink: 0;
}

/* Специальное правило для карточки на экране авторизации, если нужно отцентровать её или задать ширину как в макете */
#view-auth .card {
    width: 100%; /* Внутри auth-card контейнера */
    background: var(--bg-alt); /* Более плоский фон для входа, как в new-auth-view */
}

.card h2 {
    margin-top: 0;
}

.card-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.split-layout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 14px;
}

.split-layout-chat {
    grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
}

.matches-column {
    max-height: 580px;
    overflow: hidden;
}

.chat-column {
    max-height: 580px;
    display: flex;
    flex-direction: column;
}

/* Forms & Auth */
.auth-card {
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
    /* Центрирование в новом стиле */
}

.auth-tabs {
    display: flex;
    gap: 6px;
    padding: 4px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.35);
    margin-bottom: 16px;
}

.auth-tab {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text-muted);
    padding: 8px 0;
    border-radius: 999px;
    cursor: pointer;
    font-size: 14px;
    transition: background var(--transition-fast), color var(--transition-fast),
    transform var(--transition-fast);
}

.auth-tab-active {
    background: var(--accent-soft);
    color: var(--accent);
    transform: translateY(-1px);
}

.auth-forms {
    margin-top: 4px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 12px;
    justify-content: center;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
}

.google-login {
    display: flex;
    justify-content: center;
}

.auth-form h2 {
    margin-bottom: 6px;
}

.auth-hint {
    margin-top: 14px;
    font-size: 12px;
    color: var(--text-muted);
}

label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 13px;
}

/* Inputs (Updated styling from new-auth-view) */
input,
textarea,
select {
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(6, 10, 24, 0.9);
    color: var(--text);
    padding: 8px 11px;
    font-size: 14px;
    outline: none;
    transition: border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    background var(--transition-fast);
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px rgba(255, 106, 193, 0.4);
}

textarea {
    resize: vertical;
    min-height: 60px;
}

.form-row,
.form-row-2,
.form-row-3 {
    display: grid;
    gap: 8px;
}

.form-row-2 {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.form-row-3 {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.full-width {
    width: 100%;
}

.checkbox-label {
    align-items: center;
    flex-direction: row;
    gap: 6px;
    margin-top: 20px;
}

.checkbox-label input[type='checkbox'] {
    width: auto;
}

.stack-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

/* Dashboard Misc */
.dashboard-info {
    font-size: 14px;
}

.dashboard-badges {
    list-style: none;
    padding: 0;
    margin: 10px 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 12px;
}

.badge-ok,
.badge-missing {
    border-radius: 999px;
    padding: 4px 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.badge-ok {
    background: rgba(77, 208, 225, 0.1);
    color: #a8f4ff;
}

.badge-missing {
    background: rgba(255, 106, 193, 0.09);
    color: #ffc8ec;
}

.dashboard-actions {
    margin-top: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

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

/* Jobs List */
.jobs-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
}

.job-card {
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(3, 7, 18, 0.9);
    padding: 10px 12px;
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.job-card-main h3 {
    margin: 0 0 4px;
    font-size: 15px;
}

.job-card-main p {
    margin: 0;
}

.job-card-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-end;
}

/* Feed */
.feed-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.pill-toggle {
    border-radius: var(--radius-pill);
    background: rgba(0, 0, 0, 0.4);
    padding: 4px;
    display: inline-flex;
    gap: 4px;
}

.pill-toggle-btn {
    border-radius: var(--radius-pill);
    padding: 6px 12px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 13px;
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast),
    transform var(--transition-fast);
}

.pill-toggle-btn-active {
    background: var(--accent-soft);
    color: var(--accent);
    transform: translateY(-1px);
}

.feed-card-container {
    margin: 18px auto 10px;
    max-width: 460px;
    min-height: 200px;
    display: flex;
    align-items: stretch;
    justify-content: center;
}

.feed-card {
    position: relative;
    border-radius: 20px;
    padding: 16px 16px 18px;
    background: radial-gradient(circle at top left, #222955, #0b101e 65%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.65);
    width: 100%;
    transform: translateY(0);
    transition: transform 0.25s ease-out, box-shadow 0.25s ease-out,
    opacity 0.25s ease-out;
}

.feed-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 22px 50px rgba(0, 0, 0, 0.75);
}

.feed-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.feed-card-header h3 {
    margin: 0;
    font-size: 17px;
}

.feed-location {
    margin: 6px 0 4px;
    font-size: 13px;
    color: var(--accent-2);
}

.feed-meta {
    margin: 0 0 8px;
    font-size: 12px;
    color: var(--text-muted);
}

.feed-description {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
}

.badge-pill {
    border-radius: 999px;
    padding: 4px 9px;
    font-size: 11px;
    background: rgba(77, 208, 225, 0.16);
    color: #b8ffff;
}

.feed-controls {
    display: flex;
    justify-content: center;
    gap: 18px;
    margin-top: 12px;
}

.feed-btn {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.75);
    transition: transform var(--transition-med), box-shadow var(--transition-med),
    background var(--transition-fast);
}

.feed-btn-dislike {
    background: var(--danger-soft);
    color: var(--danger);
}

.feed-btn-like {
    background: var(--accent-soft);
    color: var(--accent);
}

.feed-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.85);
}

/* swipe animations */
.feed-card.swipe-like {
    animation: swipe-right 0.45s forwards ease-out;
}

.feed-card.swipe-dislike {
    animation: swipe-left 0.45s forwards ease-out;
}

@keyframes swipe-right {
    0% {
        transform: translateX(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateX(160%) rotate(12deg);
        opacity: 0;
    }
}

@keyframes swipe-left {
    0% {
        transform: translateX(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateX(-160%) rotate(-12deg);
        opacity: 0;
    }
}

/* Matches & Chat */
.matches-list {
    margin-top: 8px;
    max-height: 520px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.match-item {
    border-radius: 14px;
    padding: 8px 10px;
    background: rgba(3, 8, 23, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.08);
    cursor: pointer;
    transition: background var(--transition-fast), transform var(--transition-fast),
    border-color var(--transition-fast);
}

.match-item:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.16);
    transform: translateY(-1px);
}

.match-main h3 {
    margin: 0 0 2px;
    font-size: 14px;
}

.chat-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding-right: 4px;
    margin-bottom: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.chat-message {
    display: flex;
    justify-content: flex-start;
}

.chat-message-me {
    justify-content: flex-end;
}

.chat-bubble {
    max-width: 80%;
    border-radius: 16px;
    padding: 6px 10px;
    font-size: 13px;
    background: rgba(11, 19, 46, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.chat-message-me .chat-bubble {
    background: rgba(255, 106, 193, 0.12);
    border-color: rgba(255, 106, 193, 0.6);
}

.chat-meta {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.chat-time {
    opacity: 0.8;
}

.chat-text {
    white-space: pre-wrap;
}

.chat-status {
    font-size: 11px;
    margin-bottom: 4px;
}

.chat-form {
    display: flex;
    gap: 6px;
    margin-top: 4px;
}

.chat-form input {
    flex: 1;
}

/* Surveys */
.survey-block {
    margin-top: 14px;
}

.survey-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 10px;
}

.survey-question {
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(6, 12, 30, 0.95);
}

.survey-question p {
    margin: 0 0 6px;
    font-size: 13px;
}

.survey-question label {
    flex-direction: row;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    margin-bottom: 2px;
}

.survey-question input[type='radio'] {
    width: auto;
}

.status-line {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
}

/* Toast */
.toast {
    position: fixed;
    left: 50%;
    bottom: 18px;
    transform: translateX(-50%);
    padding: 10px 14px;
    border-radius: 999px;
    font-size: 13px;
    background: rgba(6, 10, 26, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: var(--text);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.8);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    z-index: 50;
}

.toast-info {
    border-color: rgba(77, 208, 225, 0.7);
}

.toast-success {
    border-color: rgba(0, 230, 118, 0.85);
}

.toast-error {
    border-color: rgba(255, 82, 82, 0.9);
}

/* View Handling (Utilities) */
.view {
    display: none;
}

.view.view-active {
    display: block;
}

#view-auth.view-active {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    min-height: min-content; 
    justify-content: center; /* Центрируем форму входа */
}

.hidden {
    display: none !important;
}

/* Responsive */
@media (max-width: 720px) {
    .app-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .app-nav {
        flex-wrap: wrap;
    }

    .split-layout-chat {
        grid-template-columns: 1fr;
    }

    .chat-column {
        max-height: none;
    }
}
