:root {
    --bg: #020707;
    --panel: rgba(9, 24, 20, 0.86);
    --panel-2: rgba(12, 31, 25, 0.72);
    --border: rgba(42, 255, 122, 0.18);
    --border-soft: rgba(255, 255, 255, 0.08);
    --text: #f5fff8;
    --muted: #b8c9c1;
    --muted-2: #7f968c;
    --primary: #17e86f;
    --primary-dark: #0fbd5a;
    --danger: #ff6b6b;
    --shadow: 0 28px 90px rgba(0, 0, 0, 0.48);
    --radius: 8px;
}

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

html {
    min-width: 320px;
}

body {
    min-height: 100vh;
    font-family: Inter, Arial, Helvetica, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 48% 8%, rgba(21, 226, 111, 0.12), transparent 28rem),
        linear-gradient(180deg, #020807 0%, #03110d 45%, #010504 100%);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(90deg, rgba(1, 8, 7, 0.98), rgba(2, 13, 9, 0.62), rgba(1, 7, 6, 0.94)),
        radial-gradient(circle at 28% 20%, rgba(255, 255, 210, 0.13), transparent 0.7rem),
        radial-gradient(circle at 53% 18%, rgba(255, 255, 210, 0.11), transparent 0.55rem),
        radial-gradient(circle at 74% 25%, rgba(31, 255, 131, 0.11), transparent 16rem),
        repeating-linear-gradient(8deg, rgba(255,255,255,0.025) 0 1px, transparent 1px 24px);
    pointer-events: none;
}

a {
    color: inherit;
}

.register-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(520px, 1.1fr);
}

.register-brand,
.register-panel {
    display: flex;
    align-items: center;
    justify-content: center;
}

.register-brand {
    padding: 72px clamp(32px, 5vw, 84px);
}

.brand-content {
    width: min(100%, 540px);
}

.brand-badge {
    width: fit-content;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
    padding: 10px 17px;
    border: 1px solid rgba(23, 232, 111, 0.2);
    border-radius: 999px;
    color: var(--primary);
    background: rgba(23, 232, 111, 0.12);
    font-size: 0.9rem;
    font-weight: 900;
}

.brand-badge::before {
    content: "\26BD";
}

.brand-content h1 {
    margin-bottom: 20px;
    font-size: clamp(3rem, 5.5vw, 5.2rem);
    line-height: 1.04;
    font-weight: 900;
    letter-spacing: 0;
}

.brand-content h1 span {
    color: var(--primary);
}

.brand-content p {
    max-width: 530px;
    margin-bottom: 0;
    color: #e2eee8;
    font-size: 1.08rem;
    font-weight: 650;
    line-height: 1.68;
}

.register-panel {
    min-height: 100vh;
    padding: 34px clamp(18px, 4vw, 70px);
}

.register-card {
    width: min(100%, 560px);
    padding: 30px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: linear-gradient(180deg, var(--panel), rgba(4, 13, 11, 0.84));
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.register-header {
    margin-bottom: 24px;
    text-align: center;
}

.logo-container {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}

.logo-img {
    width: 150px;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 0 18px rgba(23, 232, 111, 0.2));
}

.register-header h2 {
    margin-bottom: 8px;
    font-size: 2rem;
    line-height: 1.1;
}

.register-header p,
.register-footer,
.password-hint,
.google-profile-row p,
.success-modal p {
    color: var(--muted);
}

.alert-error,
.alert-success {
    margin-bottom: 18px;
    padding: 14px 16px;
    border-radius: var(--radius);
    font-size: 0.9rem;
    line-height: 1.45;
}

.alert-error {
    border: 1px solid rgba(255, 107, 107, 0.3);
    color: #ff9a9a;
    background: rgba(255, 107, 107, 0.12);
}

.alert-success {
    border: 1px solid rgba(23, 232, 111, 0.26);
    color: #82ffae;
    background: rgba(23, 232, 111, 0.12);
}

.register-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 0.56fr;
    gap: 16px;
}

.form-group {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.form-group.full {
    grid-column: 1 / -1;
}

.form-group label {
    margin-bottom: 8px;
    font-size: 0.9rem;
    font-weight: 800;
}

.form-group input,
.form-group select,
.team-search {
    width: 100%;
    height: 54px;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    outline: none;
    color: var(--text);
    background: rgba(255, 255, 255, 0.045);
    padding: 0 16px;
    font: inherit;
    font-size: 0.96rem;
    transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.form-group input::placeholder,
.team-search::placeholder {
    color: rgba(184, 201, 193, 0.62);
}

.form-group input:focus,
.form-group select:focus,
.team-search:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 0 4px rgba(23, 232, 111, 0.12);
}

.field-error,
.password-hint,
.username-hint,
.google-auth-feedback {
    display: block;
    min-height: 18px;
    margin-top: 7px;
    font-size: 0.78rem;
    line-height: 1.35;
}

.field-error,
.feedback-error,
.google-auth-feedback.feedback-error {
    color: #ff9a9a;
}

.password-hint,
.username-hint {
    color: var(--muted-2);
}

.input-error {
    border-color: var(--danger) !important;
    box-shadow: 0 0 0 4px rgba(255, 107, 107, 0.11) !important;
}

.team-selector-trigger {
    width: 100%;
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    color: var(--text);
    background: rgba(255, 255, 255, 0.045);
    cursor: pointer;
    transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.team-selector-trigger:hover,
.team-selector-trigger:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 0 4px rgba(23, 232, 111, 0.1);
}

.team-selector-left {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.selected-team-logo,
.selected-team-placeholder {
    width: 30px;
    height: 30px;
    flex: 0 0 auto;
}

.selected-team-logo {
    object-fit: contain;
}

.selected-team-placeholder {
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: rgba(23, 232, 111, 0.1);
}

.selected-team-text {
    min-width: 0;
    overflow: hidden;
    color: var(--text);
    font-weight: 750;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.team-selector-arrow {
    color: var(--primary);
    font-weight: 900;
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 14px;
    margin-top: 10px;
}

.team-option {
    display: block;
    cursor: pointer;
}

.team-option input {
    display: none;
}

.team-card,
.team-mini-card {
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.team-card {
    min-height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 10px;
    text-align: center;
}

.team-card:hover,
.team-mini-card:hover {
    transform: translateY(-2px);
    border-color: rgba(23, 232, 111, 0.36);
    background: rgba(255, 255, 255, 0.06);
}

.team-logo {
    width: 52px;
    height: 52px;
    object-fit: contain;
}

.team-name,
.team-mini-name {
    color: var(--text);
    font-weight: 750;
    line-height: 1.25;
}

.team-name {
    font-size: 0.82rem;
}

.team-option input:checked + .team-card,
.team-mini-card.active {
    border-color: var(--primary);
    background: rgba(23, 232, 111, 0.1);
    box-shadow: 0 0 0 4px rgba(23, 232, 111, 0.08);
}

.team-option input:checked + .team-card .team-name,
.team-mini-card.active .team-mini-name {
    color: var(--primary);
}

.team-selector-modal,
.google-complete-overlay,
.success-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(8px);
}

.team-selector-modal.active,
.google-complete-overlay.active,
.success-modal-overlay.active {
    display: flex;
}

.team-selector-box,
.google-complete-box,
.success-modal {
    width: min(100%, 560px);
    border: 1px solid var(--border);
    border-radius: 16px;
    background: linear-gradient(180deg, var(--panel), rgba(4, 13, 11, 0.95));
    box-shadow: var(--shadow);
}

.team-selector-box {
    padding: 20px;
}

.team-selector-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.team-selector-header strong {
    font-size: 1.15rem;
}

.team-selector-close,
.google-complete-close {
    width: 36px;
    height: 36px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
}

.team-search-wrap {
    margin-bottom: 14px;
}

.team-list-scroll {
    max-height: 320px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    gap: 10px;
    padding-right: 4px;
}

.team-mini-card {
    min-height: 98px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 8px;
    cursor: pointer;
}

.team-mini-logo {
    width: 44px;
    height: 44px;
    object-fit: contain;
}

.team-mini-name {
    font-size: 0.72rem;
    text-align: center;
}

.team-list-scroll::-webkit-scrollbar {
    width: 8px;
}

.team-list-scroll::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.04);
    border-radius: 999px;
}

.team-list-scroll::-webkit-scrollbar-thumb {
    background: rgba(23, 232, 111, 0.45);
    border-radius: 999px;
}

.policy-consent {
    display: grid;
    grid-template-columns: 22px 1fr;
    gap: 12px;
    align-items: flex-start;
    padding: 14px;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.04);
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.5;
    cursor: pointer;
}

.policy-consent input {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: var(--primary);
    cursor: pointer;
}

.policy-consent a {
    color: var(--primary);
    font-weight: 850;
    text-decoration: none;
}

.policy-consent a:hover {
    color: #62ff9f;
}

.policy-consent.has-error {
    border-color: rgba(255, 107, 107, 0.42);
    background: rgba(255, 107, 107, 0.08);
}

.policy-error {
    margin-top: -10px;
}

.btn-register {
    width: 100%;
    height: 56px;
    border: 0;
    border-radius: var(--radius);
    color: #021008;
    background: linear-gradient(135deg, #1fff82, #13d966);
    box-shadow: 0 18px 44px rgba(20, 232, 111, 0.22);
    font: inherit;
    font-size: 1rem;
    font-weight: 900;
    cursor: pointer;
    transition: transform 180ms ease, box-shadow 180ms ease;
}

.btn-register:hover {
    transform: translateY(-2px);
    box-shadow: 0 22px 54px rgba(20, 232, 111, 0.28);
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 22px 0 16px;
    color: var(--muted-2);
    font-size: 0.83rem;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border-soft);
}

.google-auth-wrap {
    display: flex;
    justify-content: center;
    min-height: 54px;
}

.google-native-hidden {
    display: none !important;
}

.google-fallback-hidden {
    display: inline-flex !important;
}

.google-fallback-btn {
    width: 100%;
    height: 54px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: var(--radius);
    background: #fff;
    color: #111;
    font: inherit;
    font-size: 0.98rem;
    font-weight: 850;
    cursor: pointer;
    transition: transform 180ms ease, background 180ms ease;
}

.google-fallback-btn:hover {
    background: #eef2ef;
    transform: translateY(-1px);
}

.google-fallback-btn span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.google-auth-feedback {
    text-align: center;
    color: #82ffae;
}

.google-auth-feedback.feedback-success,
.feedback-success {
    color: #82ffae;
}

.register-footer {
    margin-top: 22px;
    color: var(--muted);
    text-align: center;
    font-size: 0.92rem;
}

.login-link {
    display: inline-flex;
    margin-top: 8px;
    color: var(--primary);
    font-weight: 800;
    text-decoration: none;
}

.login-link:hover {
    color: #62ff9f;
}

.success-modal-overlay {
    z-index: 1200;
}

.success-modal {
    max-width: 420px;
    padding: 30px 24px;
    text-align: center;
    animation: modalPop 0.25s ease;
}

.success-icon {
    width: 66px;
    height: 66px;
    display: grid;
    place-items: center;
    margin: 0 auto 16px;
    border: 1px solid rgba(23, 232, 111, 0.28);
    border-radius: 999px;
    color: var(--primary);
    background: rgba(23, 232, 111, 0.12);
    font-size: 2rem;
    font-weight: 900;
}

.success-modal h3 {
    margin-bottom: 10px;
    font-size: 1.5rem;
}

.success-modal p {
    font-size: 0.92rem;
    line-height: 1.55;
}

.google-complete-overlay {
    z-index: 1300;
}

.google-complete-box {
    position: relative;
    max-height: 92vh;
    overflow-y: auto;
    padding: 26px;
}

.google-complete-close {
    position: absolute;
    top: 12px;
    right: 14px;
}

.google-profile-row {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
    padding-right: 38px;
}

.google-profile-picture {
    width: 52px;
    height: 52px;
    border: 1px solid rgba(23, 232, 111, 0.35);
    border-radius: 999px;
    object-fit: cover;
}

.google-profile-row h3 {
    margin-bottom: 4px;
    font-size: 1.45rem;
}

.google-profile-row p {
    font-size: 0.83rem;
    overflow-wrap: anywhere;
}

.google-complete-form {
    display: grid;
    gap: 16px;
}

.google-team-list {
    max-height: 250px;
}

@keyframes modalPop {
    from {
        opacity: 0;
        transform: scale(0.94);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@media (max-width: 1080px) {
    .register-page {
        grid-template-columns: 1fr;
    }

    .register-panel {
        order: 1;
        min-height: auto;
        padding: 28px 18px 18px;
    }

    .register-brand {
        order: 2;
        padding: 8px 18px 36px;
    }

    .brand-content {
        text-align: center;
    }

    .brand-badge,
    .brand-content p {
        margin-left: auto;
        margin-right: auto;
    }

    .brand-content h1 {
        font-size: clamp(2.25rem, 10vw, 3.4rem);
    }
}

@media (max-width: 640px) {
    body {
        background: linear-gradient(180deg, #020807 0%, #03110d 100%);
    }

    .register-panel {
        padding: 16px 12px 14px;
    }

    .register-card {
        padding: 22px 16px;
        border-radius: 14px;
    }

    .logo-img {
        width: 132px;
    }

    .register-header {
        margin-bottom: 20px;
    }

    .register-header h2 {
        font-size: 1.65rem;
    }

    .form-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .form-group input,
    .form-group select,
    .team-search,
    .btn-register,
    .google-fallback-btn {
        height: 52px;
    }

    .team-selector-trigger {
        min-height: 54px;
    }

    .policy-consent {
        grid-template-columns: 20px 1fr;
        padding: 13px;
        font-size: 0.84rem;
    }

    .brand-content p {
        font-size: 0.98rem;
    }

    .team-selector-box,
    .google-complete-box,
    .success-modal {
        border-radius: 14px;
        padding: 20px 16px;
    }

    .team-list-scroll {
        max-height: 62vh;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .google-profile-row {
        align-items: flex-start;
    }
}
