/* ============================================================
   CX Family — register.css
   Стили для регистрации и входа
   ============================================================ */

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

body {
    font-family: 'Inter', sans-serif;
    background: #0c0c0e;
    color: #ffffff;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.brand {
    text-decoration: none;
    margin-bottom: 40px;
    display: block;
    text-align: center;
}

.brand svg { opacity: 0.9; }

.card {
    background: #141416;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 28px;
    padding: 48px 44px;
    width: 100%;
    max-width: 520px;
}

.steps {
    display: flex;
    gap: 6px;
    margin-bottom: 36px;
}

.step-dot {
    height: 3px;
    flex: 1;
    border-radius: 99px;
    background: rgba(255,255,255,0.12);
}

.step-dot.active { background: #7c3aed; }
.step-dot.done { background: rgba(124,58,237,0.4); }

h1 {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 10px;
    letter-spacing: -0.3px;
}

.subtitle {
    color: #666;
    font-size: 15px;
    line-height: 1.5;
    margin-bottom: 32px;
}

.field-group { margin-bottom: 16px; }

.field-label {
    display: block;
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
}

.field-group input {
    width: 100%;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 14px;
    padding: 14px 18px;
    font-size: 15px;
    color: #fff;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: border-color 0.2s;
}

.field-group input::placeholder { color: #444; }
.field-group input:focus { border-color: rgba(255,255,255,0.35); }

.pw-hint {
    font-size: 12px;
    color: #666;
    margin-top: 6px;
    min-height: 0;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.2s, opacity 0.2s, color 0.2s;
}
.pw-hint.visible {
    max-height: 20px;
    opacity: 1;
}
.pw-hint-ok  { color: #4ade80; }
.pw-hint-err { color: #f87171; }

.error-msg {
    background: rgba(231, 76, 60, 0.1);
    border: 1px solid rgba(231, 76, 60, 0.25);
    border-radius: 12px;
    color: #e74c3c;
    padding: 12px 16px;
    font-size: 14px;
    margin-bottom: 20px;
}

.btn-primary {
    width: 100%;
    background: #7c3aed;
    color: #fff;
    border: none;
    padding: 16px;
    border-radius: 16px;
    font-size: 15px;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    margin-top: 8px;
    transition: background 0.2s, transform 0.1s;
    letter-spacing: 0.3px;
}

.btn-primary:hover { background: #6d28d9; }
.btn-primary:active { transform: scale(0.99); }
#submitBtn:disabled, .btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-primary:disabled:hover { background: #7c3aed; transform: none; }

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #555;
    text-decoration: none;
    font-size: 14px;
    margin-top: 20px;
    transition: color 0.2s;
}

.btn-back:hover { color: #aaa; }

.login-hint {
    text-align: center;
    margin-top: 24px;
    font-size: 14px;
    color: #555;
}

.login-hint a { color: #aaa; text-decoration: none; }
.login-hint a:hover { color: #fff; }

/* ── Step 2: Avatar & Phone ── */
.avatar-wrap { display: flex; flex-direction: column; align-items: center; margin-bottom: 32px; }

.avatar-preview {
    width: 100px; height: 100px; border-radius: 50%;
    background: linear-gradient(135deg, #7c3aed, #1673ff);
    display: flex; align-items: center; justify-content: center;
    font-family: 'Dela Gothic One', sans-serif; font-size: 36px; color: #fff;
    overflow: hidden; border: 2px solid rgba(255,255,255,0.1);
    position: relative; cursor: pointer;
}

.avatar-preview img { width: 100%; height: 100%; object-fit: cover; }

.avatar-overlay {
    position: absolute; inset: 0; border-radius: 50%;
    background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity 0.2s; font-size: 22px;
}

.avatar-preview:hover .avatar-overlay { opacity: 1; }
.avatar-hint { font-size: 13px; color: #555; margin-top: 12px; text-align: center; }
#avatarFileInput { display: none; }

.phone-row { display: flex; gap: 8px; }

.country-select {
    flex-shrink: 0; width: 170px; background: #0d0d1a;
    border: 1px solid rgba(255,255,255,0.1); border-radius: 14px;
    color: #fff; font-size: 13px; padding: 0 12px;
    appearance: none; cursor: pointer; height: 52px;
}

.country-select:focus { outline: none; border-color: #1673ff; }
.phone-input-wrap { flex: 1; }
.phone-input-wrap input { width: 100%; box-sizing: border-box; }
.phone-hint { font-size: 12px; color: #444; margin-top: 6px; }

/* ── Step 3: Role ── */
.roles-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }

.role-pill {
    padding: 10px 18px; border-radius: 99px;
    border: 1px solid rgba(255,255,255,0.12);
    background: transparent; color: #aaa; font-size: 14px;
    font-family: 'Inter', sans-serif; cursor: pointer;
    transition: all 0.15s; user-select: none;
}

.role-pill:hover { border-color: rgba(255,255,255,0.35); color: #fff; }
.role-pill.selected { background: #7c3aed; border-color: #7c3aed; color: #fff; }

.custom-role-wrap { display: none; margin-bottom: 20px; }
.custom-role-wrap.visible { display: block; }
input[name="role"] { display: none; }

/* ── Step 4: Company ── */
.search-wrap { position: relative; margin-bottom: 12px; }

.search-input {
    width: 100%; background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1); border-radius: 14px;
    padding: 14px 18px 14px 42px; font-size: 15px;
    color: #fff; font-family: 'Inter', sans-serif;
    outline: none; transition: border-color 0.2s;
}

.search-input::placeholder { color: #444; }
.search-input:focus { border-color: rgba(255,255,255,0.35); }

.search-icon {
    position: absolute; left: 14px; top: 50%;
    transform: translateY(-50%); color: #555; font-size: 16px; pointer-events: none;
}

.companies-list {
    display: flex; flex-direction: column; gap: 6px;
    max-height: 280px; overflow-y: auto; margin-bottom: 16px;
}

.companies-list::-webkit-scrollbar { width: 4px; }
.companies-list::-webkit-scrollbar-track { background: transparent; }
.companies-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 99px; }

.company-row {
    display: flex; align-items: center; gap: 14px;
    padding: 13px 16px; border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.07);
    cursor: pointer; transition: all 0.15s; background: transparent;
    width: 100%; text-align: left; font-family: 'Inter', sans-serif;
    color: #ccc; font-size: 15px;
}

.company-row:hover { border-color: rgba(255,255,255,0.2); background: rgba(255,255,255,0.03); color: #fff; }
.company-row.selected { border-color: #7c3aed; background: rgba(124,58,237,0.12); color: #fff; }

.company-letter {
    width: 36px; height: 36px; border-radius: 10px;
    background: rgba(255,255,255,0.06);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 14px; color: #aaa; flex-shrink: 0;
}

.create-row {
    display: flex; align-items: center; gap: 14px;
    padding: 13px 16px; border-radius: 14px;
    border: 1px dashed rgba(124,58,237,0.4);
    cursor: pointer; transition: all 0.15s; color: #9d6cf5;
    font-size: 15px; font-family: 'Inter', sans-serif;
    background: transparent; width: 100%; text-align: left;
}

.create-row:hover { border-color: #7c3aed; background: rgba(124,58,237,0.08); color: #b08af5; }

.create-plus {
    width: 36px; height: 36px; border-radius: 10px;
    background: rgba(124,58,237,0.2);
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; color: #9d6cf5; flex-shrink: 0;
}

.empty-msg { text-align: center; color: #555; font-size: 14px; padding: 20px 0 8px; }

.selected-company-box {
    display: none; align-items: center; gap: 12px;
    padding: 12px 16px; border-radius: 14px;
    border: 1px solid #7c3aed; background: rgba(124,58,237,0.1); margin-bottom: 16px;
}

.selected-company-box.visible { display: flex; }
.selected-name { font-size: 15px; color: #fff; font-weight: 500; flex: 1; }

.clear-btn {
    background: none; border: none; color: #555;
    font-size: 18px; cursor: pointer; padding: 0;
    line-height: 1; transition: color 0.15s;
}

.clear-btn:hover { color: #aaa; }

/* ── Email verification ── */
.code-input {
    font-size: 32px;
    letter-spacing: 12px;
    text-align: center;
    font-family: 'Dela Gothic One', sans-serif;
}

.field-group-sm { margin-bottom: 8px; }
.btn-mt { margin-top: 20px; }

.verify-footer {
    margin-top: 24px;
    text-align: center;
}

.verify-footer-links { margin-top: 16px; }

.resend-btn {
    background: none;
    border: none;
    color: #1673ff;
    font-size: 14px;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
}

.resend-timer {
    font-size: 13px;
    color: #555;
    display: none;
}

.change-email-link {
    font-size: 13px;
    color: #555;
    text-decoration: none;
}

.text-white { color: #fff; }

/* ── Step 2 extras ── */
.field-hint {
    font-size: 12px;
    color: rgba(255,255,255,0.4);
    margin-top: 6px;
    text-align: center;
    margin-bottom: 20px;
}

.required-mark { color: #e74c3c; }

/* ── Button-link (a styled as btn-primary) ── */
a.btn-primary {
    display: block;
    text-align: center;
    text-decoration: none;
}

/* ── Done page ── */
.done-wrap { text-align: center; }

.done-avatar {
    width: 88px; height: 88px; border-radius: 50%;
    background: linear-gradient(135deg, #7c3aed, #1673ff);
    display: flex; align-items: center; justify-content: center;
    font-family: 'Dela Gothic One', sans-serif; font-size: 32px; color: #fff;
    margin: 0 auto 28px; overflow: hidden; border: 2px solid rgba(255,255,255,0.1);
}

.done-avatar img { width: 100%; height: 100%; object-fit: cover; }
.done-wrap h1 { margin-bottom: 10px; }
.done-wrap .subtitle { margin-bottom: 32px; }

.info-pills { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 32px; }

.info-pill {
    padding: 7px 16px; border-radius: 99px;
    border: 1px solid rgba(255,255,255,0.1); color: #aaa; font-size: 13px;
}

.info-pill.highlight {
    background: rgba(124,58,237,0.15);
    border-color: rgba(124,58,237,0.4);
    color: #b08af5;
}

/* ── Discover step ── */
.discover-section { margin-bottom: 28px; }

.discover-section-title {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.35);
    margin-bottom: 12px;
}

.discover-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.discover-chip {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    border-radius: 99px;
    border: 1px solid rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.6);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
}

.discover-chip:hover { border-color: rgba(255,255,255,0.3); color: #fff; }

.discover-chip:has(.discover-checkbox:checked) {
    background: rgba(22,115,255,0.15);
    border-color: rgba(22,115,255,0.5);
    color: #4d9eff;
}

.discover-checkbox { display: none; }

.discover-topic-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.discover-authors {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.discover-author {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.08);
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
}

.discover-author:hover { border-color: rgba(255,255,255,0.2); background: rgba(255,255,255,0.03); }

.discover-author:has(.discover-checkbox:checked) {
    background: rgba(22,115,255,0.08);
    border-color: rgba(22,115,255,0.35);
}

.discover-author-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #7c3aed, #1673ff);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    overflow: hidden;
}

.discover-author-avatar img { width: 100%; height: 100%; object-fit: cover; }

.discover-author-info { flex: 1; min-width: 0; }

.discover-author-name {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.discover-author-meta {
    font-size: 12px;
    color: rgba(255,255,255,0.4);
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.discover-author-check {
    font-size: 13px;
    color: #4d9eff;
    opacity: 0;
    transition: opacity 0.15s;
    flex-shrink: 0;
}

.discover-author:has(.discover-checkbox:checked) .discover-author-check { opacity: 1; }

.discover-skip {
    display: block;
    text-align: center;
    margin-top: 16px;
    color: rgba(255,255,255,0.3);
    font-size: 13px;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.15s;
}

.discover-skip:hover { color: rgba(255,255,255,0.6); }

/* ── Consent checkboxes ── */
.consent-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.consent-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
}

.consent-checkbox {
    width: 18px;
    height: 18px;
    min-width: 18px;
    margin-top: 1px;
    accent-color: #7c3aed;
    cursor: pointer;
}

.consent-text {
    font-size: 13px;
    color: rgba(255,255,255,0.5);
    line-height: 1.5;
}

.consent-link {
    color: rgba(255,255,255,0.75);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.consent-link:hover { color: #fff; }
