/* Auth — ВХОД / РЕГИСТРАЦИЯ (макет) */

.page-auth {
    background: var(--bg);
}

.page-auth main.auth-hero {
    position: relative;
    z-index: 0;
}

.page-auth .footer {
    margin-top: 0;
}

.auth-hero {
    position: relative;
    margin-top: var(--nav-h);
    min-height: 560px;
    padding: 56px 20px 72px;
    background: var(--hero-image) center center / cover no-repeat;
    background-color: #050a14;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(5, 10, 20, 0.45) 0%,
        rgba(5, 10, 20, 0.65) 50%,
        rgba(5, 10, 20, 0.82) 100%
    );
    pointer-events: none;
}

.auth-hero-stage {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

/*
 * Админ картата (червено-синята рамка около .auth-panel):
 * вход = 600px; админ = +30% → min 780px, до 96vw на широк екран.
 */
.page-auth--wide .auth-hero,
.auth-hero-stage--wide {
    box-sizing: border-box;
}

.page-auth--wide .auth-hero {
    padding-left: 2vw;
    padding-right: 2vw;
}

.page-auth--wide .auth-hero-stage,
.auth-hero-stage.auth-hero-stage--wide {
    width: 96vw !important;
    max-width: 96vw !important;
    min-width: calc(600px * 1.3) !important;
}

.page-auth--wide .auth-panel,
.auth-panel.auth-panel--wide {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box;
}

.page-auth .auth-hero {
    padding-left: 12px;
    padding-right: 12px;
}

.auth-flash {
    margin: 0 0 16px;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
}

.auth-flash--ok {
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.45);
    color: #bbf7d0;
}

.auth-flash--err {
    background: rgba(227, 24, 24, 0.15);
    border: 1px solid rgba(227, 24, 24, 0.5);
    color: #fecaca;
}

.auth-panel {
    position: relative;
    isolation: isolate;
    width: 100%;
    padding: 36px 32px 32px;
    border-radius: 14px;
    background: rgba(8, 14, 28, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.05),
        -5px 0 30px rgba(227, 24, 24, 0.38),
        5px -5px 30px rgba(26, 140, 255, 0.32),
        0 22px 48px rgba(0, 0, 0, 0.48);
}

.auth-panel::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 16px;
    z-index: -1;
    background: linear-gradient(
        135deg,
        rgba(227, 24, 24, 0.92) 0%,
        rgba(227, 24, 24, 0.2) 30%,
        rgba(26, 140, 255, 0.15) 68%,
        rgba(26, 140, 255, 0.88) 100%
    );
    opacity: 0.92;
}

.auth-panel--wide {
    max-width: none;
    width: 100%;
}

/* Админ: по-спокоен външен панел (без тежък червено-син градиент върху цялото съдържание) */
.page-auth--wide .auth-hero-stage > .auth-panel.auth-panel--wide {
    background: rgba(10, 16, 32, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.04),
        0 20px 48px rgba(0, 0, 0, 0.42);
}

.page-auth--wide .auth-hero-stage > .auth-panel.auth-panel--wide::before {
    background: linear-gradient(
        135deg,
        rgba(227, 24, 24, 0.28) 0%,
        rgba(255, 255, 255, 0.02) 42%,
        rgba(26, 140, 255, 0.22) 100%
    );
    opacity: 0.65;
}

.page-auth--wide .auth-head {
    text-align: left;
}

.page-auth--wide .auth-head h1 {
    font-size: 1.65rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-transform: none;
}

.page-auth--wide .auth-head p {
    margin-left: 0;
    margin-right: 0;
}

/* Вложени секции в админ панела — без втори градиент */
.auth-subpanel,
.auth-panel--wide .auth-panel,
.auth-panel--wide > section.auth-panel {
    margin-top: 20px;
    padding: 22px 24px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: none;
}

.auth-subpanel::before,
.auth-panel--wide .auth-panel::before,
.auth-panel--wide > section.auth-panel::before {
    display: none;
}

.auth-subpanel:first-child,
.auth-panel--wide > .auth-head + .auth-subpanel,
.auth-panel--wide > .auth-head + section.auth-panel {
    margin-top: 0;
}

.page-auth--wide .auth-foot {
    margin-top: 28px;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    text-align: left;
}

.auth-head {
    margin-bottom: 24px;
    text-align: center;
}

.auth-head h1 {
    margin: 0 0 10px;
    font-size: 32px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #fff;
    line-height: 1.05;
}

.auth-head p {
    margin: 0 auto;
    max-width: 480px;
    font-size: 14px;
    line-height: 1.55;
    color: rgba(240, 244, 250, 0.7);
}

.page-auth--wide .auth-head p {
    max-width: none;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.auth-avatar-field {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 20px;
    padding: 16px 0 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-avatar-preview {
    flex: 0 0 auto;
}

.auth-avatar-preview img {
    display: block;
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.18);
    background: rgba(0, 0, 0, 0.35);
}

.auth-avatar-controls {
    flex: 1 1 200px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.auth-avatar-upload {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 168px;
    height: 44px;
    padding: 0 22px;
    border-radius: 10px;
    border: 1px solid rgba(77, 168, 255, 0.65);
    background: linear-gradient(180deg, rgba(18, 42, 78, 0.95) 0%, rgba(8, 20, 42, 0.98) 100%);
    box-shadow:
        inset 0 1px 0 rgba(140, 200, 255, 0.18),
        inset 0 0 20px rgba(41, 151, 255, 0.22),
        0 4px 16px rgba(0, 0, 0, 0.28);
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.auth-avatar-upload:hover {
    border-color: #8ec8ff;
    box-shadow:
        inset 0 1px 0 rgba(160, 215, 255, 0.28),
        inset 0 0 24px rgba(41, 151, 255, 0.35),
        0 6px 20px rgba(41, 151, 255, 0.18);
    transform: translateY(-1px);
}

.auth-avatar-upload input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.auth-avatar-upload__label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    pointer-events: none;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #f0f4fa;
    line-height: 1;
    text-align: center;
}

.auth-hint--avatar {
    margin: 0;
    font-size: 12px;
    line-height: 1.5;
    color: rgba(210, 220, 235, 0.78);
}

.auth-avatar-remove {
    margin: 0;
}

.auth-field,
section.auth-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.auth-field label {
    font-size: 13px;
    font-weight: 600;
    color: rgba(240, 244, 250, 0.95);
}

.auth-input-wrap {
    position: relative;
    width: 100%;
}

.auth-input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    color: rgba(240, 244, 250, 0.42);
    pointer-events: none;
}

.auth-input-icon .icon,
.auth-input-icon svg {
    width: 18px;
    height: 18px;
    display: block;
}

.auth-input-wrap input,
.auth-field select {
    display: block;
    width: 100%;
    height: 48px;
    padding: 0 14px 0 44px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(0, 0, 0, 0.4);
    color: #fff;
    font-size: 14px;
    line-height: 48px;
}

.auth-field select {
    padding-left: 14px;
    padding-right: 36px;
    line-height: normal;
    appearance: none;
    color-scheme: dark;
    background-color: rgba(0, 0, 0, 0.4);
    background-image: linear-gradient(45deg, transparent 50%, rgba(255, 255, 255, 0.5) 50%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.5) 50%, transparent 50%);
    background-position: calc(100% - 18px) 50%, calc(100% - 12px) 50%;
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
}

.auth-field select option {
    background-color: #0c1528;
    color: #f0f4fa;
}

.auth-field select option:checked {
    background-color: #1a4a7a;
    color: #fff;
}

.auth-profile-required {
    margin: 12px auto 0;
    max-width: 480px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.45;
    color: #fde68a;
    background: rgba(234, 179, 8, 0.12);
    border: 1px solid rgba(234, 179, 8, 0.35);
}

.auth-field .auth-hint--phone {
    margin: 0;
    color: rgba(240, 244, 250, 0.55);
    font-size: 12px;
    font-weight: 400;
}

.auth-input-wrap input::placeholder {
    color: rgba(240, 244, 250, 0.35);
}

.auth-input-wrap input:focus,
.auth-field select:focus {
    outline: none;
    border-color: rgba(26, 140, 255, 0.7);
    box-shadow: 0 0 0 3px rgba(26, 140, 255, 0.12);
}

.auth-input-wrap--toggle input {
    padding-right: 48px;
}

.auth-input-toggle {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: rgba(240, 244, 250, 0.55);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
}

.auth-input-toggle:hover {
    color: rgba(240, 244, 250, 0.9);
}

.auth-input-toggle .icon {
    width: 20px;
    height: 20px;
}

.auth-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.auth-row-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: -2px;
}

.auth-check {
    display: inline-flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13px;
    line-height: 1.45;
    color: rgba(240, 244, 250, 0.78);
    cursor: pointer;
}

.auth-check input {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    flex-shrink: 0;
    accent-color: var(--blue);
}

.auth-check a {
    color: var(--blue);
    text-decoration: none;
}

.auth-check a:hover {
    text-decoration: underline;
}

.auth-link {
    font-size: 13px;
    font-weight: 500;
    color: var(--blue);
    text-decoration: none;
    white-space: nowrap;
}

.auth-link:hover {
    text-decoration: underline;
}

.auth-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 4px 0 0;
    font-size: 12px;
    color: var(--blue);
}

.auth-hint .icon {
    width: 14px;
    height: 14px;
}

.auth-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 52px;
    margin-top: 4px;
    border: none;
    border-radius: 12px;
    font-family: var(--font-primary);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #fff;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.auth-submit--login {
    background: var(--red);
    box-shadow: 0 8px 28px var(--red-glow);
}

.auth-submit--login:hover {
    transform: translateY(-1px);
}

.auth-submit--register {
    background: linear-gradient(180deg, #2e9aff 0%, #1568c4 100%);
    box-shadow: 0 8px 28px var(--blue-glow);
}

.auth-submit--register:hover {
    transform: translateY(-1px);
}

.auth-social {
    margin-top: 4px;
}

.auth-social-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 20px 0 16px;
    font-size: 13px;
    color: rgba(240, 244, 250, 0.5);
}

.auth-social-divider::before,
.auth-social-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.14);
}

.auth-social-btns {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.auth-social-btn {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: not-allowed;
    opacity: 1;
    overflow: visible;
    flex-shrink: 0;
}

.page-auth .auth-social-btn svg,
.page-auth .auth-social-btn .icon {
    width: 20px !important;
    height: 20px !important;
    max-width: 20px;
    max-height: 20px;
    display: block;
    flex-shrink: 0;
}

.auth-social-btn--google {
    background: #fff;
    border-color: rgba(255, 255, 255, 0.35);
}

.auth-social-btn--apple {
    background: #fff;
    border-color: rgba(255, 255, 255, 0.35);
    color: #111;
}

.auth-social-btn--google svg,
.auth-social-btn--apple svg {
    width: 22px !important;
    height: 22px !important;
    max-width: 22px;
    max-height: 22px;
}

.auth-foot {
    margin-top: 20px;
    text-align: center;
    font-size: 14px;
    color: rgba(240, 244, 250, 0.62);
}

.auth-foot a {
    color: var(--blue);
    font-weight: 600;
    text-decoration: none;
}

.auth-foot a:hover {
    text-decoration: underline;
}

.auth-links-inline {
    margin-top: 12px;
    text-align: center;
    font-size: 13px;
}

.auth-links-inline a {
    color: var(--blue);
    text-decoration: none;
}

.auth-links-inline a.btn-red {
    color: #fff;
}

.auth-links-inline a.btn-red:hover {
    color: #fff;
}

.auth-profile-section {
    margin-top: 8px;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-profile-section h2 {
    margin: 0 0 12px;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.auth-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.auth-table th,
.auth-table td {
    padding: 10px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    text-align: left;
}

.auth-table tbody tr {
    background: rgba(12, 22, 44, 0.85);
}

.auth-panel select,
.auth-panel textarea,
.signals-admin-filter select,
.signal-admin-form select,
.institutions-form select {
    color-scheme: dark;
    background-color: rgba(10, 18, 36, 0.98);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.22);
}

.auth-panel select option,
.signals-admin-filter select option {
    background-color: #0c1528;
    color: #fff;
}

.auth-link-btn {
    background: none;
    border: none;
    padding: 0;
    color: #6eb5ff;
    font-size: inherit;
    cursor: pointer;
    text-decoration: underline;
}

.auth-link-btn:hover {
    color: #fff;
}

.auth-inline-form {
    margin: 0;
}

.users-table-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    min-width: 200px;
}

.users-table-actions__form {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.users-action-reason {
    width: 120px;
    max-width: 140px;
    padding: 6px 10px;
    border: 1px solid #2a3d5c;
    border-radius: 8px;
    background: #0a1220;
    color: #e8edf5;
    font-size: 12px;
}

.users-action-mail {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    color: #d4ebff;
    background: linear-gradient(180deg, rgba(46, 106, 158, 0.95) 0%, rgba(26, 74, 122, 0.95) 100%);
    border: 1px solid rgba(126, 200, 255, 0.45);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08) inset;
    white-space: nowrap;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.users-action-mail:hover {
    color: #fff;
    border-color: rgba(160, 220, 255, 0.75);
    background: linear-gradient(180deg, rgba(58, 130, 190, 1) 0%, rgba(36, 92, 150, 1) 100%);
}

.auth-btn-small {
    padding: 6px 12px;
    border: none;
    border-radius: 8px;
    background: #2e6a9e;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.auth-btn-small--danger {
    background: #a01830;
}

@media (max-width: 768px) {
    .page-auth--wide .auth-hero {
        padding-left: 12px;
        padding-right: 12px;
        overflow-x: hidden;
    }

    .page-auth--wide .auth-hero-stage,
    .auth-hero-stage.auth-hero-stage--wide {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }

    .page-auth--wide .auth-panel,
    .auth-panel.auth-panel--wide {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .page-auth--wide .auth-table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .page-auth--wide .auth-table th,
    .page-auth--wide .auth-table td {
        white-space: nowrap;
    }

    .page-auth--wide .signals-admin-nav {
        gap: 6px 8px;
    }

    .page-auth--wide .signals-admin-nav__link {
        padding: 6px 10px;
        font-size: 11px;
    }

    .page-auth--wide .signals-admin-nav--sub .signals-admin-nav__link {
        padding: 5px 8px;
        font-size: 11px;
    }
}

@media (max-width: 640px) {
    .auth-hero {
        padding: 32px 16px 48px;
        min-height: auto;
    }

    .auth-panel {
        padding: 28px 20px 24px;
    }

    .auth-head h1 {
        font-size: 26px;
    }

    .auth-row-2 {
        grid-template-columns: 1fr;
    }

    .auth-table th,
    .auth-table td {
        padding: 8px 6px;
        font-size: 12px;
    }

    .auth-btn-small {
        padding: 5px 8px;
        font-size: 11px;
    }
}

/* Фаза 11 — членство */
.membership-fee-highlight {
    margin: 0 0 1rem;
    padding: 0.75rem 1rem;
    background: rgba(0, 180, 120, 0.08);
    border-left: 3px solid #00a86b;
    border-radius: 4px;
}

.membership-profile-box,
.membership-status-box {
    margin-top: 1.5rem;
    padding: 1rem 1.25rem;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.6);
}

.membership-profile-box__ok,
.membership-status-box__ok {
    color: #0d7a4d;
    font-weight: 600;
}

.membership-profile-box__warn,
.membership-status-box__warn {
    color: #b45309;
    font-weight: 600;
}

.membership-profile-box a,
.membership-status-box a {
    font-weight: 600;
}
