body{
    margin:0;
    min-height:100vh;
    font-family:Arial, sans-serif;
    background:linear-gradient(135deg,#b30000,#ff1a1a);
    display:flex;
    flex-direction:column;
    justify-content:center;
    align-items:center;
    padding:20px;
    box-sizing:border-box;
}
.card{
    background:#fff;
    width:920px;
    max-width:96%;
    padding:42px;
    padding-top:80px;
    margin:0 0 18px;
    border-radius:20px;
    box-shadow:0 25px 50px rgba(0,0,0,0.30);
    text-align:center;
    position:relative;
}
.logo{
    margin:12px 0 18px;
}
.logo img{
    max-width:240px;
    width:100%;
    height:auto;
    filter:drop-shadow(0 5px 8px rgba(0,0,0,0.20));
}
.top-tools{
    display:flex;
    justify-content:space-between;
    align-items:center;
    flex-wrap:nowrap;
    gap:8px;
    position:absolute;
    top:22px;
    left:24px;
    right:24px;
    margin:0;
}
.lang-form{
    margin:0;
    display:inline-flex;
    align-items:center;
}
.lang-select{
    background:#fff;
    color:#8a0f14;
    border:1px solid #ddd;
    border-radius:10px;
    padding:8px 10px;
    font-weight:700;
    cursor:pointer;
    min-width:72px;
}
.lang-form{position:relative}
.lang-picker{position:relative}
.lang-picker-summary{list-style:none;display:flex;align-items:center;justify-content:center;min-height:38px;background:#fff;color:#8a0f14;border:1px solid #ddd;border-radius:10px;padding:8px 8px;font-weight:700;cursor:pointer;min-width:62px;box-shadow:0 0 0 1px rgba(0,0,0,0.08)}
.top-tools .theme-toggle-btn,
.top-tools .lang-picker-summary{
    height:44px;
    min-height:44px;
    border-radius:12px;
}
.top-tools .theme-toggle-btn{
    min-width:88px;
    justify-content:center;
    padding-top:0;
    padding-bottom:0;
}
.top-tools .lang-picker-summary{
    justify-content:center;
    min-width:62px;
    padding-top:0;
    padding-bottom:0;
}
.lang-picker-summary::-webkit-details-marker{display:none}
.lang-current{display:flex;align-items:center;gap:6px;line-height:1}
.lang-flag-img{width:18px;height:18px;border-radius:999px;object-fit:cover;flex:0 0 18px;box-shadow:0 0 0 1px rgba(0,0,0,0.08)}
.lang-menu{position:absolute;right:0;top:calc(100% + 8px);width:min(420px,calc(100vw - 24px));min-width:280px;max-height:min(360px,70vh);overflow:auto;padding:8px;border-radius:12px;background:#fff;border:1px solid #e5e7eb;box-shadow:0 12px 28px rgba(0,0,0,0.18);z-index:2000;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
.lang-option{display:flex;align-items:center;gap:8px;width:100%;background:#fff;color:#8a0f14;border:none;border-radius:10px;padding:8px 10px;min-height:40px;font-weight:700;cursor:pointer;text-align:left}
.lang-option:hover{background:#fef2f2}
@media (min-width:900px){.lang-menu{width:min(540px,calc(100vw - 24px));min-width:340px;grid-template-columns:repeat(3,minmax(0,1fr))}}
h2{
    margin:6px 0 10px;
    color:#8a0f14;
    text-align:center;
}
.subtitle{
    color:#666;
    font-size:14px;
    margin-bottom:22px;
    line-height:1.5;
}
.section-title{
    margin:22px 0 10px;
    text-align:left;
    color:#8a0f14;
    font-size:15px;
    font-weight:700;
    border-bottom:1px solid #f0d7d9;
    padding-bottom:8px;
}
input,
select,
textarea{
    width:100%;
    padding:12px;
    margin:10px 0;
    border-radius:10px;
    border:1px solid #ddd;
    font-size:14px;
    box-sizing:border-box;
    font-family:Arial, sans-serif;
}
textarea{
    resize:vertical;
    min-height:90px;
}
input:focus,
select:focus,
textarea:focus{
    outline:none;
    border-color:#ff1a1a;
}
select{
    appearance:none;
    -webkit-appearance:none;
    -moz-appearance:none;
    background-image:
        linear-gradient(45deg, transparent 50%, currentColor 50%),
        linear-gradient(135deg, currentColor 50%, transparent 50%);
    background-position:
        calc(100% - 18px) calc(50% - 3px),
        calc(100% - 12px) calc(50% - 3px);
    background-size:6px 6px, 6px 6px;
    background-repeat:no-repeat;
    padding-right:40px;
}
.grid-2{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:12px;
}
.register-columns{
    display:grid;
    grid-template-columns:minmax(0,1fr) minmax(0,1fr);
    gap:22px;
    align-items:start;
}
.register-column{
    min-width:0;
}
.invite-code-row{
    display:grid;
    grid-template-columns:minmax(0,.75fr) minmax(320px,1fr);
    gap:12px;
    align-items:start;
}
.invite-code-row input{
    margin:10px 0 0;
}
.invite-code-row .note{
    margin:10px 0 0;
    min-height:46px;
    height:46px;
    display:flex;
    align-items:center;
    white-space:nowrap;
    box-sizing:border-box;
}
button{
    width:100%;
    padding:12px;
    background:linear-gradient(135deg,#b30000,#ff1a1a);
    border:none;
    color:#fff;
    font-size:15px;
    border-radius:10px;
    cursor:pointer;
    transition:0.3s;
    margin-top:6px;
}
button:hover{
    opacity:0.92;
}
.error{
    background:#ffe5e5;
    color:#b30000;
    padding:10px;
    border-radius:10px;
    margin-bottom:15px;
    font-size:14px;
    text-align:left;
}
.success{
    background:#e6ffed;
    color:#2e7d32;
    padding:10px;
    border-radius:10px;
    margin-bottom:15px;
    font-size:14px;
    text-align:left;
}
.captcha-box{
    background:#fff5f5;
    border:1px solid #ffd0d0;
    border-radius:12px;
    padding:12px;
    margin-bottom:15px;
    text-align:left;
}
.captcha-q{
    font-size:14px;
    color:#8a0f14;
    margin-bottom:8px;
    font-weight:bold;
}
.links{
    margin-top:18px;
    margin-bottom:16px;
    font-size:13px;
    line-height:1.8;
}
.site-footer{
    margin-top:10px;
}
.links a{
    color:#b31217;
    text-decoration:none;
}
.links a:hover{
    text-decoration:underline;
}
.note{
    text-align:left;
    font-size:12px;
    color:#666;
    background:#faf7f7;
    border:1px solid #eee;
    border-radius:10px;
    padding:10px 12px;
    margin:10px 0 14px 0;
    line-height:1.5;
}
body.theme-dark .card{
    background:#141e31;
    color:#f4f7fb;
    border:1px solid #33435f;
    box-shadow:0 25px 50px rgba(0,0,0,0.45);
}
body.theme-dark .subtitle{
    color:#9eb0d2;
}
body.theme-dark .section-title,
body.theme-dark h2{
    color:#ff9e9e;
}
body.theme-dark input,
body.theme-dark select,
body.theme-dark textarea{
    background:#121b2d;
    color:#f4f7fb;
    border-color:#415173;
}
body.theme-dark input::placeholder,
body.theme-dark textarea::placeholder{
    color:#9eb0d2;
}
body.theme-dark select{
    color:#f4f7fb;
}
body.theme-dark .note{
    color:#c9d4e8;
    background:#182238;
    border-color:#415173;
}
body.theme-dark .captcha-box{
    background:#182238;
    border-color:#415173;
}
body.theme-dark .captcha-q{
    color:#ffb4b4;
}
body.theme-dark .links a{
    color:#ff8f8f;
}
@media (max-width:640px){
    .card{
        padding:32px 24px;
        padding-top:76px;
    }
    .top-tools{
        top:18px;
        left:20px;
        right:20px;
    }
    .logo img{
        max-width:200px;
    }
    .grid-2{
        grid-template-columns:1fr;
        gap:0;
    }
    .register-columns{
        grid-template-columns:1fr;
        gap:0;
    }
    .invite-code-row{
        grid-template-columns:1fr;
        gap:0;
    }
}
