:root {
    --ink: #111827;
    --muted: #6b7280;
    --brand: #ff6a00;
    --brand2: #ff3d3d;
    --dark: #1a0c02;
    --paper: #fffaf4;
    --line: rgba(17, 24, 39, 0.10);
    --orange-line: rgba(255, 106, 0, 0.18);
    --shadow: 0 14px 36px rgba(17, 24, 39, 0.10);
    --max: 1180px;
}

* {
    box-sizing: border-box;
}

body.register-page {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, "Noto Sans Thai", sans-serif;
    background:
        radial-gradient(circle at 18% 18%, rgba(255, 106, 0, 0.08), transparent 28%),
        radial-gradient(circle at 82% 70%, rgba(255, 61, 61, 0.06), transparent 30%),
        linear-gradient(180deg, #ffffff 0%, #fffaf5 100%);
}

/* ===================== HEADER ===================== */

header {
    background: var(--dark);
    color: #fff;
    position: relative;
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 106, 0, 0.22);
}

.header-inner {
    width: min(var(--max), calc(100% - 40px));
    margin: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
}

.logo img {
    height: 40px;
    width: auto;
    display: block;
    border-radius: 999px;
}

.nav {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav a {
    min-height: 40px;
    padding: 0 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 800;
    white-space: nowrap;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.nav .login {
    color: #fff;
    background: #535353;
}

.nav .login:hover {
    background: rgba(255, 255, 255, 0.18);
}

.nav .register {
    color: #fff;
    background: linear-gradient(90deg, var(--brand2), var(--brand));
    box-shadow: 0 8px 20px rgba(255, 106, 0, 0.26);
}

.nav .register:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 26px rgba(255, 106, 0, 0.32);
}

/* ===================== MAIN ===================== */

.register-main {
    width: min(var(--max), calc(100% - 40px));
    min-height: calc(90vh - 69px);
    margin: 0 auto;
    padding: 46px 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.register-shell {
    width: min(1060px, 100%);
    min-height: 640px;
    display: flex;
    overflow: hidden;
    border-radius: 28px;
    background: #fff;
    border: 1px solid rgba(255, 106, 0, 0.14);
    box-shadow: var(--shadow);
}

/* ===================== LEFT VISUAL ===================== */

.register-visual {
    position: relative;
    flex: 1;
    min-height: 640px;
    overflow: hidden;
    background-image: url("../assets/register_bg_phone.webp");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.register-visual::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(255, 250, 245, 0.92) 0%, rgba(255, 250, 245, 0.64) 42%, rgba(255, 250, 245, 0.05) 100%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 106, 0, 0.04));
}

.visual-copy {
    position: relative;
    z-index: 2;
    width: min(430px, calc(100% - 56px));
    padding: 54px 0 0 46px;
}

.visual-copy h1 {
    margin: 28px 0 0;
    color: var(--ink);
    font-size: clamp(36px, 4vw, 54px);
    line-height: 1.08;
    letter-spacing: -0.055em;
    font-weight: 950;
}

.visual-copy h1 strong {
    color: var(--brand2);
    font-weight: 950;
}

.visual-copy p {
    max-width: 390px;
    margin: 18px 0 0;
    color: #5d4637;
    font-size: 15px;
    line-height: 1.75;
    font-weight: 650;
}

/* ===================== RIGHT PANEL ===================== */

.register-panel {
    flex: 0.92;
    padding: 25px 46px;
    display: flex;
    align-items: center;
    background:
        radial-gradient(circle at top right, rgba(255, 106, 0, 0.06), transparent 34%),
        #fff;
}

.register-inner {
    width: 100%;
}

.register-title-row {
    display: flex;
    align-items: center;
    gap: 14px;
}

.register-icon {
    width: 52px;
    height: 52px;
    margin-bottom: 0;
    flex: 0 0 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    color: var(--brand);
    background: rgba(255, 106, 0, 0.10);
}

.register-icon i {
    font-size: 24px;
}

.register-panel h2 {
    margin: 0;
    color: var(--ink);
    font-size: 34px;
    line-height: 1.15;
    letter-spacing: -0.04em;
    font-weight: 950;
}

.register-subtitle {
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.7;
}

/* ===================== ALERT ===================== */

.alert {
    margin-top: 18px;
    padding: 13px 15px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.6;
}

.alert ul {
    margin: 0;
    padding-left: 20px;
}

.alert-success {
    border: 1px solid rgba(34, 197, 94, 0.24);
    background: #ecfdf5;
    color: #166534;
}

.alert-error {
    border: 1px solid rgba(239, 68, 68, 0.18);
    background: #fff1f1;
    color: #b42318;
}

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

.register-form {
    margin-top: 24px;
}

.form-row {
    display: flex;
    gap: 14px;
}

.form-row .form-group {
    flex: 1;
}

.form-group {
    margin-bottom: 6px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--ink);
    font-size: 14px;
    font-weight: 900;
}

.input-wrap {
    position: relative;
}

.input-wrap>i {
    position: absolute;
    left: 15px;
    top: 50%;
    z-index: 2;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 18px;
    pointer-events: none;
}

.input-wrap input,
.input-wrap select {
    width: 100%;
    height: 48px;
    padding: 0 44px;
    border: 1px solid rgba(17, 24, 39, 0.14);
    border-radius: 15px;
    outline: none;
    color: var(--ink);
    background: #fff;
    font: inherit;
    font-size: 14px;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.input-wrap input::placeholder {
    color: #a8afb9;
}

.input-wrap input:focus,
.input-wrap select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(255, 106, 0, 0.12);
}

.input-wrap select {
    appearance: none;
    cursor: pointer;
    padding-right: 40px;
    background-image:
        linear-gradient(45deg, transparent 50%, #6b7280 50%),
        linear-gradient(135deg, #6b7280 50%, transparent 50%);
    background-position:
        calc(100% - 20px) 21px,
        calc(100% - 14px) 21px;
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
}

.password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    width: 34px;
    height: 34px;
    transform: translateY(-50%);
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #9ca3af;
    cursor: pointer;
}

.password-toggle i {
    font-size: 18px;
}

.submit-btn {
    width: 100%;
    height: 52px;
    border: 0;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #fff;
    background: linear-gradient(90deg, var(--brand2), var(--brand));
    box-shadow: 0 12px 26px rgba(255, 106, 0, 0.26);
    font: inherit;
    font-size: 15px;
    font-weight: 950;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 30px rgba(255, 106, 0, 0.32);
}

.form-divider {
    margin: 24px 0 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    color: #9ca3af;
    font-size: 13px;
    font-weight: 800;
}

.form-divider::before,
.form-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: rgba(17, 24, 39, 0.10);
}

.form-footer {
    text-align: center;
    color: var(--muted);
    font-size: 14px;
}

.form-footer a {
    color: var(--brand2);
    text-decoration: none;
    font-weight: 950;
}

.form-footer a:hover {
    text-decoration: underline;
}

/* ===================== RESPONSIVE ===================== */

@media (max-width: 980px) {
    .register-shell {
        max-width: 640px;
        flex-direction: column;
    }

    .register-visual {
        display: none;
        min-height: 360px;
        background-image: url("../assets/register_bg_phone.webp");
        background-position: center 62%;
    }

    .register-visual::after {
        background:
            linear-gradient(180deg, rgba(255, 250, 245, 0.88) 0%, rgba(255, 250, 245, 0.55) 42%, rgba(255, 250, 245, 0.05) 100%);
    }

    .visual-copy {
        width: min(390px, calc(100% - 44px));
        padding: 30px 0 0 28px;
    }

    .visual-copy h1 {
        font-size: 34px;
    }

    .visual-copy p {
        font-size: 14px;
        max-width: 330px;
    }

    .register-panel {
        padding: 34px 30px 38px;
    }
}

@media (max-width: 560px) {
    .header-inner {
        width: calc(100% - 28px);
        flex-direction: column;
        gap: 12px;
        padding: 12px 0;
    }

    .logo img {
        height: 34px;
    }

    .nav {
        width: 100%;
        justify-content: center;
        gap: 8px;
    }

    .nav a {
        flex: 1;
        min-height: 40px;
        padding: 0 12px;
        font-size: 13px;
    }

    .register-main {
        width: calc(100% - 24px);
        min-height: 0;
        padding: 24px 0 34px;
    }

    .register-shell {
        border-radius: 22px;
    }

    .register-visual {
        min-height: 300px;
    }

    .visual-copy {
        padding: 24px 0 0 22px;
        width: min(320px, calc(100% - 34px));
    }

    .visual-copy h1 {
        margin-top: 18px;
        font-size: 29px;
    }

    .visual-copy p {
        margin-top: 10px;
        font-size: 13px;
        max-width: 260px;
    }

    .register-panel {
        padding: 28px 22px 32px;
    }

    .register-panel h2 {
        font-size: 30px;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .input-wrap input,
    .input-wrap select {
        height: 48px;
        border-radius: 15px;
    }
}

@media (max-width: 380px) {
    .register-main {
        width: calc(100% - 16px);
    }

    .register-panel {
        padding: 24px 18px 28px;
    }

    .visual-copy h1 {
        font-size: 27px;
    }

    .nav a {
        font-size: 12px;
    }
}

@media (hover: none) {

    .nav .register:hover,
    .submit-btn:hover {
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        transition-duration: 0.001ms !important;
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
    }
}
