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

:root {
    --blue: #2563eb;
    --blue-dark: #0f172a;
    --blue-light: #0ea5e9;
    --bg: #f8fafc;
    --card: #ffffff;
    --border: #dbe4ef;
    --text: #0f172a;
    --sub: #64748b;
    --input-bg: #ffffff;
    --shadow: 0 22px 56px rgba(15, 23, 42, .12);
}

html { min-height: 100%; }

body {
    min-height: 100vh;
    margin: 0;
    display: flex;
    background:
        linear-gradient(135deg, rgba(255,255,255,.94), rgba(239,246,255,.92)),
        radial-gradient(circle at top right, rgba(14,165,233,.18), transparent 36%);
    color: var(--text);
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.brand-panel {
    position: fixed;
    inset: 0 auto 0 0;
    width: 390px;
    min-height: 100vh;
    overflow: hidden;
    padding: 42px 36px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background:
        linear-gradient(135deg, rgba(15,23,42,.88), rgba(15,23,42,.72)),
        url("https://images.unsplash.com/photo-1558494949-ef010cbdcc31?auto=format&fit=crop&w=1300&q=80") center/cover no-repeat;
    color: #fff;
    z-index: 1;
}

.brand-panel::after {
    content: "";
    position: absolute;
    right: 28px;
    bottom: 0;
    width: 160px;
    height: 5px;
    background: linear-gradient(90deg, #0ea5e9, #22c55e, #f59e0b);
    border-radius: 999px 999px 0 0;
}

.brand-logo {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 11px;
    color: #fff;
    font-size: 1.08rem;
    font-weight: 900;
    line-height: 1.1;
    text-decoration: none;
}

.brand-logo:hover { color: #fff; }

.brand-logo img,
.brand-logo-icon {
    width: 46px !important;
    height: 46px !important;
    max-width: 46px !important;
    max-height: 46px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    flex: 0 0 auto;
}

.brand-logo img {
    background: #fff;
    border: 1px solid rgba(255,255,255,.42);
    padding: 2px;
}

.brand-logo-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,.16);
    color: #fff;
    font-size: 1.35rem;
}

.brand-panel > div:not(.brand-footer) {
    position: relative;
    z-index: 1;
}

.brand-tagline {
    color: #fff;
    font-size: clamp(2rem, 3.2vw, 3rem);
    font-weight: 950;
    line-height: 1.04;
}

.brand-desc {
    max-width: 300px;
    margin-top: 15px;
    color: rgba(255,255,255,.78);
    font-size: .92rem;
    line-height: 1.75;
}

.brand-footer {
    position: relative;
    z-index: 1;
    color: rgba(255,255,255,.58);
    font-size: .76rem;
}

.form-panel {
    margin-left: 390px;
    min-height: 100vh;
    flex: 1;
    padding: 42px 64px;
    overflow-y: auto;
}

.form-topbar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 22px;
    color: var(--sub);
    font-size: .86rem;
}

.form-topbar a,
.tos-box a {
    color: var(--blue);
    font-weight: 850;
    text-decoration: none;
}

.form-title,
.form-subtitle,
#regForm,
.alert-err,
.btn-google-r,
.form-panel > div[style*="background"] {
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.form-title {
    color: var(--text);
    font-size: clamp(1.55rem, 3vw, 2.15rem);
    font-weight: 950;
    line-height: 1.1;
    margin-bottom: 8px;
}

.form-subtitle {
    color: var(--sub);
    font-size: .94rem;
    line-height: 1.65;
    margin-bottom: 26px;
}

#regForm {
    background: #fff;
    border: 1px solid rgba(15, 23, 42, .08);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 26px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-size: .9rem;
    font-weight: 950;
    letter-spacing: 0;
    margin: 24px 0 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
    text-transform: none;
}

.section-title:first-of-type { margin-top: 0; }

.field-label {
    display: block;
    margin-bottom: 7px;
    color: var(--sub);
    font-size: .74rem;
    font-weight: 900;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.field-req { color: #dc2626; }
.field-wrap { position: relative; }

.field-wrap .field-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 1rem;
    pointer-events: none;
    z-index: 1;
}

.form-input {
    width: 100%;
    min-height: 46px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--input-bg);
    color: var(--text);
    font-family: inherit;
    font-size: .9rem;
    outline: 0;
    padding: 0 14px 0 40px;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.form-input.no-icon { padding-left: 14px; }

.form-input:focus {
    border-color: #38bdf8;
    box-shadow: 0 0 0 .2rem rgba(14, 165, 233, .14);
}

textarea.form-input {
    min-height: 90px;
    padding-top: 12px;
    resize: vertical;
}

.form-select { cursor: pointer; }
.phone-wrap { display: flex; gap: 8px; }
.phone-code { width: 104px; flex: 0 0 auto; padding-left: 12px; }
.pass-wrap { position: relative; }
.pass-wrap .form-input { padding-right: 46px; }

.pass-toggle {
    position: absolute;
    right: 13px;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: #94a3b8;
    font-size: 1.1rem;
    padding: 0;
}

.captcha-eq {
    min-height: 46px;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    font-size: 1rem;
    font-weight: 950;
    letter-spacing: .12em;
}

.tos-box {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
    margin-top: 20px;
    padding: 14px 15px;
}

.tos-box label {
    color: #475569;
    cursor: pointer;
    font-size: .86rem;
    line-height: 1.5;
}

.btn-register,
.btn-google-r {
    width: 100%;
    min-height: 48px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    font-family: inherit;
    font-size: .92rem;
    font-weight: 900;
}

.btn-register {
    margin-top: 20px;
    border: 0;
    background: linear-gradient(135deg, var(--blue-light), var(--blue));
    color: #fff;
    box-shadow: 0 14px 28px rgba(37, 99, 235, .2);
}

.btn-register:hover,
.btn-register:focus,
.btn-register:active {
    color: #fff;
    filter: brightness(.98);
}

.btn-google-r {
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
    text-decoration: none;
}

.btn-google-r:hover {
    border-color: #93c5fd;
    color: var(--text);
    box-shadow: 0 10px 22px rgba(37, 99, 235, .08);
}

.btn-google-r.disabled-sso {
    opacity: .55;
    pointer-events: none;
}

.alert-err {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: #b91c1c;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
    padding: 12px 14px;
    font-size: .88rem;
}

@media (max-width: 991px) {
    .brand-panel {
        width: 320px;
        padding: 34px 28px;
    }

    .form-panel {
        margin-left: 320px;
        padding: 34px 28px;
    }
}

@media (max-width: 767px) {
    body {
        display: block;
        min-height: 100vh;
    }

    .brand-panel {
        position: relative;
        display: block;
        width: 100%;
        min-height: auto;
        padding: 22px 20px;
    }

    .brand-panel > div:not(.brand-footer),
    .brand-footer {
        display: none;
    }

    .form-panel {
        margin-left: 0;
        padding: 18px 14px 28px;
    }

    .form-topbar {
        justify-content: center;
        margin-bottom: 14px;
        text-align: center;
    }

    .form-title,
    .form-subtitle {
        text-align: center;
    }

    #regForm {
        padding: 18px 15px;
        box-shadow: 0 12px 28px rgba(15,23,42,.08);
    }

    .phone-wrap {
        display: grid;
        grid-template-columns: 112px minmax(0, 1fr);
    }
}
