:root {
    --accent: #E50071;
    --black: #000000;
    --white: #FFFFFF;
    --gray: #EBEBEB;
    --effect-bg: #E6F9E6;
    --effect-icon: #2E7D32;
    --border-radius: 8px;
    --max-width: 960px;
    --gap: 24px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 400;
    color: var(--black);
    background: var(--white);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ---------- Header ---------- */
.header {
    background: var(--white);
    border-bottom: 1px solid var(--gray);
    padding: 0 var(--gap);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header__inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    height: 64px;
}

.logo {
    font-weight: 700;
    font-size: 18px;
    color: var(--black);
    text-decoration: none;
    margin-right: auto;
    letter-spacing: -0.3px;
}

.logo__dot {
    color: var(--accent);
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--accent);
    vertical-align: middle;
    margin: 0 1px;
}

.nav {
    display: flex;
    gap: 24px;
    margin-right: 24px;
}

.nav__link {
    color: var(--black);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    padding: 4px 0;
    border-bottom: 2px solid transparent;
    transition: border-color 0.15s;
}

.nav__link:hover,
.nav__link--active {
    border-bottom-color: var(--accent);
}

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

.header__user {
    font-size: 13px;
    color: #666;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 14px;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, opacity 0.15s;
}

.btn--primary {
    background: var(--accent);
    color: var(--white);
}

.btn--primary:hover {
    opacity: 0.88;
}

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

.btn--outline:hover {
    border-color: var(--accent);
}

.btn--large {
    padding: 14px 36px;
    font-size: 16px;
}

/* ---------- Main ---------- */
.main {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--gap);
    min-height: calc(100vh - 64px - 60px);
}

/* ---------- Footer ---------- */
.footer {
    background: var(--gray);
    padding: 18px var(--gap);
    text-align: left;
}

.footer__inner {
    max-width: var(--max-width);
    margin: 0 auto;
    font-size: 13px;
    color: #666;
}

/* ---------- Hero ---------- */
.hero {
    padding: 64px 0 48px;
}

.hero__title {
    font-weight: 700;
    font-size: 40px;
    line-height: 1.15;
    margin-bottom: 16px;
}

.hero__subtitle {
    font-size: 18px;
    -webkit-font-smoothing: auto;
    max-width: 640px;
    line-height: 1.5;
    margin-bottom: 32px;
}

/* ---------- Sections ---------- */
.section {
    padding: 48px 0;
}

.section--gray {
    background: var(--gray);
    margin: 0 calc(-1 * var(--gap));
    padding: 48px var(--gap);
}

.section__title {
    font-weight: 700;
    font-size: 28px;
    margin-bottom: 8px;
}

.section__desc {
    margin-bottom: 24px;
}

/* ---------- Cards Grid ---------- */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: var(--gap);
    margin-top: 24px;
}

.card {
    background: var(--white);
    padding: 24px;
    border-radius: var(--border-radius);
    border: 1px solid var(--gray);
}

.card__title {
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 8px;
}

/* ---------- Tracks ---------- */
.tracks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--gap);
    margin-top: 24px;
}

.track-card {
    background: var(--white);
    padding: 24px;
    border-radius: var(--border-radius);
    border: 1px solid var(--gray);
}

.track-card__title {
    font-weight: 700;
    font-size: 18px;
    margin-bottom: 8px;
}

/* ---------- Steps ---------- */
.steps {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.step {
    flex: 1;
    min-width: 220px;
    text-align: left;
}

.step__number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    margin-bottom: 12px;
}

.step__title {
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 4px;
}

.step__arrow {
    font-size: 24px;
    color: var(--accent);
    align-self: flex-start;
    margin-top: 36px;
    display: none;
}

@media (min-width: 640px) {
    .step__arrow {
        display: block;
    }
}

/* ---------- Prizes ---------- */
.prizes {
    display: flex;
    gap: var(--gap);
    margin-top: 16px;
    flex-wrap: wrap;
}

.prize {
    background: var(--accent);
    padding: 16px 24px;
    border-radius: var(--border-radius);
    border: 1px solid var(--accent);
    font-size: 16px;
    color: var(--white);
}

/* ---------- Vibe banner (in steps) ---------- */
.vibe-banner {
    margin-top: 24px;
    background: var(--gray);
    padding: 16px 24px;
    border-radius: var(--border-radius);
    font-weight: 500;
    font-size: 16px;
    text-align: center;
}

/* ---------- Vibe tools (На чем ВайбКодить?) ---------- */
.vibetools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--gap);
    margin-top: 24px;
}

.vibetool-panel {
    background: var(--white);
    padding: 24px;
    border-radius: var(--border-radius);
    border: 1px solid var(--gray);
}

.vibetool-panel__title {
    font-weight: 700;
    font-size: 18px;
    margin-bottom: 12px;
}

.vibetool-panel__list {
    list-style: disc;
    padding-left: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.vibetool-panel__sublist {
    list-style: circle;
    padding-left: 20px;
    margin-top: 6px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.vibetool-panel__text {
    margin-bottom: 8px;
}

.vibetool-note {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: var(--border-radius);
    font-size: 14px;
    line-height: 1.5;
}

.vibetool-note--green {
    background: var(--effect-bg);
    color: #1e6b2a;
}

.vibetool-note--accent {
    background: var(--accent);
    color: var(--white);
}

/* ---------- FAQ ---------- */
.faq {
    margin-top: 16px;
}

.faq__item {
    border-bottom: 1px solid var(--gray);
    padding: 16px 0;
}

.faq__item summary {
    font-weight: 500;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.faq__item summary::after {
    content: '+';
    font-size: 20px;
    color: var(--accent);
}

.faq__item[open] summary::after {
    content: '−';
}

.faq__item p {
    margin-top: 8px;
    padding-left: 0;
    color: #333;
}

/* ---------- Auth ---------- */
.auth-page {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 80px;
}

.auth-card {
    background: var(--white);
    border: 1px solid var(--gray);
    border-radius: var(--border-radius);
    padding: 40px;
    width: 100%;
    max-width: 400px;
}

.auth-card__title {
    font-weight: 700;
    font-size: 24px;
    margin-bottom: 24px;
}

.auth-step {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.auth-label {
    font-weight: 500;
    font-size: 14px;
}

.auth-input {
    padding: 12px 16px;
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    border: 1px solid var(--gray);
    border-radius: var(--border-radius);
    outline: none;
    transition: border-color 0.15s;
}

.auth-input:focus {
    border-color: var(--accent);
}

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

.auth-hint {
    font-size: 13px;
    color: #666;
}

.auth-error {
    font-size: 13px;
    color: var(--accent);
}

/* ---------- Admin ---------- */
.admin-layout {
    display: flex;
    gap: 0;
    margin-top: 24px;
}

.admin-sidebar {
    width: 220px;
    flex-shrink: 0;
    background: var(--gray);
    border-radius: var(--border-radius);
    padding: 16px 0;
    margin-right: 24px;
}

.admin-menu__item {
    display: block;
    padding: 10px 20px;
    color: var(--black);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: background 0.1s;
}

.admin-menu__item:hover,
.admin-menu__item--active {
    background: var(--white);
}

.admin-content {
    flex: 1;
    min-width: 0;
}

/* ---------- Registration ---------- */
.reg-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 24px;
}

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

.participant-card {
    background: var(--white);
    border: 1px solid var(--gray);
    border-radius: var(--border-radius);
    padding: 24px;
}

.participant-card__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.participant-card__name {
    font-weight: 700;
    font-size: 18px;
}

.participant-card__track {
    font-size: 13px;
    font-weight: 500;
    color: var(--accent);
}

.participant-card__title {
    font-size: 16px;
    margin-bottom: 8px;
}

.participant-card__details summary {
    font-weight: 500;
    cursor: pointer;
    color: var(--accent);
    font-size: 14px;
}

.participant-card__body {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--gray);
}

.effect-block {
    background: var(--effect-bg);
    padding: 12px 16px;
    border-radius: var(--border-radius);
    margin-top: 16px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.effect-block__icon {
    color: var(--effect-icon);
    font-weight: 700;
    font-size: 18px;
}

.participant-card__files {
    margin-top: 16px;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
}

.file-item__name {
    flex: 1;
    font-size: 14px;
    color: #333;
}

.participant-card__upload {
    margin-top: 12px;
}

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

.upload-input {
    font-size: 14px;
}

.btn--small {
    padding: 6px 14px;
    font-size: 13px;
}

.empty-message {
    color: #666;
    font-size: 16px;
    padding: 24px 0;
}

/* ---------- Register Form ---------- */
.register-form {
    max-width: 560px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 24px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-label {
    font-weight: 500;
    font-size: 14px;
}

.form-input {
    padding: 12px 16px;
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    border: 1px solid var(--gray);
    border-radius: var(--border-radius);
    outline: none;
    transition: border-color 0.15s;
}

.form-input:focus {
    border-color: var(--accent);
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
}

/* ---------- Voting ---------- */
.voting-layout {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.track-vote-block {
    background: var(--gray);
    padding: 24px;
    border-radius: var(--border-radius);
}

.track-vote-block__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.track-vote-block__title {
    font-weight: 700;
    font-size: 20px;
}

.votes-info {
    font-size: 14px;
    color: #666;
}

.votes-info__spent {
    color: var(--accent);
    font-weight: 700;
}

.votes-info-empty {
    margin-top: 16px;
    font-size: 13px;
    color: #666;
}

.link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

.link:hover {
    text-decoration: underline;
}

.admin-note {
    margin-bottom: 16px;
}

.vote-participant {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--white);
    padding: 12px 16px;
    border-radius: var(--border-radius);
    margin-bottom: 8px;
}

.vote-participant__name {
    font-weight: 500;
}

.vote-participant__project {
    font-size: 13px;
    color: #666;
}

.btn--vote:disabled {
    background: #ccc;
    color: #999;
    cursor: not-allowed;
}

/* ---------- Track groups in participants ---------- */
.track-group {
    margin-bottom: 40px;
}

.track-group__header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    border-bottom: 2px solid var(--gray);
    padding-bottom: 8px;
    margin-bottom: 16px;
}

.track-group__title {
    font-weight: 700;
    font-size: 22px;
    margin: 0;
}

.participant-card--voted {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent);
}

.vote-mark {
    font-size: 13px;
    font-weight: 500;
    color: var(--accent);
    margin-left: auto;
}

.participant-card__vote {
    margin: 8px 0 12px;
}

.participant-card__vote form {
    display: inline;
}

/* ---------- Dashboard ---------- */
.dashboard-layout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--gap);
}

.dashboard-track {
    background: var(--gray);
    padding: 24px;
    border-radius: var(--border-radius);
}

.dashboard-track__title {
    font-weight: 700;
    font-size: 20px;
    margin-bottom: 16px;
}

.rating-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: var(--white);
    border-radius: 6px;
    margin-bottom: 6px;
}

.rating-row--gold {
    border-left: 3px solid var(--accent);
    background: #fff5f9;
}

.rating-row--silver {
    border-left: 3px solid var(--accent);
}

.rating-row--bronze {
    border-left: 3px solid var(--accent);
}

.rating-row__place {
    font-weight: 700;
    color: var(--accent);
    width: 28px;
}

.rating-row__name {
    flex: 1;
    font-weight: 500;
}

.rating-row__name small {
    display: block;
    font-weight: 400;
    font-size: 12px;
    color: #666;
}

.rating-row__score {
    font-weight: 700;
    font-size: 16px;
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
    .hero__title { font-size: 28px; }
    .header__inner { flex-wrap: wrap; height: auto; padding: 12px 0; }
    .nav { order: 3; width: 100%; justify-content: center; margin: 8px 0 0 0; }
    .admin-layout { flex-direction: column; }
    .admin-sidebar { width: 100%; margin-right: 0; margin-bottom: 16px; }
    .reg-header { flex-direction: column; gap: 12px; }
    .reg-header .btn { align-self: flex-start; }
    .vote-participant { flex-direction: column; align-items: flex-start; gap: 8px; }
}