/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg:          #2c3e50;
    --bg-card:     rgba(255,255,255,0.12);
    --bg-card-h:   rgba(255,255,255,0.18);
    --border:      rgba(255,255,255,0.15);
    --text:        #ffffff;
    --text-muted:  rgba(255,255,255,0.7);
    --accent:      linear-gradient(135deg, #2196f3 0%, #00bcd4 50%, #4caf50 100%);
    --accent-red:  linear-gradient(135deg, #f44336 0%, #ff5722 40%, #ff9800 70%, #ffc107 100%);
    --radius:      12px;
    --shadow:      0 8px 25px rgba(0,0,0,0.2);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

/* ===== HOME PAGE ===== */
.page-home {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 40px 20px;
    text-align: center;
}

.main-title {
    font-size: 3em;
    font-weight: 700;
    background: var(--accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
}

.main-subtitle {
    color: var(--text-muted);
    font-size: 1.1em;
    margin-bottom: 50px;
}

.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
    max-width: 700px;
    width: 100%;
    margin-bottom: 40px;
}

.menu-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 36px 28px;
    text-decoration: none;
    color: var(--text);
    transition: all 0.25s ease;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.menu-card:hover {
    background: var(--bg-card-h);
    transform: translateY(-4px);
    box-shadow: 0 16px 40px rgba(0,0,0,0.25);
    border-color: rgba(33,150,243,0.4);
}

.menu-card__icon { font-size: 2.5em; }
.menu-card__title { font-size: 1.4em; font-weight: 700; }
.menu-card__desc  { color: var(--text-muted); font-size: 0.9em; line-height: 1.4; }

/* ── Landing: карточки-плитки ── */
.menu-card--soon {
    opacity: 0.65;
    cursor: default;
    pointer-events: none;
}
.menu-card--soon:hover { transform: none; box-shadow: var(--shadow); }

.badge-soon {
    display: inline-block;
    margin-top: 6px;
    font-size: 0.75em;
    background: rgba(255,152,0,0.25);
    border: 1px solid rgba(255,152,0,0.5);
    color: #ffcc80;
    border-radius: 4px;
    padding: 2px 8px;
}

.privacy-note {
    background: rgba(76,175,80,0.15);
    border: 1px solid rgba(76,175,80,0.3);
    border-radius: 8px;
    padding: 12px 24px;
    font-size: 0.85em;
    color: rgba(255,255,255,0.8);
}

/* ===== INNER PAGES LAYOUT ===== */
.page-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 30px 60px;
}

.page-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 36px;
}

.back-btn {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 10px;
    padding: 10px 18px;
    font-size: 1em;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    white-space: nowrap;
}
.back-btn:hover { background: var(--bg-card-h); }

.page-title {
    font-size: 1.9em;
    font-weight: 700;
    background: var(--accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== TWO-COLUMN LAYOUT ===== */
.content-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 28px;
    align-items: start;
}

@media (max-width: 900px) {
    .content-layout { grid-template-columns: 1fr; }
}

/* ===== CARD ===== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.card h3 {
    font-size: 1em;
    font-weight: 600;
    margin-bottom: 16px;
    color: rgba(255,255,255,0.9);
}

/* ===== FORM ELEMENTS ===== */
label.field-label {
    display: block;
    font-size: 0.85em;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.file-drop {
    border: 2px dashed var(--border);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-muted);
    font-size: 0.9em;
    position: relative;
}
.file-drop:hover, .file-drop.dragover {
    border-color: #2196f3;
    background: rgba(33,150,243,0.08);
    color: var(--text);
}
.file-drop input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}
.file-drop .drop-icon { font-size: 1.8em; margin-bottom: 6px; }
.file-drop .drop-hint { font-size: 0.8em; margin-top: 4px; }

.file-list {
    margin-top: 10px;
    font-size: 0.82em;
    color: var(--text-muted);
    max-height: 100px;
    overflow-y: auto;
    text-align: left;
}
.file-list span { display: block; padding: 2px 0; }

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 22px;
    border: none;
    border-radius: 10px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 4px 15px rgba(33,150,243,0.3);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(33,150,243,0.4); }

.btn-run {
    background: var(--accent-red);
    color: #fff;
    width: 100%;
    font-size: 1.1em;
    padding: 14px;
    box-shadow: 0 4px 15px rgba(244,67,54,0.3);
}
.btn-run:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(244,67,54,0.4); }
.btn-run:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-download {
    background: rgba(76,175,80,0.2);
    border: 1px solid rgba(76,175,80,0.4);
    color: #81c784;
    width: 100%;
    margin-bottom: 10px;
    justify-content: flex-start;
}
.btn-download:hover { background: rgba(76,175,80,0.3); }

/* ===== STATUS ===== */
.status-message {
    margin-top: 14px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.9em;
    display: none;
}
.status-message.info    { display:block; background:rgba(33,150,243,0.15); color:#90caf9; }
.status-message.success { display:block; background:rgba(76,175,80,0.15);  color:#a5d6a7; }
.status-message.error   { display:block; background:rgba(244,67,54,0.15);  color:#ef9a9a; }

/* ===== RESULTS SECTION ===== */
.results-section { display: none; }
.results-section.visible { display: block; }

/* ===== SIDEBAR (instruction) ===== */
.sidebar-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    backdrop-filter: blur(10px);
    position: sticky;
    top: 20px;
}

.sidebar-card h3 {
    font-size: 1em;
    font-weight: 600;
    margin-bottom: 16px;
}

.sidebar-card ol {
    padding-left: 18px;
    color: var(--text-muted);
    font-size: 0.88em;
    line-height: 1.7;
}

.sidebar-card li { margin-bottom: 8px; }

.privacy-badge {
    margin-top: 20px;
    background: rgba(76,175,80,0.12);
    border: 1px solid rgba(76,175,80,0.25);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.8em;
    color: #a5d6a7;
    line-height: 1.4;
}

/* ===== SKIPPED FILES ===== */
.skipped-box {
    background: rgba(255,152,0,0.1);
    border: 1px solid rgba(255,152,0,0.3);
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 0.82em;
    color: #ffcc80;
    white-space: pre-wrap;
    margin-top: 10px;
    display: none;
}
.skipped-box.visible { display: block; }

/* ===== AUTH PAGES ===== */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 30px 16px;
}

.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow);
    padding: 44px 40px 36px;
    width: 100%;
    max-width: 420px;
}

.auth-card--wide { max-width: 520px; }

.auth-logo {
    display: block;
    font-size: 1.5em;
    font-weight: 800;
    background: var(--accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 18px;
    text-align: center;
    text-decoration: none;
}

.auth-title {
    font-size: 1.5em;
    font-weight: 700;
    margin-bottom: 8px;
    text-align: center;
}

.auth-subtitle {
    color: var(--text-muted);
    font-size: 0.9em;
    text-align: center;
    margin-bottom: 28px;
    line-height: 1.5;
}

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

.auth-field { display: flex; flex-direction: column; gap: 6px; }

.auth-label { font-size: 0.85em; color: var(--text-muted); font-weight: 500; }

.auth-input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255,255,255,0.1);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 1em;
    font-family: inherit;
    box-sizing: border-box;
    transition: border-color 0.2s;
}
.auth-input:focus { outline: none; border-color: #2196f3; }
.auth-input::placeholder { color: rgba(255,255,255,0.3); }

.auth-input--code {
    font-size: 1.6em;
    letter-spacing: 0.3em;
    text-align: center;
    font-weight: 700;
}

.auth-btn {
    width: 100%;
    padding: 13px;
    background: linear-gradient(135deg, #2196f3, #00bcd4);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.15s;
    text-decoration: none;
    display: block;
    text-align: center;
    margin-top: 4px;
}
.auth-btn:hover { opacity: 0.9; transform: translateY(-1px); }

.auth-btn--max {
    background: linear-gradient(135deg, #5c6bc0, #3949ab);
    margin-top: 20px;
}

.auth-error {
    background: rgba(244,67,54,0.15);
    border: 1px solid rgba(244,67,54,0.4);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.88em;
    color: #ef9a9a;
    margin-bottom: 4px;
}

.auth-divider {
    height: 1px;
    background: var(--border);
    margin: 24px 0 16px;
}

.auth-hint {
    text-align: center;
    font-size: 0.88em;
    color: var(--text-muted);
}

.auth-link { color: #90caf9; text-decoration: none; }
.auth-link:hover { text-decoration: underline; }

/* ── Шаги регистрации ── */
.reg-steps {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 20px;
}

.reg-step {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.reg-step__num {
    min-width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2196f3, #00bcd4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85em;
    font-weight: 700;
    flex-shrink: 0;
}

.reg-step__text {
    font-size: 0.9em;
    color: var(--text-muted);
    padding-top: 5px;
    line-height: 1.5;
}

.reg-consent-note {
    background: rgba(76,175,80,0.1);
    border: 1px solid rgba(76,175,80,0.3);
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 0.85em;
    color: rgba(255,255,255,0.75);
    line-height: 1.5;
    margin-bottom: 4px;
}

.reg-pending {
    background: rgba(255,152,0,0.1);
    border: 1px solid rgba(255,152,0,0.35);
    border-radius: 8px;
    padding: 14px 18px;
    font-size: 0.88em;
    color: #ffcc80;
    line-height: 1.5;
    margin-top: 20px;
    text-align: center;
}

/* ── Гость на главной ── */
.guest-info {
    max-width: 560px;
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px 36px;
    margin-bottom: 28px;
    backdrop-filter: blur(10px);
}

.guest-info__text {
    color: var(--text-muted);
    font-size: 1em;
    line-height: 1.6;
    margin-bottom: 16px;
    text-align: center;
}

.guest-info__note {
    font-size: 0.85em;
    color: rgba(76,175,80,0.9);
    text-align: center;
    margin-bottom: 20px;
}

.guest-info__features {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.feature-item {
    font-size: 0.9em;
    color: var(--text-muted);
    padding: 8px 12px;
    background: rgba(255,255,255,0.06);
    border-radius: 6px;
}

.auth-buttons {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 32px;
}

.btn-auth {
    padding: 13px 36px;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.15s;
}
.btn-auth:hover { opacity: 0.9; transform: translateY(-2px); }

.btn-auth--primary {
    background: linear-gradient(135deg, #2196f3, #00bcd4);
    color: #fff;
}

.btn-auth--secondary {
    background: rgba(255,255,255,0.12);
    border: 1px solid var(--border);
    color: var(--text);
}

/* ── Бейдж пользователя на главной ── */
.user-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,0.08);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 18px;
    margin-bottom: 32px;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 700px;
    width: 100%;
}

.user-badge__name { font-weight: 600; font-size: 0.95em; }
.user-badge__role, .user-badge__school {
    font-size: 0.82em;
    color: var(--text-muted);
}
.user-badge__role::before { content: "·"; margin-right: 6px; }
.user-badge__school::before { content: "·"; margin-right: 6px; }

.user-badge__logout {
    margin-left: auto;
    font-size: 0.82em;
    color: rgba(255,255,255,0.45);
    text-decoration: none;
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid rgba(255,255,255,0.15);
    transition: all 0.2s;
}
.user-badge__logout:hover { color: #ef9a9a; border-color: rgba(244,67,54,0.4); }

/* ── Поля формы регистрации ── */
.field { display: flex; flex-direction: column; gap: 5px; }
.req { color: #ef5350; }

.auth-input--err { border-color: rgba(244,67,54,0.6) !important; }
.field-err { font-size: 0.78em; color: #ef9a9a; margin-top: 2px; }

.consent-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.85em;
    color: var(--text-muted);
    line-height: 1.5;
    cursor: pointer;
    margin-top: 4px;
    padding: 12px 14px;
    border: 1px solid transparent;
    border-radius: 8px;
    transition: border-color 0.2s;
}
.consent-label--err { border-color: rgba(244,67,54,0.4); }
.consent-check {
    margin-top: 3px;
    flex-shrink: 0;
    accent-color: #2196f3;
    width: 16px;
    height: 16px;
}

/* ── Шаги после регистрации ── */
.done-steps { display: flex; flex-direction: column; gap: 14px; margin: 20px 0 4px; }
.done-step { display: flex; align-items: flex-start; gap: 14px; }
.done-step__num {
    min-width: 28px; height: 28px; border-radius: 50%;
    background: linear-gradient(135deg, #2196f3, #00bcd4);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.85em; font-weight: 700; flex-shrink: 0;
}
.done-step__text {
    font-size: 0.9em; color: var(--text-muted);
    padding-top: 4px; line-height: 1.5;
}

/* ── Секции формы регистрации ── */
.form-section {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 18px 20px 20px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
}

.form-section__title {
    font-size: 0.78em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(255,255,255,0.45);
    margin-bottom: 2px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
@media (max-width: 520px) { .form-row { grid-template-columns: 1fr; } }

.field-hint {
    font-size: 0.78em;
    color: rgba(255,255,255,0.35);
    margin-top: 2px;
}

/* ── Обёртка согласия ── */
.consent-box {
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 4px;
    transition: border-color 0.2s;
}
.consent-box--err { border-color: rgba(244,67,54,0.4); }

/* ── Таймер повторного кода ── */
.code-retry {
    text-align: center;
    margin-top: 18px;
    min-height: 22px;
}

.code-retry__timer {
    font-size: 0.85em;
    color: var(--text-muted);
}

.code-retry__link {
    font-size: 0.85em;
    color: #90caf9;
    text-decoration: none;
}
.code-retry__link:hover { text-decoration: underline; }

/* ── Галочка «готово» ── */
.done-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4caf50, #66bb6a);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8em;
    font-weight: 700;
    color: #fff;
    box-shadow: 0 4px 16px rgba(76,175,80,0.35);
}

/* ── Кнопка бота ── */
.auth-btn--bot {
    background: linear-gradient(135deg, #5c6bc0, #3949ab);
    margin-top: 20px;
}

/* ── Подвал auth-карточки ── */
.auth-footer {
    text-align: center;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    font-size: 0.88em;
}

.auth-footer__text {
    color: var(--text-muted);
}

.auth-footer__link {
    color: #90caf9;
    text-decoration: none;
    margin-left: 4px;
}
.auth-footer__link:hover { text-decoration: underline; }
