/* ================= CONTAINER ================= */
.container{
    width:900px;
    height:550px;
    background:#fff;
    border-radius:25px;
    overflow:hidden;
    position:relative;
    display:flex;
    justify-content:center;
    align-items:center;
    margin-left: 200px;
    box-shadow:0 30px 60px rgba(0,0,0,0.3);
}

/* ================= FORM ================= */
.form{
    position:absolute;
    top:0;
    width:50%;
    height:100%;
    display:flex;
    flex-direction:column;
    justify-content:center;
    padding:80px;
    transition:opacity .4s ease;
}

.form h2{
    font-size:32px;
    margin-bottom:20px;
    color:#2d3a8c;
    transition:color .3s ease;
}

/* LOGIN */
.login{ 
    left:0; 
}

/* Hover LOGIN → đổi màu tiêu đề */
.login:hover h2{
    color:#3f4fc4;
}

/* REGISTER */
.register{
    right:0;
    opacity:0;
    pointer-events:none;
}

/* Hover REGISTER → đổi màu tiêu đề (FIX THEO YÊU CẦU) */
.register:hover h2{
    color:#3f4fc4;
}

.container.active .login{
    opacity:0;
    pointer-events:none;
}

.container.active .register{
    opacity:1;
    pointer-events:auto;
}

/* ================= FLOATING INPUT ================= */
.input-group{
    position:relative;
    margin:30px 0;
}

.input-group input{
    width:100%;
    border:none;
    border-bottom:2px solid #2d3a8c;
    padding:12px 0;
    font-size:16px;
    outline:none;
    background:transparent;
}

.input-group label{
    position:absolute;
    left:0;
    top:12px;
    color:#777;
    font-size:16px;
    pointer-events:none;
    transition: all 0.25s cubic-bezier(.4,0,.2,1);
}

/* Focus hoặc có nội dung */
.input-group input:focus + label,
.input-group input:valid + label{
    top:-10px;
    font-size:13px;
    color:#2d3a8c;
}

.input-group input:focus{
    border-bottom:2px solid #3f4fc4;
}

/* ================= BUTTON ================= */
button.submit{
    margin-top:30px;
    padding:14px;
    border:none;
    border-radius:30px;
    background:#2d3a8c;
    color:white;
    font-weight:600;
    cursor:pointer;
    transition:0.3s;
}

button.submit:hover{
    background:#1f2763;
}

/* ================= OVERLAY ================= */
.overlay{
    position:absolute;
    top:0;
    left:50%;
    width:50%;
    height:100%;
    background:linear-gradient(135deg,#2d3a8c,#3f4fc4);
    color:white;
    display:flex;
    justify-content:center;
    align-items:center;
    text-align:center;
    padding:40px;
    border-radius:0 25px 25px 0;
    transition: left 0.6s cubic-bezier(.77,0,.18,1),
                width 0.6s cubic-bezier(.77,0,.18,1),
                border-radius 0.6s cubic-bezier(.77,0,.18,1);
}

.container.full .overlay{
    left:0 !important;
    width:100% !important;
    border-radius:25px !important;
}

.container.active:not(.full) .overlay{
    left:0;
    width:50%;
    border-radius:25px 0 0 25px;
}

.container:not(.active):not(.full) .overlay{
    left:50%;
    width:50%;
    border-radius:0 25px 25px 0;
}

.overlay h2{
    font-size:36px;
    margin-bottom:20px;
}

.overlay p{
    margin-bottom:30px;
    font-size:16px;
    line-height:1.6;
}

.switch-btn{
    background:transparent;
    border:2px solid white;
    padding:10px 30px;
    border-radius:30px;
    color:white;
    cursor:pointer;
}

/* ================= ERROR HANDLING ================= */
.input-group.error input{
    border-bottom-color:#e53935 !important;
}

.input-group.error label{
    color:#e53935 !important;
}

.input-group.error input:valid + label{
    color:#e53935 !important;
}

.input-group .error-text{
    display:block;
    margin-top:6px;
    font-size:13px;
    line-height:1.4;
    color:#e53935;
    padding-left:20px;
    position:relative;
}

.input-group .error-text::before{
    content:"⚠  ";
    position:absolute;
    left:0;
    top:0;
    font-size:14px;
    color:#e53935;
}

/* ================= SHAKE ================= */
@keyframes shake{
    0%,100%{transform:translateX(0)}
    20%{transform:translateX(-5px)}
    40%{transform:translateX(5px)}
    60%{transform:translateX(-5px)}
    80%{transform:translateX(5px)}
}

.shake{
    animation:shake .35s;
}

/* ================= LOGIN NON-FIELD ERROR ================= */
.form-error {
    margin-bottom: 20px;
}

.form-error p {
    color: #e53935 !important;
    font-size: 14px;
    line-height: 1.5;
    padding-left: 22px;
    position: relative;
}

.form-error p::before {
    content: "⚠  ";
    position: absolute;
    left: 0;
    top: 0;
    color: #e53935;
    font-size: 15px;
}
