@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
    --page-bg: #ecf3f7;
    --page-gradient: linear-gradient(135deg, #ecf3f7 0%, #f7f9ff 35%, #eef8f3 100%);
    --panel-bg: rgba(255, 255, 255, 0.88);
    --panel-border: rgba(19, 46, 78, 0.08);
    --accent: #0da072;
    --accent-strong: #0b7453;
    --warning: #ff8a4c;
    --info: #6f7bf7;
    --pinned: #1b7fd1;
    --text-primary: #1c2533;
    --text-muted: #5d6573;
    --shadow-soft: 0 30px 60px rgba(15, 23, 42, 0.18);
}

/* --- Общие базовые стили --- */
body {
    font-family: 'Space Grotesk', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--page-gradient);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding-top: 0;
    box-sizing: border-box;
    color: var(--text-primary);
}

/* Стили для страниц с верхней панелью (login, register, dashboard) */
body.auth-page {
    padding-top: 120px; /* Увеличенный отступ под фиксированный navbar */
}

/* ===================================================================
   ЛЕНДИНГ  (index.html)
   =================================================================== */

body.landing-page {
    padding: 0;
    background: #0b1120;
    color: #e8ecf5;
}

/* --- Nav --- */
.landing-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 2000;
    background: rgba(11, 17, 32, 0.82);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.landing-nav-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 clamp(20px, 5vw, 64px);
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.landing-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #fff;
}

.landing-logo-img {
    height: 36px;
    border-radius: 8px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.landing-nav-links {
    display: flex;
    gap: 28px;
}

.landing-nav-links a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.25s;
}

.landing-nav-links a:hover {
    color: #fff;
}

.landing-nav-actions {
    display: flex;
    gap: 12px;
}

/* --- Buttons --- */
.landing-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 22px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    white-space: nowrap;
}

.landing-btn--ghost {
    background: transparent;
    color: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.landing-btn--ghost:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.4);
    color: #fff;
}

.landing-btn--accent {
    background: linear-gradient(135deg, #0da072, #1ba3d6);
    color: #fff;
    box-shadow: 0 8px 24px rgba(13, 160, 114, 0.35);
}

.landing-btn--accent:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 32px rgba(13, 160, 114, 0.45);
}

.landing-btn--big {
    padding: 16px 36px;
    font-size: 1.1rem;
    border-radius: 16px;
    background: linear-gradient(135deg, #0da072, #1ba3d6);
    color: #fff;
    box-shadow: 0 14px 40px rgba(13, 160, 114, 0.4);
}

.landing-btn--big:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 48px rgba(13, 160, 114, 0.55);
}

.landing-btn--outline {
    background: transparent;
    color: rgba(255, 255, 255, 0.9);
    border: 1.5px solid rgba(255, 255, 255, 0.25);
    padding: 16px 36px;
    font-size: 1.1rem;
    border-radius: 16px;
}

.landing-btn--outline:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.5);
    color: #fff;
}

/* --- Hero --- */
.landing-hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 120px clamp(24px, 6vw, 80px) 80px;
    overflow: hidden;
}

.landing-hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 70% 50% at 30% 20%, rgba(13, 160, 114, 0.25), transparent),
        radial-gradient(ellipse 60% 55% at 75% 75%, rgba(27, 163, 214, 0.2), transparent),
        radial-gradient(ellipse 50% 40% at 50% 50%, rgba(111, 123, 247, 0.12), transparent);
    pointer-events: none;
    z-index: 0;
}

.landing-hero-content {
    position: relative;
    z-index: 1;
    max-width: 820px;
}

.landing-eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.22em;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent);
    margin: 0 0 16px;
}

.landing-hero-content h1 {
    font-size: clamp(2.2rem, 5vw, 3.6rem);
    font-weight: 700;
    line-height: 1.15;
    margin: 0 0 24px;
    color: #fff;
    text-align: center;
}

.landing-hero-sub {
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.65;
    max-width: 640px;
    margin: 0 auto 40px;
    text-align: center;
}

.landing-hero-cta {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 56px;
}

.landing-hero-stats {
    display: flex;
    justify-content: center;
    gap: clamp(24px, 5vw, 56px);
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.stat-item strong {
    font-size: 2.2rem;
    font-weight: 700;
    background: linear-gradient(135deg, #0eda9a, #6f7bf7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-item span {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* --- Features --- */
.landing-features {
    padding: 100px clamp(24px, 6vw, 80px);
    background: linear-gradient(180deg, #0b1120 0%, #0f1b2e 100%);
}

.landing-section-header {
    text-align: center;
    max-width: 600px;
    margin: 0 auto 56px;
}

.landing-section-header h2 {
    font-size: clamp(1.8rem, 3.5vw, 2.6rem);
    font-weight: 700;
    color: #fff;
    margin: 8px 0 0;
}

.landing-section-header--light h2 {
    color: #fff;
}

.landing-features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 28px;
    max-width: 1200px;
    margin: 0 auto;
}

.landing-fcard {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    padding: 36px 28px;
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.landing-fcard:hover {
    transform: translateY(-6px);
    border-color: rgba(13, 160, 114, 0.4);
    box-shadow: 0 20px 50px rgba(13, 160, 114, 0.12);
}

.landing-fcard-icon {
    font-size: 2.2rem;
    margin-bottom: 18px;
}

.landing-fcard h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0 0 12px;
    color: #fff;
}

.landing-fcard p {
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.65;
    font-size: 0.95rem;
    margin: 0;
}

/* --- Benefits --- */
.landing-benefits {
    padding: 100px clamp(24px, 6vw, 80px);
    background: #0f1b2e;
}

.landing-benefits-list {
    list-style: none;
    padding: 0;
    margin: 0 auto;
    max-width: 760px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.landing-benefits-list li {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 1.05rem;
    color: rgba(255, 255, 255, 0.85);
    transition: transform 0.25s ease, border-color 0.25s ease;
}

.landing-benefits-list li:hover {
    transform: translateX(6px);
    border-color: rgba(13, 160, 114, 0.35);
}

.landing-benefits-list li::before {
    content: '✓';
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(13, 160, 114, 0.15);
    color: #0eda9a;
    font-weight: 700;
    font-size: 1.1rem;
    flex-shrink: 0;
}

/* --- CTA --- */
.landing-cta-section {
    text-align: center;
    padding: 100px clamp(24px, 6vw, 80px);
    background:
        radial-gradient(ellipse 60% 60% at 50% 50%, rgba(13, 160, 114, 0.12), transparent),
        #0b1120;
}

.landing-cta-section h2 {
    font-size: clamp(1.8rem, 3.5vw, 2.6rem);
    font-weight: 700;
    color: #fff;
    margin: 0 0 16px;
}

.landing-cta-section p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.1rem;
    margin: 0 0 36px;
}

/* --- Footer --- */
.landing-footer {
    background: rgba(11, 17, 32, 0.95);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    text-align: center;
    padding: 32px 20px;
}

.landing-footer p {
    margin: 0;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.9rem;
}

/* --- Landing responsive --- */
@media (max-width: 768px) {
    .landing-nav-links {
        display: none;
    }
    .landing-hero {
        min-height: auto;
        padding: 110px 20px 60px;
    }
    .landing-hero-stats {
        gap: 20px;
    }
    .stat-item strong {
        font-size: 1.6rem;
    }
    .landing-features,
    .landing-benefits,
    .landing-cta-section {
        padding: 60px 20px;
    }
}


/* --- Новая панель управления --- */
body.dashboard-page {
    width: 100%;
    padding: 110px 30px 60px;
    align-items: center;
    background-attachment: fixed;
}

.flash-welcome {
    position: fixed;
    top: 78px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent);
    color: #fff;
    padding: 12px 28px;
    border-radius: 999px;
    box-shadow: var(--shadow-soft);
    font-weight: 600;
    z-index: 1200;
    display: none;
}

.nav-cluster {
    display: flex;
    align-items: center;
    gap: 28px;
    flex-wrap: wrap;
    flex: 1;
    min-width: 0;
}

.nav-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.nav-pill {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #fff;
    padding: 8px 18px;
    border-radius: 999px;
    font-size: 0.95em;
    letter-spacing: 0.02em;
    cursor: pointer;
    width: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    transition: background 0.3s ease, transform 0.2s ease, border-color 0.3s ease;
}

.nav-pill:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-1px);
}

.nav-pill:active {
    transform: translateY(0);
}

@media (max-width: 640px) {
    .navbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 18px;
        padding: 16px 20px;
    }
    .nav-cluster {
        width: 100%;
        justify-content: space-between;
    }
    .profile-area {
        width: 100%;
        justify-content: space-between;
    }
}

.dashboard-grid {
    width: min(1400px, 100%);
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(320px, 1.3fr);
    gap: 32px;
    margin: 0 auto;
}

.focus-panel,
.right-rail {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.glass-panel {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 24px;
    padding: 24px 26px;
    box-shadow: 0 15px 35px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(12px);
}

.welcome-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.75em;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.meta {
    color: var(--text-muted);
    margin-top: 6px;
}

.status-chips {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 180px;
}

.chip {
    padding: 10px 16px;
    border-radius: 999px;
    font-size: 0.95em;
    font-weight: 600;
}

.chip-health {
    background: rgba(13, 160, 114, 0.15);
    color: var(--accent-strong);
}

.chip-activity {
    background: rgba(15, 23, 42, 0.08);
    color: var(--text-primary);
}

.quick-actions h2,
.activity-stream h2 {
    margin-top: 0;
    margin-bottom: 18px;
    text-align: left;
}

.quick-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

.quick-btn {
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    color: var(--text-primary);
    border-radius: 16px;
    padding: 14px 18px;
    font-weight: 600;
    width: 100%;
}

.quick-btn:hover {
    background: var(--accent);
    color: #fff;
}

.activity-stream ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.activity-stream li {
    display: flex;
    gap: 18px;
    align-items: flex-start;
}

.activity-stream li span {
    font-weight: 700;
    color: var(--text-muted);
    min-width: 60px;
}

.activity-stream li small {
    color: var(--text-muted);
}

.time-widget {
    padding-bottom: 28px;
}

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

.time-meta {
    text-align: right;
}

.progress-track {
    height: 14px;
    background: rgba(15, 23, 42, 0.08);
    border-radius: 999px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    border-radius: 999px;
    width: 0;
    background: var(--accent);
    transition: width 0.6s ease;
}

.time-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    margin-top: 18px;
    gap: 12px;
}

.time-stats strong {
    font-size: 1.1em;
}

.doc-stack .stack-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.stack-count {
    background: rgba(15, 23, 42, 0.08);
    border-radius: 999px;
    padding: 6px 14px;
    font-weight: 600;
}

.stack-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 360px;
    overflow-y: auto;
}

.doc-row {
    display: grid;
    grid-template-columns: 70px 1fr auto;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border-radius: 18px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: rgba(255, 255, 255, 0.6);
    cursor: pointer;
}

.doc-row:hover {
    border-color: var(--accent);
}

.doc-row--pinned {
    border-left: 4px solid var(--pinned);
}

.doc-title {
    margin: 0;
    font-weight: 600;
}

.doc-content small {
    color: var(--text-muted);
}

.doc-status {
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.85em;
    font-weight: 600;
}

.doc-status--alert {
    background: rgba(255, 138, 76, 0.15);
    color: #d46225;
}

.doc-status--review {
    background: rgba(111, 123, 247, 0.12);
    color: #4a52b8;
}

.doc-status--ready {
    background: rgba(13, 160, 114, 0.16);
    color: var(--accent-strong);
}

.doc-status--pinned {
    background: rgba(27, 127, 209, 0.15);
    color: var(--pinned);
}

.doc-status--waiting {
    background: rgba(255, 193, 7, 0.18);
    color: #c07b00;
}

.panel-overlay {
    position: fixed;
    inset: 0;
    background: rgba(8, 15, 26, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 1500;
}

.panel-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.panel-card {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 28px;
    width: min(900px, 94vw);
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-soft);
}

.panel-card .panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 32px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.panel-close {
    background: transparent;
    color: var(--text-primary);
    font-size: 1.8em;
    line-height: 1;
    padding: 4px 12px;
}

.panel-body {
    padding: 28px 32px;
    overflow-y: auto;
}

.company-actions {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.company-actions label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
}

.create-row {
    display: flex;
    gap: 12px;
}

.create-row input {
    flex: 1;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    font-size: 1em;
}

.company-search input {
    width: 260px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(15, 23, 42, 0.12);
}

.company-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.company-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 22px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.72);
}

.company-card h3 {
    margin: 0;
}

.company-meta {
    display: flex;
    align-items: center;
    gap: 12px;
}

.company-cta {
    background: var(--accent);
    color: #fff;
    border-radius: 999px;
    padding: 8px 18px;
    font-weight: 600;
}

.company-cta:hover {
    background: var(--accent-strong);
}

.company-card[data-status="joined"] .company-cta {
    background: rgba(15, 23, 42, 0.08);
    color: var(--text-primary);
}

.company-card[data-status="pending"] .company-cta {
    background: rgba(255, 138, 76, 0.2);
    color: #d46225;
}

.panel-card.admin-card {
    width: min(1100px, 96vw);
}

.admin-body {
    display: grid;
    grid-template-columns: 280px 1fr;
    height: 100%;
    min-height: 400px;
}

.admin-list {
    border-right: 1px solid rgba(15, 23, 42, 0.08);
    padding-right: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.applicant-tag {
    background: rgba(15, 23, 42, 0.05);
    border-radius: 16px;
    padding: 12px 16px;
    border: none;
    width: 100%;
    text-align: left;
    font-weight: 600;
}

.applicant-tag.active {
    background: var(--accent);
    color: #fff;
}

.applicant-tag.approved {
    border: 1px solid #20b486;
}

.applicant-tag.rejected {
    opacity: 0.5;
}

.admin-detail {
    padding-left: 24px;
}

.admin-profile h3 {
    margin-top: 0;
}

.skill-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.skill-row span {
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.08);
    font-size: 0.85em;
}

.admin-actions {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#roleSelect {
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid rgba(15, 23, 42, 0.12);
}

.admin-buttons {
    display: flex;
    gap: 12px;
}

.admin-buttons button {
    flex: 1;
}

.admin-buttons .ghost {
    background: rgba(15, 23, 42, 0.05);
    color: var(--text-primary);
}

.panel-overlay .placeholder {
    color: var(--text-muted);
}

.modal-shell {
    position: fixed;
    inset: 0;
    background: rgba(8, 15, 26, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 1600;
}

.modal-shell.open {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    background: #fff;
    border-radius: 24px;
    width: min(520px, 90vw);
    padding: 28px;
    position: relative;
}

.modal-head h3 {
    margin: 6px 0;
}

.modal-actions {
    display: flex;
    gap: 12px;
    margin: 16px 0;
}

#docCompleteForm textarea,
#docCompleteForm input[type="text"] {
    width: 100%;
    border-radius: 12px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    padding: 12px;
    margin-bottom: 12px;
    font-family: inherit;
}

#docCompleteForm textarea {
    min-height: 120px;
}

#docCompleteForm button {
    width: 100%;
    background: var(--accent);
}

.hint {
    color: var(--text-muted);
    font-size: 0.9em;
}

.toast {
    position: fixed;
    bottom: 40px;
    right: 40px;
    background: var(--text-primary);
    color: #fff;
    padding: 14px 22px;
    border-radius: 16px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 1700;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.hidden {
    display: none !important;
}

@media (max-width: 1200px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    .right-rail {
        order: -1;
    }
}

@media (max-width: 900px) {
    body.dashboard-page {
        padding: 110px 16px 40px;
    }
    .welcome-card {
        flex-direction: column;
        align-items: flex-start;
    }
    .status-chips {
        flex-direction: row;
        flex-wrap: wrap;
    }
    .company-card,
    .doc-row {
        grid-template-columns: 1fr;
        text-align: left;
    }
    .company-meta {
        flex-direction: column;
        align-items: flex-start;
    }
}


/* --- Стили для общих элементов (navbar, forms, dashboard) --- */

.navbar {
    width: 100%;
    background: transparent;
    color: #f5f8ff;
    padding: 18px clamp(20px, 6vw, 64px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 32px;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1400;
    box-sizing: border-box;
    min-height: 82px;
    isolation: isolate;
}

.navbar::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, rgba(7, 17, 38, 0.98) 0%, rgba(16, 55, 84, 0.96) 45%, rgba(17, 92, 82, 0.94) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 20px 60px rgba(10, 20, 40, 0.55);
    backdrop-filter: blur(20px);
    z-index: -2;
    pointer-events: none;
}

.navbar::after {
    content: '';
    position: absolute;
    inset: 2px 2px auto;
    height: 4px;
    background: linear-gradient(90deg, rgba(13, 160, 114, 0.9), rgba(111, 123, 247, 0.6));
    border-radius: 999px;
    opacity: 0.85;
    z-index: -1;
    pointer-events: none;
}

.navbar .logo {
    display: flex;
    align-items: center;
    font-size: 1.2em;
    font-weight: 600;
    color: #f4f6fb;
    letter-spacing: 0.04em;
}

.navbar .logo span {
    font-size: 1.05em;
    text-transform: uppercase;
    letter-spacing: 0.2em;
}

.navbar .logo-image-small {
    height: 32px;
    width: auto;
    margin-right: 12px;
    border-radius: 6px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

.profile-area {
    position: relative; /* Для позиционирования дропдауна */
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}

.profile-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.65);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 6px 12px rgba(15, 23, 42, 0.25);
}

.profile-icon:hover {
    transform: scale(1.05);
}

.profile-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-dropdown {
    display: none;
    position: absolute;
    top: 55px; /* Отступ от navbar */
    right: 0;
    background-color: #f9f9f9;
    min-width: 240px;
    max-width: 280px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.25);
    z-index: 1;
    border-radius: 8px;
    padding: 15px;
    box-sizing: border-box;
    text-align: center;
    border: 1px solid #ddd;
    animation: fadeIn 0.3s ease-out;
}

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

.profile-dropdown.show {
    display: block;
}

.profile-dropdown p {
    margin: 5px 0 15px 0;
    color: #555;
    font-size: 0.95em;
    word-break: break-all; /* Для длинных email */
}

.profile-chip {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.05);
    margin-bottom: 12px;
}

.profile-chip img {
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(15, 23, 42, 0.08);
}

.profile-chip strong {
    display: block;
}

.profile-chip small {
    color: var(--text-muted);
}

.profile-dropdown form {
    margin-top: 10px;
}

.profile-dropdown input[type="file"] {
    display: none; /* Скрываем стандартный инпут для файла */
}

.change-avatar-button {
    display: inline-block;
    background-color: #007bff;
    color: white;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
    margin-top: 10px;
    transition: background-color 0.3s ease;
}

.change-avatar-button:hover {
    background-color: #0056b3;
}

.logout-button {
    background-color: #dc3545;
    color: white;
    padding: 8px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
    margin-top: 10px;
    transition: background-color 0.3s ease;
}

.logout-button:hover {
    background-color: #c82333;
}


/* --- Страницы авторизации (login / register) --- */
.auth-shell {
    width: min(1200px, 100%);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 48px;
    padding: 0 clamp(24px, 6vw, 80px) 80px;
    margin-top: 40px;
    align-items: stretch;
}

.auth-intro {
    position: relative;
    background: radial-gradient(circle at top left, rgba(13, 160, 114, 0.35), rgba(7, 25, 44, 0.95));
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 32px;
    padding: clamp(28px, 4vw, 48px);
    color: #f5f8ff;
    box-shadow: 0 35px 65px rgba(7, 17, 38, 0.35);
    overflow: hidden;
}

.auth-intro::after {
    content: '';
    position: absolute;
    inset: 24px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 28px;
    pointer-events: none;
    opacity: 0.35;
}

.auth-intro .eyebrow {
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 12px;
}

.auth-intro h1 {
    margin: 0 0 18px;
    color: #fff;
    font-size: clamp(1.8rem, 3vw, 2.4rem);
    text-align: left;
}

.auth-description {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
    margin-bottom: 28px;
    text-align: left;
}

.auth-benefits {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: relative;
}

.auth-benefits li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    font-weight: 500;
}

.auth-benefits li::before {
    content: '•';
    font-size: 1.4em;
    color: #0eda9a;
}

.auth-card {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 28px;
    padding: clamp(28px, 4vw, 48px);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(14px);
}

.auth-card-header h2 {
    margin: 0 0 6px;
    font-size: 1.8rem;
    text-align: left;
    color: var(--text-primary);
}

.auth-card-header p {
    margin: 0 0 24px;
    color: var(--text-muted);
    text-align: left;
}

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

.auth-form .form-group {
    margin: 0;
}

.auth-form label {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.input-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 16px;
    padding: 0 14px;
    background: rgba(255, 255, 255, 0.9);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.input-wrap:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(13, 160, 114, 0.15);
}

.input-icon {
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.08em;
    min-width: 32px;
    text-align: center;
}

.input-wrap input {
    border: none;
    background: transparent;
    padding: 14px 0;
    width: 100%;
    font-size: 1rem;
    color: var(--text-primary);
}

.input-wrap input:focus {
    outline: none;
}

.primary-btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 16px;
    border-radius: 18px;
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    background: linear-gradient(120deg, #0da072, #1ba3d6);
    color: #fff;
    border: none;
    box-shadow: 0 18px 35px rgba(13, 160, 114, 0.35);
}

.primary-btn:hover {
    transform: translateY(-1px);
    background: linear-gradient(120deg, #0b7453, #1486b0);
}

.auth-alt {
    margin-top: 24px;
    color: var(--text-muted);
}

.auth-alt a {
    color: var(--accent);
}

.auth-card .flashes {
    text-align: left;
}

.auth-card .flashes li {
    border-radius: 12px;
}

@media (max-width: 768px) {
    .auth-shell {
        padding: 0 20px 60px;
        gap: 32px;
    }
    .auth-intro,
    .auth-card {
        padding: 24px;
    }
}


.container {
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 450px; /* Немного шире для лучшего вида */
    box-sizing: border-box;
    margin-top: 50px; /* Дополнительный отступ для форм под navbar */
}

.welcome-container {
    text-align: center;
    padding-top: 50px; /* Дополнительный отступ для текста под навбаром */
    margin-top: 20px; /* Меньший отступ для дашборда */
}

h2, h1 {
    text-align: center;
    color: #333;
    margin-bottom: 25px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: bold;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-sizing: border-box;
    font-size: 1.05em;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-group input[type="text"]:focus,
.form-group input[type="email"]:focus,
.form-group input[type="password"]:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
    outline: none;
}


button {
    padding: 14px;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.05em;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

button:hover {
    background-color: #218838;
    transform: translateY(-1px);
}

.container button,
.container form button,
.container form input[type="submit"] {
    width: 100%;
}

p {
    text-align: center;
    margin-top: 25px;
    color: #666;
}

p a {
    color: #007bff;
    text-decoration: none;
    font-weight: bold;
}

p a:hover {
    text-decoration: underline;
}

.flashes {
    list-style: none;
    padding: 0;
    margin-bottom: 25px;
    text-align: center;
}

.flashes li {
    padding: 12px;
    margin-bottom: 12px;
    border-radius: 6px;
    font-weight: bold;
    font-size: 0.95em;
}

.flashes .success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.flashes .error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Flash message inherits .flash-welcome styles */