/* ==========================================================
   VALRYN REGISTER
   register.css
========================================================== */

:root {
    --register-bg: #05070d;
    --register-panel: rgba(8, 13, 26, 0.94);

    --register-blue: #2563eb;
    --register-blue-light: #60a5fa;
    --register-gold: #d4af37;
    --register-white: #ffffff;
    --register-text: #e5e7eb;
    --register-muted: #94a3b8;
    --register-error: #f87171;
    --register-success: #4ade80;

    --register-border: rgba(96, 165, 250, 0.2);
    --register-border-active: rgba(96, 165, 250, 0.75);

    --register-radius: 22px;
}

/* ==========================================================
   RESET
========================================================== */

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    min-height: 100%;

    scroll-behavior: smooth;
}

body {
    min-width: 320px;
    min-height: 100vh;

    margin: 0;

    overflow-x: hidden;

    color: var(--register-text);

    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    background: var(--register-bg);
}

button,
input {
    font: inherit;
}

a {
    color: inherit;
}

[hidden] {
    display: none !important;
}

/* ==========================================================
   BACKGROUND
========================================================== */

.register-background {
    position: fixed;
    inset: 0;
    z-index: -2;

    background:
        linear-gradient(
            180deg,
            rgba(3, 7, 18, 0.46),
            rgba(1, 4, 10, 0.94)
        ),
        radial-gradient(
            circle at 50% 12%,
            rgba(37, 99, 235, 0.3),
            transparent 34%
        ),
        url("../assets/images/V-HQ.jpg")
            center / cover
            no-repeat;
}

.register-background::before {
    content: "";

    position: absolute;
    inset: 0;

    background:
        radial-gradient(
            circle at 16% 24%,
            rgba(96, 165, 250, 0.16),
            transparent 30%
        ),
        radial-gradient(
            circle at 82% 76%,
            rgba(212, 175, 55, 0.1),
            transparent 32%
        ),
        linear-gradient(
            90deg,
            rgba(0, 0, 0, 0.4),
            transparent 48%,
            rgba(0, 0, 0, 0.4)
        );
}

.register-background::after {
    content: "";

    position: absolute;
    inset: 0;

    background-image:
        linear-gradient(
            rgba(255, 255, 255, 0.018) 1px,
            transparent 1px
        ),
        linear-gradient(
            90deg,
            rgba(255, 255, 255, 0.018) 1px,
            transparent 1px
        );

    background-size: 42px 42px;

    mask-image:
        linear-gradient(
            to bottom,
            rgba(0, 0, 0, 0.78),
            transparent
        );
}

/* ==========================================================
   PAGE
========================================================== */

.register-page {
    width: 100%;
    min-height: 100vh;

    display: grid;
    place-items: center;

    padding:
        max(28px, env(safe-area-inset-top))
        max(20px, env(safe-area-inset-right))
        max(28px, env(safe-area-inset-bottom))
        max(20px, env(safe-area-inset-left));
}

/* ==========================================================
   CARD
========================================================== */

.register-card {
    width: min(100%, 680px);

    padding: clamp(28px, 5vw, 46px);

    border: 1px solid var(--register-border);
    border-radius: var(--register-radius);

    background:
        linear-gradient(
            180deg,
            rgba(15, 23, 42, 0.93),
            rgba(5, 9, 18, 0.95)
        );

    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);

    box-shadow:
        0 30px 90px rgba(0, 0, 0, 0.52),
        0 0 60px rgba(37, 99, 235, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* ==========================================================
   BRAND
========================================================== */

.brand {
    width: fit-content;

    display: inline-flex;
    align-items: center;
    gap: 12px;

    color: var(--register-white);
    text-decoration: none;

    font-size: 1.1rem;
    font-weight: 900;
    letter-spacing: 0.16em;

    transition:
        color 0.22s ease,
        transform 0.22s ease;
}

.brand img {
    width: 52px;
    height: 52px;

    object-fit: contain;

    filter:
        drop-shadow(0 0 14px rgba(96, 165, 250, 0.26));
}

.brand:hover {
    color: var(--register-blue-light);

    transform: translateY(-2px);
}

/* ==========================================================
   HEADING
========================================================== */

.register-heading {
    margin-top: 30px;
}

.eyebrow {
    margin: 0 0 9px;

    color: var(--register-blue-light);

    font-size: 0.76rem;
    font-weight: 900;
    letter-spacing: 0.22em;
    text-transform: uppercase;
}

.register-heading h1 {
    margin: 0;

    color: var(--register-white);

    font-size: clamp(2.15rem, 7vw, 3.25rem);
    line-height: 1.05;
}

.register-heading > p:last-child {
    margin: 15px 0 0;

    color: var(--register-muted);

    font-size: 0.98rem;
    line-height: 1.6;
}

/* ==========================================================
   FORM MESSAGE
========================================================== */

.form-message {
    margin-top: 24px;
    padding: 13px 15px;

    border: 1px solid rgba(248, 113, 113, 0.38);
    border-radius: 12px;

    color: #fecaca;

    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.45;

    background: rgba(127, 29, 29, 0.28);
}

.form-message.success {
    color: #bbf7d0;

    border-color: rgba(74, 222, 128, 0.4);

    background: rgba(20, 83, 45, 0.28);
}

/* ==========================================================
   FORM
========================================================== */

#registerForm {
    display: grid;
    gap: 21px;

    margin-top: 28px;
}

.row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.input-group {
    display: grid;
    gap: 9px;
}

.input-group label {
    color: var(--register-text);

    font-size: 0.87rem;
    font-weight: 800;
}

.input-group input {
    width: 100%;
    min-height: 52px;

    padding: 0 15px;

    color: var(--register-white);

    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 12px;
    outline: none;

    background: rgba(2, 6, 23, 0.72);

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease;
}

.input-group input::placeholder {
    color: rgba(148, 163, 184, 0.62);
}

.input-group input:hover {
    border-color: rgba(96, 165, 250, 0.42);
}

.input-group input:focus {
    border-color: var(--register-border-active);

    background: rgba(2, 6, 23, 0.92);

    box-shadow:
        0 0 0 4px rgba(37, 99, 235, 0.14),
        0 0 24px rgba(37, 99, 235, 0.12);
}

.input-group input[aria-invalid="true"] {
    border-color: rgba(248, 113, 113, 0.82);

    box-shadow: 0 0 0 4px rgba(248, 113, 113, 0.1);
}

/* ==========================================================
   PASSWORD
========================================================== */

.password-box {
    position: relative;
}

.password-box input {
    padding-right: 76px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 10px;

    min-width: 56px;
    min-height: 34px;

    padding: 0 10px;

    color: var(--register-blue-light);

    border: 0;
    border-radius: 8px;

    background: transparent;

    font-size: 0.76rem;
    font-weight: 900;

    cursor: pointer;

    transform: translateY(-50%);

    transition:
        color 0.2s ease,
        background 0.2s ease;
}

.password-toggle:hover {
    color: var(--register-white);

    background: rgba(96, 165, 250, 0.1);
}

/* ==========================================================
   PASSWORD STRENGTH
========================================================== */

.password-strength {
    width: 100%;
    height: 7px;

    overflow: hidden;

    border-radius: 999px;

    background: rgba(148, 163, 184, 0.15);
}

.strength-bar {
    width: 0;
    height: 100%;

    border-radius: inherit;

    background: var(--register-error);

    transition:
        width 0.25s ease,
        background 0.25s ease;
}

.strength-bar.weak {
    width: 25%;
    background: #ef4444;
}

.strength-bar.fair {
    width: 50%;
    background: #f97316;
}

.strength-bar.good {
    width: 75%;
    background: #eab308;
}

.strength-bar.strong {
    width: 100%;
    background: #22c55e;
}

#passwordStrengthText {
    margin: -1px 0 0;

    color: var(--register-muted);

    font-size: 0.76rem;
    font-weight: 700;
}

/* ==========================================================
   ERRORS
========================================================== */

.error {
    min-height: 17px;

    color: var(--register-error);

    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.35;
}

/* ==========================================================
   CHECKBOXES
========================================================== */

.checkbox-group {
    width: fit-content;

    display: inline-flex;
    align-items: flex-start;
    gap: 10px;

    color: var(--register-muted);

    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.45;

    cursor: pointer;
}

.checkbox-group input {
    width: 17px;
    height: 17px;

    flex: 0 0 auto;

    margin: 2px 0 0;

    accent-color: var(--register-blue);
}

.checkbox-group a {
    color: var(--register-blue-light);
    text-decoration: none;
}

.checkbox-group a:hover {
    color: var(--register-white);
}

/* ==========================================================
   BUTTON
========================================================== */

.primary-button {
    width: 100%;
    min-height: 52px;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;

    padding: 12px 20px;

    color: var(--register-white);

    border: 1px solid rgba(96, 165, 250, 0.5);
    border-radius: 12px;

    background:
        linear-gradient(
            135deg,
            #1d4ed8,
            #2563eb 58%,
            #3b82f6
        );

    box-shadow:
            0 14px 30px rgba(37, 99, 235, 0.24),
            inset 0 1px 0 rgba(255, 255, 255, 0.16);

    font-size: 0.93rem;
    font-weight: 900;

    cursor: pointer;

    transition:
        transform 0.22s ease,
        box-shadow 0.22s ease,
        opacity 0.22s ease;
}

.primary-button:hover {
    transform: translateY(-2px);

    box-shadow:
        0 18px 38px rgba(37, 99, 235, 0.34),
        0 0 26px rgba(96, 165, 250, 0.18);
}

.primary-button:disabled {
    opacity: 0.65;

    cursor: wait;
    transform: none;
}

/* ==========================================================
   BUTTON LOADER
========================================================== */

.button-loader {
    width: 18px;
    height: 18px;

    display: none;

    border: 2px solid rgba(255, 255, 255, 0.34);
    border-top-color: var(--register-white);
    border-radius: 50%;

    animation: register-spin 0.7s linear infinite;
}

.primary-button.is-loading .button-label {
    opacity: 0.72;
}

.primary-button.is-loading .button-loader {
    display: inline-block;
}

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

/* ==========================================================
   SIGN IN LINK
========================================================== */

.signin-link {
    margin-top: 26px;

    color: var(--register-muted);

    font-size: 0.86rem;
    font-weight: 700;
    text-align: center;
}

.signin-link a {
    color: var(--register-blue-light);
    text-decoration: none;

    font-weight: 900;
}

.signin-link a:hover {
    color: var(--register-white);
}

/* ==========================================================
   ACCESSIBILITY
========================================================== */

.primary-button:focus-visible,
.password-toggle:focus-visible,
.brand:focus-visible,
.checkbox-group a:focus-visible,
.signin-link a:focus-visible {
    outline: 3px solid rgba(96, 165, 250, 0.42);
    outline-offset: 3px;
}

/* ==========================================================
   TABLET
========================================================== */

@media (max-width: 760px) {
    .register-card {
        width: min(100%, 590px);
    }

    .row {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================
   MOBILE
========================================================== */

@media (max-width: 560px) {
    .register-page {
        align-items: start;

        padding:
            max(18px, env(safe-area-inset-top))
            max(12px, env(safe-area-inset-right))
            max(18px, env(safe-area-inset-bottom))
            max(12px, env(safe-area-inset-left));
    }

.register-card {
    width: 100%;

    padding: 26px 20px;

    border-radius: 18px;
}

    .brand {
        font-size: 1rem;
    }

    .brand img {
        width: 44px;
        height: 44px;
    }

    .register-heading {
        margin-top: 25px;
    }

    .register-heading h1 {
        font-size: 2.35rem;
    }

    .input-group input,
    .primary-button {
        min-height: 50px;
    }
}

/* ==========================================================
   REDUCED MOTION
========================================================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}