/* ============================================
 * LOBBY-FORM.CSS - Form popup (Đăng ký / Đăng nhập) cho lobby.php
 * Hiển thị overlay với form thay vì chuyển trang
 * ============================================ */

.form-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100000;
    padding: 0.4rem;
    animation: formFadeIn 0.25s ease;
}

.form-overlay.show {
    display: flex;
}

@keyframes formFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.form-modal {
    width: 100%;
    max-width: 6.4rem;
    background: #fff;
    border-radius: 0.24rem;
    overflow: hidden;
    position: relative;
    animation: formSlideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes formSlideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Close button */
.form-close {
    position: absolute;
    top: 0.2rem;
    right: 0.2rem;
    width: 0.5rem;
    height: 0.5rem;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.form-close svg {
    width: 0.28rem;
    height: 0.28rem;
    stroke: #333;
    stroke-width: 3;
    stroke-linecap: round;
}

/* Tab header (Đăng ký / Đăng nhập) */
.form-tabs {
    display: flex;
    background: linear-gradient(135deg, #FF6B6B, #FF4757);
    padding: 0.4rem 0.3rem 0;
    position: relative;
}

.form-tab {
    flex: 1;
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.3rem;
    font-weight: 600;
    padding: 0.18rem 0;
    cursor: pointer;
    transition: color 0.2s;
    position: relative;
}

.form-tab.active {
    color: #fff;
}

.form-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 25%;
    width: 50%;
    height: 0.04rem;
    background: #fff;
    border-radius: 0.02rem;
}

/* Form content */
.form-content {
    padding: 0.4rem 0.3rem 0.5rem;
}

.form-content .form-title {
    font-size: 0.32rem;
    font-weight: 700;
    color: #2d3436;
    margin-bottom: 0.3rem;
    text-align: center;
}

.form-input-group {
    display: flex;
    align-items: center;
    gap: 0.16rem;
    padding: 0.22rem 0.2rem;
    background: #f8f8f8;
    border-radius: 0.1rem;
    margin-bottom: 0.2rem;
    border: 0.02rem solid transparent;
    transition: border-color 0.2s, background 0.2s;
}

.form-input-group:focus-within {
    border-color: #FF4757;
    background: #fff;
}

.form-input-group svg {
    width: 0.32rem;
    height: 0.32rem;
    flex-shrink: 0;
    opacity: 0.5;
}

.form-input-group input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 0.28rem;
    color: #2d3436;
    height: 0.4rem;
    min-width: 0;
    outline: none;
}

.form-input-group input::placeholder {
    color: #bbb;
}

.form-input-group .form-eye {
    cursor: pointer;
    flex-shrink: 0;
    width: 0.3rem;
    height: 0.3rem;
    opacity: 0.5;
    display: none;
}

.form-input-group .form-eye.show {
    display: block;
}

/* Captcha row */
.form-captcha {
    display: flex;
    align-items: center;
    gap: 0.12rem;
}

.form-captcha input {
    flex: 1;
}

.form-captcha img {
    width: 1.6rem;
    height: 0.56rem;
    border-radius: 0.08rem;
    cursor: pointer;
    flex-shrink: 0;
}

/* Nút reload captcha riêng - ĐÃ ẨN, không sử dụng nữa */
.captcha-reload {
    display: none;
}

/* Submit button */
.form-submit {
    width: 100%;
    height: 0.84rem;
    background: linear-gradient(135deg, #FF6B6B, #FF4757);
    color: #fff;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.32rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 0.4rem;
    box-shadow: 0 0.08rem 0.2rem rgba(255, 71, 87, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
}

.form-submit:active {
    transform: scale(0.98);
}

.form-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Switch link at bottom */
.form-switch {
    text-align: center;
    margin-top: 0.24rem;
    font-size: 0.26rem;
    color: #FF4757;
    cursor: pointer;
}

.form-switch:hover {
    text-decoration: underline;
}

/* Error message */
.form-error {
    color: #FF4757;
    font-size: 0.24rem;
    margin-top: -0.1rem;
    margin-bottom: 0.12rem;
    padding-left: 0.1rem;
    display: none;
}

.form-error.show {
    display: block;
}

/* Password strength */
.form-pwd-strength {
    display: flex;
    gap: 0.06rem;
    margin: -0.06rem 0 0.16rem 0.1rem;
}

.form-pwd-strength span {
    flex: 1;
    height: 0.04rem;
    background: #eee;
    border-radius: 0.02rem;
}

.form-pwd-strength.s1 span:nth-child(1) { background: #FF4757; }
.form-pwd-strength.s2 span:nth-child(-n+2) { background: #FFA502; }
.form-pwd-strength.s3 span:nth-child(-n+3) { background: #2ED573; }
.form-pwd-strength.s4 span { background: #2ED573; }

/* Form panels */
.form-panel {
    display: none;
}

.form-panel.active {
    display: block;
}

/* Mobile responsive */
@media (max-width: 360px) {
    .form-modal {
        max-width: 100%;
    }
    .form-content {
        padding: 0.3rem 0.24rem 0.4rem;
    }
}