/*
 * Battlefy Zone — Register
 * Public authentication page.
 * Intentionally uses the same shell pattern as login.html:
 * logo + theme toggle header, no sidebar/hamburger, global footer.
 */

.register-page {
    min-height: 100vh;
    background:
        linear-gradient(
            90deg,
            color-mix(in srgb, var(--bg-primary) 93%, transparent),
            color-mix(in srgb, var(--bg-primary) 80%, transparent)
        ),
        url("../images/battlefy.bg.png") center / cover fixed no-repeat;
    color: var(--text-primary);
}

html[data-theme="dark"] .register-page {
    background:
        linear-gradient(
            90deg,
            color-mix(in srgb, var(--bg-primary) 92%, transparent),
            color-mix(in srgb, var(--bg-primary) 82%, transparent)
        ),
        url("../images/battlefy.bg.png") center / cover fixed no-repeat;
}

.register-public-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Same public auth header proportions/behavior as login.html. */
.public-auth-header {
    position: relative;
    z-index: 1000;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 clamp(1.25rem, 4vw, 4rem);
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.public-auth-header__brand {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    line-height: 0;
}

.public-auth-header__brand img {
    display: block;
    width: 92px;
    height: 92px;
    object-fit: contain;
}

.public-auth-header__actions {
    display: flex;
    align-items: center;
    gap: .65rem;
}

.theme-toggle {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    color: var(--text-primary);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition:
        transform var(--duration-fast) var(--ease-standard),
        border-color var(--duration-fast) var(--ease-standard),
        background-color var(--duration-fast) var(--ease-standard);
}

.theme-toggle:hover {
    transform: translateY(-1px);
    border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
}

.theme-toggle:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
}

.register-content {
    flex: 1;
    display: grid;
    place-items: center;
    padding: clamp(2.5rem, 5vw, 5rem) clamp(1rem, 4vw, 3rem);
}

.register-card {
    width: min(100%, 520px);
    padding: clamp(1.5rem, 4vw, 2.1rem);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.register-card__eyebrow {
    display: block;
    margin-bottom: .55rem;
    color: var(--accent);
    font-size: .68rem;
    line-height: 1.2;
    font-weight: var(--font-weight-bold);
    letter-spacing: .14em;
    text-transform: uppercase;
}

.register-card h1 {
    margin: 0;
    font-size: clamp(1.9rem, 4vw, 2.45rem);
    line-height: 1.08;
    letter-spacing: -.025em;
}

.register-card__intro {
    margin: .75rem 0 1.25rem;
    color: var(--text-secondary);
    line-height: var(--line-height-relaxed);
}

.register-form {
    display: grid;
    gap: .9rem;
}

.register-field {
    display: grid;
    gap: .42rem;
}

.register-field input {
    width: 100%;
    min-height: 50px;
    padding: .78rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    outline: none;
    background: var(--surface);
    color: var(--text-primary);
    font: inherit;
    transition:
        border-color var(--duration-fast) var(--ease-standard),
        box-shadow var(--duration-fast) var(--ease-standard),
        background-color var(--duration-fast) var(--ease-standard);
}

.register-field input::placeholder {
    color: var(--text-tertiary);
}

.register-field input:focus {
    border-color: var(--accent);
    box-shadow: var(--focus-ring);
}

/* Reusable international phone input */
.phone-input {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 50px;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    background: var(--surface);
    transition: border-color var(--duration-fast) var(--ease-standard), box-shadow var(--duration-fast) var(--ease-standard);
}
.phone-input.is-open { z-index: 50; }
.phone-input:focus-within {
    border-color: var(--accent);
    box-shadow: var(--focus-ring);
}
.phone-input.has-error { border-color: #dc4c4c; }
.phone-country-trigger {
    flex: 0 0 auto;
    height: 38px;
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    margin-left: .3rem;
    padding: 0 .65rem;
    border: 0;
    border-right: 1px solid var(--border);
    border-radius: var(--radius-pill) 0 0 var(--radius-pill);
    background: transparent;
    color: var(--text-primary);
    font: inherit;
    font-size: .83rem;
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
}
.phone-country-flag {
    width: 1.65rem;
    height: 1.65rem;
    flex: 0 0 1.65rem;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--border) 70%, transparent);
}
.phone-country-code { letter-spacing: .02em; }
.phone-country-dial { color: var(--text-secondary); }
.phone-country-trigger > svg { width: 15px; height: 15px; color: var(--text-tertiary); transition: transform 160ms ease; }
.phone-input.is-open .phone-country-trigger > svg { transform: rotate(180deg); }
.phone-input > #phoneNational {
    min-width: 0;
    flex: 1;
    min-height: 48px;
    padding: .7rem .95rem;
    border: 0;
    border-radius: 0 var(--radius-pill) var(--radius-pill) 0;
    outline: 0;
    background: transparent;
    color: var(--text-primary);
    font: inherit;
    box-shadow: none;
}
.phone-input > #phoneNational:focus { border: 0; box-shadow: none; }
.phone-input > #phoneNational::placeholder { color: var(--text-tertiary); }
.phone-country-menu {
    position: fixed;
    z-index: 10000;
    width: min(300px, calc(100vw - 1.5rem));
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    transform-origin: top left;
}
.phone-country-menu[hidden] { display: none; }
.phone-country-menu.is-visible { animation: phone-menu-in 150ms ease-out both; }
@keyframes phone-menu-in { from { opacity: 0; transform: translateY(-5px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }
.phone-country-search-wrap {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .1rem .7rem;
    border: 0;
    border-bottom: 1px solid var(--border-strong, var(--border));
    border-radius: 0;
    color: var(--text-tertiary);
}
.phone-country-search-wrap > svg { width: 17px; height: 17px; flex: 0 0 auto; }
.phone-country-search-wrap input {
    width: 100%;
    min-height: 42px;
    padding: .45rem 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text-primary);
    font: inherit;
    box-shadow: none;
}
.phone-country-list { max-height: min(210px, calc(100vh - 90px)); overflow: auto; padding: .15rem 0; }
.phone-country-option {
    width: 100%;
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .35rem .7rem;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--text-primary);
    text-align: left;
    font: inherit;
    font-size: .86rem;
    cursor: pointer;
}
.phone-country-option:hover,
.phone-country-option[aria-selected="true"] { background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
.phone-country-option .fi { width: 1.4rem; height: 1.4rem; flex: 0 0 1.4rem; border-radius: 50%; overflow: hidden; }
.phone-country-option__name { flex: 1; }
.phone-country-option__dial { min-width: 3.4rem; padding: .3rem .45rem; border-radius: var(--radius-pill); background: color-mix(in srgb, var(--text-primary) 6%, var(--surface)); color: var(--text-secondary); font-size: .78rem; font-weight: var(--font-weight-semibold); text-align: center; }
.phone-country-empty { margin: 0; padding: .8rem .65rem; color: var(--text-secondary); font-size: .85rem; }
.phone-error { margin: 0 .25rem; color: #c63737; font-size: .75rem; }
html[data-theme="dark"] .phone-error { color: #ff8c8c; }
@media (max-width: 420px) {
    .phone-country-trigger { gap: .32rem; padding-inline: .5rem; font-size: .78rem; }
    .phone-input > #phoneNational { padding-inline: .7rem; }
    .phone-country-menu { width: min(300px, calc(100vw - 1.5rem)); }
}

.register-password {
    position: relative;
}

.register-password input {
    padding-right: 3.2rem;
}

.register-password__toggle {
    position: absolute;
    top: 50%;
    right: .35rem;
    width: 42px;
    height: 42px;
    transform: translateY(-50%);
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
}

.register-password__toggle:hover {
    background: color-mix(in srgb, var(--accent) 10%, transparent);
    color: var(--text-primary);
}

.register-password__toggle:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

.register-password__toggle svg {
    width: 19px;
    height: 19px;
}

.register-field__hint {
    margin: 0 .25rem;
    color: var(--text-tertiary);
    font-size: .72rem;
}

.phone-availability-note {
    display: flex;
    align-items: center;
    gap: .3rem;
    line-height: 1.25;
}

.phone-availability-note img {
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    border-radius: 50%;
    object-fit: cover;
}

.register-submit {
    width: 100%;
    min-height: 50px;
    margin-top: .25rem;
}

.register-card__login {
    margin: 1rem 0 0;
    text-align: center;
    color: var(--text-secondary);
    font-size: .82rem;
}

.register-card__login a {
    color: var(--accent-hover);
    font-weight: var(--font-weight-bold);
}

.public-auth-footer {
    position: relative;
    z-index: 100;
    border-top: 1px solid var(--border);
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.public-auth-footer__inner {
    min-height: 66px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .75rem clamp(1rem, 4vw, 2.25rem);
    color: var(--text-secondary);
    font-size: .78rem;
}

.public-auth-footer__copyright {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .5rem;
}

.public-auth-footer__copyright a {
    color: var(--text-primary);
    font-weight: var(--font-weight-semibold);
}

.public-auth-footer__links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    white-space: nowrap;
}

.public-auth-footer__links a {
    color: var(--text-secondary);
}

.public-auth-footer__links a:hover,
.public-auth-footer__copyright a:hover {
    color: var(--accent-hover);
}


/* Standalone public-page Community Chat control.
   Authentication pages do not load the application shell. */
.register-whatsapp {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 2000;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    min-height: 46px;
    padding: .65rem 1rem;
    border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--border));
    border-radius: var(--radius-pill);
    background: color-mix(in srgb, var(--surface) 94%, var(--accent) 6%);
    color: var(--text-primary);
    text-decoration: none;
    font-size: .78rem;
    font-weight: var(--font-weight-bold);
    box-shadow: 0 8px 24px color-mix(in srgb, var(--accent) 14%, transparent);
    transition:
        transform var(--duration-fast) var(--ease-standard),
        background var(--duration-fast) var(--ease-standard),
        border-color var(--duration-fast) var(--ease-standard),
        box-shadow var(--duration-fast) var(--ease-standard);
}

.register-whatsapp:hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--accent) 68%, var(--border));
    background: color-mix(in srgb, var(--surface) 88%, var(--accent) 12%);
    box-shadow: 0 10px 28px color-mix(in srgb, var(--accent) 20%, transparent);
}

.register-whatsapp svg {
    width: 20px;
    height: 20px;
    color: var(--accent);
    stroke-width: 1.8;
}

.register-loader {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: none;
    place-items: center;
    background: var(--surface-overlay);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.register-loader.is-active {
    display: grid;
}

.register-loader__spinner {
    width: 48px;
    height: 48px;
    border: 4px solid color-mix(in srgb, var(--accent) 25%, transparent);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: register-spin .8s linear infinite;
}

@keyframes register-spin {
    to { transform: rotate(360deg); }
}

.register-modal {
    position: fixed;
    inset: 0;
    z-index: 10001;
    display: none;
    place-items: center;
    padding: 1rem;
}

.register-modal.is-visible {
    display: grid;
}

.register-modal__backdrop {
    position: absolute;
    inset: 0;
    background: var(--surface-overlay);
    backdrop-filter: blur(7px);
}

.register-modal__dialog {
    position: relative;
    width: min(100%, 420px);
    padding: 1.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    text-align: center;
    animation: register-modal-in 220ms var(--ease-spring);
}

.register-modal__icon {
    width: 54px;
    height: 54px;
    margin: 0 auto 1rem;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: color-mix(in srgb, var(--accent) 14%, transparent);
    color: var(--accent);
}

.register-modal__icon svg {
    width: 28px;
    height: 28px;
}

.register-modal__dialog h2 {
    margin: 0;
    font-size: 1.45rem;
}

.register-modal__dialog p {
    margin: .65rem 0 1.3rem;
    color: var(--text-secondary);
    line-height: var(--line-height-relaxed);
}

.register-modal__dialog .bz-button {
    width: 100%;
}

@keyframes register-modal-in {
    from { opacity: 0; transform: translateY(10px) scale(.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 600px) {
    .public-auth-header {
        min-height: 82px;
        padding: 0 .9rem;
    }

    .public-auth-header__brand img {
        width: 76px;
        height: 76px;
    }

    .theme-toggle {
        width: 42px;
        height: 42px;
    }

    .register-content {
        padding: 2rem .9rem 2.25rem;
    }

    .register-card {
        padding: 1.25rem;
        border-radius: var(--radius-lg);
    }

    .register-card h1 {
        font-size: 1.8rem;
    }


    .register-whatsapp {
        right: .85rem;
        bottom: .85rem;
        min-height: 44px;
        padding: .6rem .85rem;
    }

    .register-whatsapp span {
        display: none;
    }

    .public-auth-footer__inner {
        align-items: flex-start;
        flex-direction: column;
        padding: 1rem;
    }

    .public-auth-footer__links {
        gap: 1.25rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .register-loader__spinner,
    .register-modal__dialog {
        animation: none;
    }
}


/* ============================================================
   REGISTER PAGE — FINAL PUBLIC AUTH LAYOUT
   ============================================================ */

html,
body {
    width: 100%;
    min-height: 100%;
    margin: 0;
}

body.register-page {
    min-height: 100svh;
    height: 100svh;
    overflow: hidden;
}

.register-public-shell {
    height: 100svh;
    min-height: 0;
    overflow: hidden;
}

.public-auth-header {
    flex: 0 0 88px;
    min-height: 88px;
    box-sizing: border-box;
}

.public-auth-header__brand,
.public-auth-header__brand:visited,
.public-auth-header__brand:hover,
.public-auth-header__brand:focus {
    text-decoration: none;
}

.public-auth-header__actions .theme-toggle,
.public-auth-header__actions .theme-toggle:hover,
.public-auth-header__actions .theme-toggle:focus,
.public-auth-header__actions .theme-toggle:active {
    text-decoration: none;
}

.register-content {
    flex: 1 1 auto;
    min-height: 0;
    box-sizing: border-box;
    overflow: hidden;
    padding: clamp(.75rem, 2vh, 1.5rem) clamp(1rem, 4vw, 3rem);
}

.register-card {
    box-sizing: border-box;
    max-height: 100%;
    overflow: hidden;
}

.register-card a,
.register-card a:hover,
.register-card a:focus,
.public-auth-footer a,
.public-auth-footer a:hover,
.public-auth-footer a:focus {
    text-decoration: none;
}

.public-auth-footer {
    flex: 0 0 auto;
}

.register-whatsapp {
    /*
     * Keep the floating button clear of the footer instead of pinning it
     * into the footer's visual area.
     */
    right: 1.25rem;
    bottom: 5.25rem;
    z-index: 2000;
}

@media (max-width: 600px) {
    body.register-page {
        overflow: hidden;
    }

    .register-public-shell {
        height: 100svh;
    }

    .public-auth-header {
        flex-basis: 72px;
        min-height: 72px;
        padding: 0 .85rem;
    }

    .public-auth-header__brand img {
        width: 64px;
        height: 64px;
    }

    .register-content {
        min-height: 0;
        overflow: hidden;
        padding: .6rem .7rem;
        align-items: center;
    }

    .register-card {
        width: min(100%, 520px);
        max-height: 100%;
        padding: .95rem;
        border-radius: var(--radius-lg);
    }

    .register-card__eyebrow {
        margin-bottom: .35rem;
        font-size: .6rem;
    }

    .register-card h1 {
        font-size: clamp(1.45rem, 6vw, 1.8rem);
    }

    .register-card__intro {
        margin: .45rem 0 .85rem;
        line-height: 1.4;
        font-size: .78rem;
    }

    .register-form {
        gap: .62rem;
    }

    .register-field {
        gap: .28rem;
    }

    .register-field input {
        min-height: 42px;
        padding: .58rem .85rem;
        font-size: .78rem;
    }

    .register-password__toggle {
        width: 36px;
        height: 36px;
    }

    .register-field__hint {
        font-size: .62rem;
    }

    .register-submit {
        min-height: 44px;
        margin-top: .05rem;
    }

    .register-card__login {
        margin-top: .7rem;
        font-size: .72rem;
    }

    .public-auth-footer__inner {
        min-height: 54px;
        box-sizing: border-box;
        padding: .6rem .75rem;
        gap: .45rem;
        font-size: .65rem;
    }

    .public-auth-footer__copyright {
        gap: .3rem;
    }

    .public-auth-footer__links {
        gap: 1rem;
    }

    .register-whatsapp {
        right: .7rem;
        bottom: 4.4rem;
        min-height: 40px;
        padding: .5rem .7rem;
    }
}

@media (max-height: 760px) and (min-width: 601px) {
    .public-auth-header {
        flex-basis: 72px;
        min-height: 72px;
    }

    .public-auth-header__brand img {
        width: 68px;
        height: 68px;
    }

    .register-content {
        padding-block: .5rem;
    }

    .register-card {
        padding: 1rem 1.5rem;
    }

    .register-card__intro {
        margin: .45rem 0 .9rem;
    }

    .register-form {
        gap: .6rem;
    }

    .register-field input {
        min-height: 44px;
    }

    .public-auth-footer__inner {
        min-height: 50px;
    }

    .register-whatsapp {
        bottom: 4rem;
    }
}


.register-page a,
.register-page a:visited,
.register-page a:hover,
.register-page a:active,
.register-page button {
    text-decoration: none !important;
}


/* ============================================================
   REGISTER — MINIMAL CORNER CONTROLS
   No structural header: logo + theme switcher float inside
   the page shell and the registration card gets the freed space.
   ============================================================ */

body.register-page {
    min-height: 100svh;
    height: auto;
    overflow-x: hidden;
    overflow-y: auto;
}

.register-public-shell {
    position: relative;
    min-height: 100svh;
    height: auto;
    overflow: visible;
}

/* Header is intentionally not used on register.html anymore. */
.public-auth-header {
    display: none !important;
}

/* Logo sits inside the page, top-left, without reserving header height. */
.register-corner-brand {
    position: absolute;
    top: clamp(.7rem, 2vw, 1.25rem);
    left: clamp(.8rem, 3vw, 2rem);
    z-index: 1100;
    display: inline-flex;
    align-items: center;
    line-height: 0;
    text-decoration: none !important;
}

.register-corner-brand img {
    display: block;
    width: clamp(62px, 7vw, 86px);
    height: clamp(62px, 7vw, 86px);
    object-fit: contain;
}

/* Theme switcher sits opposite the logo. */
.register-corner-theme {
    position: absolute;
    top: clamp(.8rem, 2.1vw, 1.35rem);
    right: clamp(.8rem, 3vw, 2rem);
    z-index: 1100;
    display: flex;
    align-items: center;
}

.register-corner-theme .theme-toggle {
    width: 44px;
    height: 44px;
}

/* Freed vertical space is now available to the form. */
.register-content {
    min-height: 0;
    box-sizing: border-box;
    padding:
        clamp(5.25rem, 8vw, 6.5rem)
        clamp(1rem, 4vw, 3rem)
        clamp(1.5rem, 3vw, 2.5rem);
    overflow: visible;
}

.register-card {
    max-height: none;
    overflow: visible;
}

.register-whatsapp {
    bottom: 4.9rem;
}

/* Keep the footer in normal document flow. */
.public-auth-footer {
    position: relative;
}

@media (min-width: 900px) {
    body.register-page {
        overflow-y: auto;
    }

    .register-content {
        padding-top: clamp(5.5rem, 8vw, 6.25rem);
        padding-bottom: 1.25rem;
    }
}

@media (max-width: 600px) {
    body.register-page {
        min-height: 100svh;
        height: auto;
        overflow-y: auto;
    }

    .register-public-shell {
        min-height: 100svh;
        height: auto;
    }

    .register-corner-brand {
        top: .45rem;
        left: .65rem;
    }

    .register-corner-brand img {
        width: 58px;
        height: 58px;
    }

    .register-corner-theme {
        top: .55rem;
        right: .65rem;
    }

    .register-corner-theme .theme-toggle {
        width: 40px;
        height: 40px;
    }

    .register-content {
        min-height: 0;
        padding:
            4.15rem
            .7rem
            1.15rem;
        overflow: visible;
    }

    .register-card {
        max-height: none;
        overflow: visible;
    }

    .register-whatsapp {
        right: .7rem;
        bottom: 4.15rem;
    }
}
