*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }

body {
    font-family: 'Be Vietnam Pro', sans-serif;
    background: url('/images/back.jpg') center/cover fixed no-repeat;
    background-color: #05070a;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 90px 20px 40px;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(255,0,0,0.18) 0%, transparent 70%),
                linear-gradient(180deg, rgba(0,0,0,0.55) 0%, rgba(5,0,10,0.92) 100%);
    pointer-events: none;
    z-index: 0;
}

.container {
    background: rgba(5,7,10,0.97);
    border: 1px solid rgba(255,0,0,0.25);
    position: relative;
    overflow: hidden;
    width: 820px;
    max-width: 100%;
    min-height: 520px;
    z-index: 1;
    box-shadow: 0 20px 60px rgba(0,0,0,0.8), 0 0 0 1px rgba(255,0,0,0.1);
}

.form-container {
    position: absolute;
    top: 0;
    height: 100%;
    transition: all 0.6s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sign-in {
    left: 0; width: 50%;
    z-index: 2; opacity: 1;
}
.container.active .sign-in {
    transform: translateX(100%);
    opacity: 0; z-index: 1;
}

.sign-up {
    left: 0; width: 50%;
    opacity: 0; z-index: 1;
    pointer-events: none;
}
.container.active .sign-up {
    transform: translateX(100%);
    opacity: 1; z-index: 5;
    pointer-events: auto;
    animation: move 0.6s;
}

@keyframes move {
    0%, 49.99% { opacity: 0; z-index: 1; }
    50%, 100%  { opacity: 1; z-index: 5; }
}

.form-inner {
    width: 100%;
    padding: 36px 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.form-logo {
    font-size: 1.1rem;
    font-weight: 900;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 4px;
}
.form-logo span { color: #ff0000; }

.form-subtitle {
    font-size: 0.62rem;
    color: rgba(255,255,255,0.3);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 22px;
}

.auth-alert {
    width: 100%;
    padding: 10px 14px;
    margin-bottom: 14px;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    border-left: 3px solid;
}
.auth-alert.error   { background: rgba(255,0,0,0.08);   border-color: #ff0000; color: #ff6666; }
.auth-alert.success { background: rgba(0,255,136,0.08); border-color: #00ff88; color: #00ff88; }

.field-group { width: 100%; margin-bottom: 13px; }

.field-label {
    display: block;
    font-size: 0.58rem;
    font-weight: 900;
    color: rgba(255,255,255,0.35);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 5px;
}

.field-wrap { position: relative; }

.field-wrap i {
    position: absolute;
    left: 13px; top: 50%;
    transform: translateY(-50%);
    color: rgba(255,0,0,0.45);
    font-size: 13px;
    pointer-events: none;
}

.field-input {
    width: 100%;
    height: 44px;
    background: rgba(255,255,255,0.04) !important;
    border: 1px solid rgba(255,0,0,0.15) !important;
    border-radius: 0 !important;
    color: #fff !important;
    font-family: 'Be Vietnam Pro', sans-serif !important;
    font-size: 0.85rem !important;
    padding: 0 14px 0 40px !important;
    outline: none;
    transition: border-color 0.2s, background 0.2s;
    box-shadow: none !important;
}
.field-input:focus {
    border-color: #ff0000 !important;
    background: rgba(255,0,0,0.05) !important;
    box-shadow: none !important;
}
.field-input::placeholder { color: rgba(255,255,255,0.2) !important; }

.btn-auth {
    width: 100%;
    padding: 12px;
    margin-top: 8px;
    background: linear-gradient(135deg, #ff0000, #cc0000);
    color: #fff;
    border: none;
    font-family: 'Be Vietnam Pro', sans-serif;
    font-weight: 900;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.25s ease;
    clip-path: polygon(10px 0%, 100% 0%, calc(100% - 10px) 100%, 0% 100%);
    box-shadow: 4px 4px 0 rgba(0,0,0,0.4);
}
.btn-auth:hover {
    background: linear-gradient(135deg, #ff3333, #ff0000);
    transform: translateY(-2px);
    box-shadow: 6px 6px 0 rgba(0,0,0,0.5), 0 0 16px rgba(255,0,0,0.4);
}

/* Toggle */
.toggle-container {
    position: absolute;
    top: 0; left: 50%;
    width: 50%; height: 100%;
    overflow: hidden;
    transition: all 0.6s ease-in-out;
    border-radius: 120px 0 0 80px;
    z-index: 1000;
}
.container.active .toggle-container {
    transform: translateX(-100%);
    border-radius: 0 120px 80px 0;
}

.toggle {
    background: linear-gradient(135deg, #1a0000, #3d0000, #cc0000);
    height: 100%;
    color: #fff;
    position: relative;
    left: -100%;
    width: 200%;
    transform: translateX(0);
    transition: all 0.6s ease-in-out;
    display: flex;
}
.container.active .toggle { transform: translateX(50%); }

.toggle-panel {
    width: 50%; height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 0 32px;
    text-align: center;
    position: relative;
}
.toggle-panel::before {
    content: '';
    position: absolute;
    top: 28px; left: 50%;
    transform: translateX(-50%);
    width: 36px; height: 2px;
    background: rgba(255,255,255,0.25);
}

.toggle-left  { transform: translateX(-200%); }
.container.active .toggle-left  { transform: translateX(0); }
.toggle-right { transform: translateX(0); }
.container.active .toggle-right { transform: translateX(200%); }

.toggle-panel h1 {
    font-size: 1.3rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 10px;
}
.toggle-panel p {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.6);
    line-height: 1.6;
    margin-bottom: 24px;
}

.btn-toggle {
    padding: 9px 28px;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.5);
    color: #fff;
    font-family: 'Be Vietnam Pro', sans-serif;
    font-weight: 700;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.2s ease;
    clip-path: polygon(8px 0%, 100% 0%, calc(100% - 8px) 100%, 0% 100%);
}
.btn-toggle:hover {
    background: rgba(255,255,255,0.15);
    border-color: #fff;
}

/* Footer text */
.page-footer {
    position: relative;
    z-index: 2;
    margin-top: 20px;
    color: rgba(255,255,255,0.2);
    font-size: 10px;
    letter-spacing: 2px;
    text-align: center;
}

/* Mobile */
@media (max-width: 640px) {
    body { padding: 80px 12px 30px; }
    .container { min-height: auto; }
    .toggle-container { display: none; }
    .sign-in, .sign-up {
        position: relative;
        width: 100%; opacity: 1;
        transform: none !important;
        pointer-events: auto !important;
    }
    .sign-up { display: none; }
    .container.active .sign-up { display: flex; }
    .container.active .sign-in { display: none; }
    .mobile-switch {
        display: block;
        text-align: center;
        margin-top: 14px;
        font-size: 0.75rem;
        color: rgba(255,255,255,0.4);
    }
    .mobile-switch a {
        color: #ff0000;
        font-weight: 700;
        text-decoration: none;
        margin-left: 6px;
    }
}
@media (min-width: 641px) { .mobile-switch { display: none; } }

/* ── CAPTCHA ── */
.captcha-wrap { width: 100%; }

.captcha-img-box {
    display: flex;
    align-items: center;
    gap: 10px;
}

.captcha-img {
    height: 50px;
    border: 1px solid rgba(255,0,0,0.2);
    background: rgba(5,7,10,0.9);
    flex: 1;
    display: block;
    cursor: pointer;
}

.captcha-refresh {
    width: 36px; height: 36px;
    background: rgba(255,0,0,0.1);
    border: 1px solid rgba(255,0,0,0.25);
    color: rgba(255,255,255,0.5);
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.captcha-refresh:hover {
    background: rgba(255,0,0,0.2);
    color: #fff;
    border-color: #ff0000;
}


/* ── FORGOT PASSWORD PANEL (slide từ dưới lên trong container) ── */
.forgot-panel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5,7,10,0.98);
    border-top: 2px solid #ff0000;
    z-index: 2000;
    display: flex;
    align-items: stretch;
    justify-content: flex-start;
    overflow: hidden;          /* clip slider bên trong */
    transform: translateY(100%);
    opacity: 0;
    transition: all 0.6s ease-in-out;
    pointer-events: none;
}

.container.forgot-active .forgot-panel {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

/* Ẩn login/register khi forgot active */
.container.forgot-active .sign-in,
.container.forgot-active .sign-up,
.container.forgot-active .toggle-container {
    opacity: 0;
    pointer-events: none;
}

/* Slider chứa 2 bước nằm ngang */
.fp-slider {
    /* fill toàn bộ panel */
    width: 100%;
    height: 100%;
    display: flex;
    flex-wrap: nowrap;
    transition: transform 0.5s ease-in-out;
    will-change: transform;
}

.fp-slider.step2 {
    /* dịch sang trái đúng 100% (1 slide) */
    transform: translateX(-100%);
}

.fp-slide {
    min-width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.fp-inner {
    width: 320px;
    max-width: 85%;
    padding: 36px 0 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.forgot-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 32px;
    height: 32px;
    background: rgba(255,0,0,0.1);
    border: 1px solid rgba(255,0,0,0.25);
    color: rgba(255,255,255,0.5);
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 10;
}

.forgot-close:hover {
    background: rgba(255,0,0,0.25);
    color: #fff;
    border-color: #ff0000;
    transform: rotate(90deg);
}

/* Step indicator */
.fp-steps {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    width: 100%;
}

.fp-step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex: 1;
}

.fp-step-num {
    width: 28px;
    height: 28px;
    border: 1px solid rgba(255,255,255,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 900;
    color: rgba(255,255,255,0.3);
}

.fp-step-item.active .fp-step-num {
    border-color: #ff0000;
    background: rgba(255,0,0,0.15);
    color: #ff0000;
}

.fp-step-item.done .fp-step-num {
    border-color: #00ff88;
    background: rgba(0,255,136,0.1);
    color: #00ff88;
}

.fp-step-lbl {
    font-size: 0.55rem;
    color: rgba(255,255,255,0.25);
    text-transform: uppercase;
    letter-spacing: 1px;
    text-align: center;
}

.fp-step-item.active .fp-step-lbl,
.fp-step-item.done .fp-step-lbl {
    color: rgba(255,255,255,0.6);
}

.fp-step-line {
    flex: 1;
    height: 1px;
    background: rgba(255,255,255,0.1);
    margin-bottom: 18px;
}

.fp-back-link {
    display: block;
    text-align: center;
    margin-top: 12px;
    font-size: 0.72rem;
    color: rgba(255,255,255,0.3);
    text-decoration: none;
    transition: color 0.2s;
}

.fp-back-link:hover { color: #ff0000; }
.fp-back-link i { margin-right: 6px; }

/* Mobile */
@media (max-width: 640px) {
    .forgot-panel { align-items: flex-start; }
    .fp-inner { padding: 48px 0 24px; }
}
