/* Registration form — styles that extend styles.css without duplicating its rules.
   styles.css must be loaded first (provides .btn, .card, .form-*, .alert, CSS vars). */

/* ── Self-hosted Roboto (variable font, wght 100–900) ───────────────────── */

@font-face {
    font-family: 'Roboto';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('/assets/fonts/Roboto/Roboto-cyrillic-ext.woff2') format('woff2-variations');
    unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}

@font-face {
    font-family: 'Roboto';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('/assets/fonts/Roboto/Roboto-cyrillic.woff2') format('woff2-variations');
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
    font-family: 'Roboto';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('/assets/fonts/Roboto/Roboto-latin-ext.woff2') format('woff2-variations');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'Roboto';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('/assets/fonts/Roboto/Roboto-latin.woff2') format('woff2-variations');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ── Page layout ─────────────────────────────────────────────────────────── */

.form-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 32px 16px 64px;
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}

.form-page__wrapper {
    max-width: 640px;
    width: 100%;
}

/* ── Card (header + form share one continuous white surface) ───────────── */

.form-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.form-card__header {
    padding: 32px 28px 24px;
    text-align: center;
}

.form-card__body {
    padding: 8px 28px 32px;
}

/* ── Header ──────────────────────────────────────────────────────────────── */

.form-page__logo-wrap {
    width: 160px;
    height: 160px;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.form-page__logo {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.form-page__title {
    font-size: 24px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 12px;
    line-height: 1.3;
}

.form-page__description {
    font-size: 14px;
    color: var(--gray-600);
    line-height: 1.7;
}

/* ── Required asterisk ───────────────────────────────────────────────────── */

.form-required {
    color: var(--danger);
    margin-left: 2px;
}

/* ── Field hint (below input, not an error) ──────────────────────────────── */

.field-hint {
    display: block;
    margin-top: 4px;
    font-size: 12px;
}

/* ── Char counter ────────────────────────────────────────────────────────── */

.form-hint {
    margin-top: 4px;
    text-align: right;
}

#js-char-counter.is-near-limit { color: var(--warning); }
#js-char-counter.is-at-limit   { color: var(--danger); }

/* ── Validation state ────────────────────────────────────────────────────── */

.form-control.is-invalid,
.form-check-input.is-invalid {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.field-error {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: var(--danger);
}

/* ── File drop zone ──────────────────────────────────────────────────────── */

.file-drop-zone {
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius);
    padding: 24px 16px;
    text-align: center;
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    background: var(--gray-50);
    transition: border-color 0.2s, background 0.2s;
    user-select: none;
}

.file-drop-zone:hover,
.file-drop-zone:focus {
    border-color: var(--primary);
    background: #eff6ff;
    outline: none;
}

.file-drop-zone.drag-over {
    border-color: var(--primary);
    background: #dbeafe;
}

.file-drop-zone.has-error {
    border-color: var(--danger);
}

/* Hidden native input covers the whole zone so clicking anywhere triggers it */
.file-drop-zone__input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.file-drop-zone__icon  { font-size: 32px; line-height: 1; }
.file-drop-zone__label { font-size: 14px; font-weight: 500; color: var(--gray-700); }
.file-drop-zone__hint  { font-size: 12px; color: var(--gray-400); }

/* ── File counter badge ──────────────────────────────────────────────────── */

.file-counter {
    margin-top: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-500);
}

.file-counter.is-ready { color: var(--success); }
.file-counter.is-warn  { color: var(--warning); }

/* ── Photo preview grid ──────────────────────────────────────────────────── */

.file-preview-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.file-preview-grid__item {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--gray-200);
    background: var(--gray-100);
    flex-shrink: 0;
}

.file-preview-grid__item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.file-preview-grid__remove {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 20px;
    height: 20px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    color: white;
    font-size: 11px;
    line-height: 20px;
    text-align: center;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.file-preview-grid__remove:hover {
    background: rgba(239, 68, 68, 0.85);
}

/* ── Description below form + submit row ─────────────────────────────────── */

.form-page__description-bottom {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 13px;
    color: #0369a1;
    line-height: 1.6;
    margin-bottom: 16px;
    padding: 14px 16px;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: var(--radius);
}
.form-page__hint {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
}
.form-page__hint-icon {
    font-size: 20px;
    line-height: 1;
    flex-shrink: 0;
    margin-top: 1px;
}

.form-page__submit-row {
    margin-top: 8px;
}

.btn-submit-form {
    width: 100%;
    justify-content: center;
    padding: 14px 24px;
    font-size: 16px;
}

.btn-submit-form:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* ── Success state ───────────────────────────────────────────────────────── */

.form-page__success {
    text-align: center;
    padding: 40px 32px;
    font-size: 16px;
    margin-top: 16px;
}

.form-page__success-icon {
    font-size: 48px;
    margin-bottom: 8px;
}

/* ── Closed state (сезон не активен/завершён) ────────────────────────────── */

.form-page__closed {
    text-align: center;
    padding: 40px 32px;
    font-size: 16px;
    margin-top: 16px;
}

.form-page__closed-icon {
    font-size: 48px;
    margin-bottom: 8px;
}

.form-page__closed p:not(.form-page__closed-icon) {
    white-space: pre-line;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 480px) {
    .form-page {
        padding: 16px 12px 48px;
    }

    .form-card__header {
        padding: 24px 20px 20px;
    }

    .form-card__body {
        padding: 4px 20px 24px;
    }

    .form-page__logo-wrap {
        width: 120px;
        height: 120px;
    }

    .form-page__title {
        font-size: 20px;
    }

    .file-preview-grid__item {
        width: 68px;
        height: 68px;
    }
}
