@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400 ;600;800&family=Montserrat:wght@700&display=swap');

:root {
    --bg-main: #06070d;
    --bg-card: rgba(15, 17, 26, 0.9);
    --accent: #6c5ce7;
    --accent-hover: #7f73ff;
    --text-main: #ffffff;
    --text-muted: #9da3c2;
    --danger: #ff4757;
    --border: rgba(255, 255, 255, 0.1);
    --radius-lg: 16px;
    --radius-md: 10px;
    --shadow-neon: 0 0 20px rgba(108, 92, 231, 0.4);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
}

#vanta-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -999;
    pointer-events: none;
}

canvas {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: -999 !important;
    pointer-events: none !important;
}

#vanta-bg canvas {
    width: 100% !important;
    height: 100% !important;
}

html {
    height: 100%;
    min-height: 100vh;
    overflow-x: hidden;
}

body {
    position: relative;
    min-height: 100vh;
    background: #06070d;
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    line-height: 1.5;
    display: block;
}

.page-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

.container {
    width: 92%;
    max-width: 1200px;
    margin: 0 auto;
}

main {
    flex: 1 0 auto;
    padding: 100px 0 40px;
    position: relative;
    z-index: 1;
}

.flex-center {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 75vh;
}

.grid-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 25px;
}

@media (min-width: 900px) {
    .grid-two-cols {
        grid-template-columns: 2fr 1fr;
    }
}

.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(10, 12, 20, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 15px 0;
}

.topbar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand a {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    color: #a29bfe;
    text-decoration: none;
    letter-spacing: -0.5px;
}

nav {
    display: flex;
    align-items: center;
    gap: 15px;
}

nav a {
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition);
    padding: 8px 12px;
    border-radius: var(--radius-md);
}

nav a:hover {
    background: rgba(255, 255, 255, 0.05);
}

nav a.danger {
    color: var(--danger) !important;
    border: 1px solid rgba(255, 71, 87, 0.3);
    background: rgba(255, 71, 87, 0.1);
}

nav a.danger:hover {
    background: var(--danger) !important;
    color: #fff !important;
}

.panel, .acedMainblock, .auth-card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    margin-bottom: 25px;
}

.auth-card {
    width: 100%;
    max-width: 450px;
}

h1, h2, h3 {
    margin-bottom: 20px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.btn-primary, .btn-ghost, .danger, .btn-deleteacc, button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    text-decoration: none;
    gap: 8px;
}

.btn-primary, button:not(.btn-ghost):not(.danger):not(.btn-deleteacc) {
    background: var(--accent);
    color: #fff;
    box-shadow: var(--shadow-neon);
}

.btn-primary:hover, button:hover:not(.btn-ghost):not(.danger) {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(108, 92, 231, 0.6);
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    border: 1px solid var(--border);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent);
}

.danger, .btn-deleteacc {
    background: rgba(255, 71, 87, 0.15) !important;
    color: var(--danger) !important;
    border: 1px solid rgba(255, 71, 87, 0.3) !important;
}

.danger:hover, .btn-deleteacc:hover {
    background: var(--danger) !important;
    color: #fff !important;
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(255, 71, 87, 0.4);
}

label {
    display: block;
    margin-bottom: 15px;
    font-weight: 600;
    color: var(--text-muted);
}

input, textarea {
    width: 100%;
    padding: 14px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: #fff;
    margin-top: 8px;
    outline: none;
    transition: border-color 0.2s;
}

input:focus, textarea:focus {
    border-color: var(--accent);
}

.list-item, .repo-list li, .file-list li {
    background: rgba(255, 255, 255, 0.03);
    padding: 15px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--border);
    transition: var(--transition);
}

.list-item:hover {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.05);
}

footer {
    flex-shrink: 0;
    background: rgba(10, 12, 20, 0.95);
    padding: 25px;
    text-align: center;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.9rem;
    position: relative;
    z-index: 1;
}

@media (max-width: 768px) {
    .topbar-inner { flex-direction: column; gap: 15px; }
    .list-item { flex-direction: column; align-items: flex-start; gap: 10px; }
    .actions { width: 100%; display: flex; justify-content: space-between; }
    .auth-card { padding: 20px; }
}

.panel p {
    font-weight: 400;
    letter-spacing: 0.3px;
}

.panel h1 {
    font-family: 'Montserrat', sans-serif;
    text-transform: none;
    background: linear-gradient(135deg, #a29bfe 0%, #6c5ce7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

img {
    max-width: 100%;
    height: auto;
}

button {
    width: auto;
    max-width: 100%;
}

input, textarea, select {
    font-size: 16px;
}

h1 { font-size: clamp(24px, 5vw, 36px); }
h2 { font-size: clamp(20px, 4vw, 28px); }
h3 { font-size: clamp(18px, 3vw, 22px); }

body {
    font-size: clamp(14px, 2.5vw, 16px);
}

.container {
    width: 95%;
    padding: 0 10px;
}

@media (max-width: 768px) {
    nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }

    nav a {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 768px) {
    .panel,
    .acedMainblock,
    .auth-card {
        padding: 20px;
        border-radius: 12px;
    }
}

@media (max-width: 768px) {
    input,
    textarea {
        padding: 12px;
        font-size: 16px;
    }

    label {
        font-size: 14px;
    }
}

@media (max-width: 768px) {
    .btn-primary,
    .btn-ghost,
    button {
        width: 100%;
        padding: 14px;
    }
}

@media (max-width: 900px) {
    .grid-two-cols {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .list-item,
    .repo-list li,
    .file-list li {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}

@media (max-width: 768px) {
    footer {
        padding: 20px 10px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    main {
        padding: 80px 0 20px;
    }

    .container {
        width: 96%;
    }

    .auth-card {
        max-width: 100%;
        padding: 16px;
    }
}

@media (max-width: 360px) {
    body {
        font-size: 14px;
    }

    .btn-primary,
    .btn-ghost {
        padding: 12px;
        font-size: 14px;
    }
}

.burger {
    display: none;
    width: 30px;
    height: 22px;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
}

.burger span {
    display: block;
    height: 3px;
    background: #fff;
    border-radius: 3px;
    transition: 0.3s;
}

@media (max-width: 768px) {
    .topbar-inner {
        flex-direction: row;
    }

    .burger {
        display: flex;
    }

    nav {
        position: absolute;
        top: 70px;
        left: 0;
        width: 100%;
        background: rgba(10, 12, 20, 0.98);
        backdrop-filter: blur(15px);
        flex-direction: column;
        padding: 20px;
        border-bottom: 1px solid var(--border);

        opacity: 0;
        transform: translateY(-10px);
        pointer-events: none;
        transition: 0.3s;
    }

    nav.active {
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
    }

    nav a {
        width: 100%;
        text-align: center;
        padding: 14px;
    }
}

.burger.open span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.burger.open span:nth-child(2) {
    opacity: 0;
}

.burger.open span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/*Адаптивный репозиторий*/
.list-item a,
.list-item {
    word-break: break-word;
    overflow-wrap: anywhere;
}

.list-item > a {
    flex: 1;
    min-width: 0;
}

.repo-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}

@media (max-width: 768px) {
    .repo-header {
        flex-direction: column;
        align-items: stretch;
    }

    .repo-header .btn-primary {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .file-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .file-actions a {
        flex: 1;
        text-align: center;
    }
}

.forgot-password {
    text-align: center;
    margin-top: 15px;
    font-size: 0.9rem;
}

.forgot-password a {
    color: var(--accent, #6c5ce7);
    text-decoration: none;
}

.forgot-password a:hover {
    text-decoration: underline;
}