:root {
    --migoer-orange: #ff4b22;
    --migoer-red: #ff2f16;
    --migoer-soft: #fff3ed;
    --migoer-text: #171923;
    --migoer-muted: #727783;
    --migoer-line: #dfe3ea;
    --migoer-danger: #ef3d2f;
    --migoer-warning-bg: #fff7ed;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }

body.signin {
    margin: 0;
    min-height: 100vh;
    color: var(--migoer-text);
    background:
        radial-gradient(circle at 4% 4%, rgba(255, 102, 45, .08) 0 7rem, transparent 7.1rem),
        radial-gradient(circle at 98% 2%, rgba(255, 102, 45, .09) 0 9rem, transparent 9.1rem),
        radial-gradient(circle at 99% 98%, rgba(255, 102, 45, .07) 0 10rem, transparent 10.1rem),
        linear-gradient(135deg, #fffdfc 0%, #ffffff 48%, #fffaf7 100%);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.auth-shell {
    width: min(1380px, calc(100% - 64px));
    min-height: 100vh;
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(480px, 1fr) minmax(420px, 540px);
    align-items: center;
    gap: clamp(56px, 8vw, 144px);
    padding: 56px 0 36px;
}

.brand-panel { align-self: stretch; display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.brand-copy { margin: 0 0 28px 52px; position: relative; z-index: 2; }
.brand-wordmark, .mobile-brand { display: flex; align-items: baseline; gap: 14px; white-space: nowrap; }
.brand-wordmark strong, .mobile-brand strong {
    font-size: clamp(48px, 5vw, 70px);
    line-height: 1;
    letter-spacing: -2px;
    color: var(--migoer-red);
    font-weight: 800;
}
.brand-wordmark span, .mobile-brand span { font-size: clamp(30px, 3.2vw, 44px); font-weight: 700; }
.brand-copy h1 { margin: 26px 0 28px; font-size: clamp(28px, 2.7vw, 38px); line-height: 1.2; font-weight: 650; }
.brand-security { margin: 0; color: #353945; font-size: 17px; }
.brand-security i { margin-right: 9px; color: var(--migoer-orange); }

.brand-scene { width: min(710px, 100%); }
.brand-scene img { display: block; width: 100%; height: auto; object-fit: contain; }

.login-panel { width: 100%; justify-self: end; }
.auth-card {
    width: 100%; padding: 44px 48px 40px; border: 1px solid rgba(35, 40, 52, .15); border-radius: 18px;
    background: rgba(255, 255, 255, .94); box-shadow: 0 18px 60px rgba(30, 34, 46, .12);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.auth-heading { text-align: center; margin-bottom: 28px; }
.auth-heading h2 { margin: 0; font-size: 34px; line-height: 1.25; font-weight: 750; }
.auth-heading p { margin: 12px 0 0; color: var(--migoer-muted); font-size: 16px; }
.mobile-brand { display: none; justify-content: center; margin-bottom: 24px; }
.mobile-brand strong { font-size: 36px; }
.mobile-brand span { font-size: 24px; }

.auth-field { position: relative; margin-bottom: 20px; }
.auth-field .form-control {
    width: 100%; height: 58px; margin: 0; padding: 0 50px;
    border: 1px solid var(--migoer-line); border-radius: 8px; background: #fff; color: #20232b;
    font-size: 16px; box-shadow: none; transition: border-color .18s, box-shadow .18s, background .18s;
}
.auth-field .form-control::placeholder { color: #a0a5ae; }
.auth-field .form-control:hover { border-color: #c5cad3; }
.auth-field .form-control:focus { border-color: var(--migoer-orange); box-shadow: 0 0 0 3px rgba(255, 75, 34, .12); outline: 0; }
.auth-field-icon { position: absolute; z-index: 1; left: 18px; top: 20px; width: 18px; color: #656b77; font-size: 18px; text-align: center; }
.password-toggle { position: absolute; z-index: 2; right: 12px; top: 10px; width: 40px; height: 40px; border: 0; border-radius: 6px; background: transparent; color: #69707d; }
.password-toggle:hover, .password-toggle:focus { background: #f5f6f8; color: var(--migoer-orange); outline: 0; }
.field-error { min-height: 0; margin: 0; color: var(--migoer-danger); font-size: 14px; line-height: 1.45; }
.field-error:not(:empty) { min-height: 22px; padding-top: 7px; }
.field-error:not(:empty)::before { content: "\f06a"; margin-right: 7px; font-family: "Font Awesome 5 Free"; font-weight: 900; }
.auth-field.has-error-state .form-control { border-color: var(--migoer-danger); background: #fffdfd; box-shadow: 0 0 0 3px rgba(239, 61, 47, .08); }

.captcha-row { display: grid; grid-template-columns: minmax(0, 1fr) 190px; align-items: start; gap: 14px; }
.captcha-row .auth-field { margin-bottom: 0; }
.captcha-refresh {
    height: 58px; padding: 0 2px; display: flex; align-items: center; justify-content: space-between; gap: 9px;
    border: 0; background: transparent; color: var(--migoer-orange); font-size: 14px; white-space: nowrap;
}
.captcha-refresh img { width: 126px; height: 48px; border: 1px solid #d8dce2; border-radius: 5px; object-fit: cover; background: #f4f4f4; }
.captcha-refresh:hover span, .captcha-refresh:focus span { text-decoration: underline; }
.captcha-refresh:focus { outline: 2px solid rgba(255, 75, 34, .3); outline-offset: 2px; border-radius: 4px; }

.login-message { margin: 2px 0 16px; padding: 12px 14px; border-radius: 7px; font-size: 14px; line-height: 1.5; }
.login-message::before { margin-right: 8px; font-family: "Font Awesome 5 Free"; font-weight: 900; }
.login-message.is-error { color: #b72d22; border: 1px solid #ffb4a8; background: #fff1ee; }
.login-message.is-error::before { content: "\f06a"; }
.login-message.is-warning { color: #a45112; border: 1px solid #ffd4ad; background: var(--migoer-warning-bg); }
.login-message.is-warning::before { content: "\f071"; }

.auth-options { margin: 8px 0 20px; }
.auth-options.without-captcha { margin-top: 2px; }
.remember-device { position: relative; display: inline-flex; align-items: center; gap: 10px; margin: 0; color: #3f4450; font-weight: 400; cursor: pointer; user-select: none; }
.remember-device input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.checkmark { width: 20px; height: 20px; border: 1px solid #c8cdd6; border-radius: 4px; background: #fff; display: grid; place-items: center; transition: .16s; }
.remember-device input:focus + .checkmark { border-color: var(--migoer-orange); box-shadow: 0 0 0 3px rgba(255, 75, 34, .12); }
.remember-device input:checked + .checkmark { border-color: var(--migoer-orange); background: var(--migoer-orange); }
.remember-device input:checked + .checkmark::after { content: ""; width: 9px; height: 5px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: translateY(-1px) rotate(-45deg); }

.login-submit {
    width: 100%; height: 58px; border: 0; border-radius: 7px; color: #fff; font-size: 18px; font-weight: 650;
    background: linear-gradient(100deg, var(--migoer-red), #ff5317); box-shadow: 0 12px 22px rgba(255, 61, 22, .2);
    transition: transform .15s, box-shadow .15s, opacity .15s;
}
.login-submit:hover, .login-submit:focus { color: #fff; transform: translateY(-1px); box-shadow: 0 15px 26px rgba(255, 61, 22, .27); outline: 0; }
.login-submit:focus { box-shadow: 0 0 0 4px rgba(255, 75, 34, .18), 0 15px 26px rgba(255, 61, 22, .27); }
.login-submit[disabled] { cursor: wait; opacity: .65; transform: none; box-shadow: none; }
.agreement { margin: 17px 0 0; text-align: center; color: #656b76; font-size: 13px; }
.agreement strong { color: var(--migoer-orange); font-weight: 500; }
.trusted-device { margin: 25px 0 0; text-align: center; color: #7f8590; font-size: 14px; }
.trusted-device i { margin-right: 7px; }
.login-footer { margin-top: 22px; text-align: center; color: #9a9ea7; font-size: 12px; }
.noscript-warning { margin: 14px 0 0; color: var(--migoer-danger); text-align: center; }

@media (max-width: 1080px) {
    .auth-shell { grid-template-columns: minmax(350px, 1fr) minmax(390px, 500px); gap: 42px; }
    .brand-copy { margin-left: 20px; }
    .brand-scene { transform: scale(.86); transform-origin: center left; }
}

@media (max-width: 860px) {
    body.signin { background: radial-gradient(circle at 50% 0, rgba(255, 102, 45, .12), transparent 38%), #fffaf7; }
    .auth-shell { width: min(520px, calc(100% - 36px)); grid-template-columns: 1fr; gap: 0; padding: 36px 0 24px; }
    .brand-panel { display: none; }
    .login-panel { justify-self: center; }
    .mobile-brand { display: flex; }
}

@media (max-width: 560px) {
    .auth-shell { width: 100%; min-height: 100vh; padding: 0; align-items: stretch; }
    .login-panel { display: flex; min-height: 100vh; flex-direction: column; justify-content: center; padding: 28px 18px 18px; }
    .auth-card { padding: 32px 22px 28px; border-radius: 14px; }
    .auth-heading { margin-bottom: 24px; }
    .auth-heading h2 { font-size: 28px; }
    .captcha-row { grid-template-columns: minmax(0, 1fr) 142px; gap: 8px; }
    .captcha-refresh img { width: 92px; }
    .captcha-refresh span { font-size: 13px; }
}

@media (max-width: 380px) {
    .login-panel { padding-left: 12px; padding-right: 12px; }
    .auth-card { padding-left: 16px; padding-right: 16px; }
    .captcha-row { grid-template-columns: minmax(0, 1fr) 116px; }
    .captcha-refresh img { width: 78px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
