* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    background-color: rgb(34, 45, 49);
    font-family: sans-serif;
}

main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    max-width: 800px;
    overflow: hidden;
    justify-content: center;
    height: 100vh; /* 使 main 佔滿整個視窗高度 */
    margin: 0 auto;
}

main > * {
    grid-row: 1 / 2;
}
.signup ,
.signin {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 40% 0;
    color: rgb(252, 254, 255);
    font-size: 30px;
    background-color: rgb(28, 37, 41);
}

.signup > button,
.signin > button {
    border: none;
    background-color: rgb(252, 254, 255);
}
.signin {
    grid-column: 1 / 2;
}

.signupForm.active {
    display: flex;
}

.signup {
    grid-column: 2 / 3;
}

.loginForm {
    grid-column: 1 / 2;
    transform: translateX(-100%);
    display: flex;
}

.signupForm {
    grid-column: 2 / 3;
    transform: translateX(-100%);
    display: none;
}
.loginForm.active {
    display: flex;
}
.loginForm:not(.active) {
    display: none;
}
form {
    padding: 30px 20px;
    max-width: 500px;
    height: 520px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: transform 0.5s;
}

form.active {
    transform: translateX(0);
}

.backLayer{
    display: grid;
    grid-column: 1 / 3;
    grid-template-columns: 1fr 1fr;
    clip-path: inset(0 50% 0 0);
    background:rgb(252, 254, 255);
    z-index: 5;
    transition: clip-path 0.3s;
}

.login-label {
    text-align: center;
    font-size: 40px;
}

input, select {
    display: block;
    height: 40px;
    width: 300px;
    padding-left: 15px;
    margin: 30px 0;
    border: 2px solid #ccc;
    margin-bottom: 20px;
    margin-top: 5px;
    outline: none;
}


input.focus {
    background-color:rgb(34, 45, 49);
}

label {
    font-weight: normal;
}

button {
    background: transparent;
    border: 2px solid;
    color: rgb(34, 45, 49);
    width: 120px;
    height: 40px;
    text-transform: uppercase;
    font-size: 16px;
    cursor: pointer;
}

form button:hover {
    background-color: rgb(34, 45, 49);
    color: white;
}

/*-------------------------------*/
/* 模態視窗背景 */
.modal {
    display: none;
    position: fixed;
    z-index: 1001; /* 確保在最上層 */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}


/* 模態視窗內容 */
.modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border-radius: 10px;
    width: 300px;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    animation: slideDown 0.5s;
    z-index: 1000;
}

/* 關閉按鈕 */
.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}
.close:hover {
    color: black;
}

/* 模態視窗動畫 */
@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.twofa-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: flex-start; /* 從上開始排列 */

    padding-top: 160px; /* 加一點空間讓它不會太貼上面，可自行調整 */
}

.twofa-overlay.show {
    display: flex;
}

.twofa-box {
    background: white;
    padding: 8px;
    border-radius: 8px;
    width: 400px;
    max-width: 90%;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);

    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 10px;

}

.twofa-box h3 {
    font-size: 24px;
}

.twofa-box input {
    height: 40px;
    width: 100%;
    padding: 0 10px;
    font-size: 16px;
}

.twofa-actions {
    display: flex;
    justify-content: center;
    gap: 150px;
    width: 100%;
}

.twofa-actions button {
    width: 100px;
    height: 36px;
    font-size: 16px;
}

.twofa-actions button:hover {
    background-color: rgb(34, 45, 49);
    color: white;
}

.twofa-inner-box {
    position: relative;
    padding: 20px;
    border-radius: 6px;
    background: white;
    z-index: 1;
}

.twofa-inner-box::before,
.twofa-inner-box::after {
    content: "";
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    height: 2px;
    background: linear-gradient(to left, #33fffc, #194b4f, #33fffc);
    background-size: 200% auto;
    z-index: -1;
    animation: moveLight 2s linear infinite;
}

.twofa-inner-box::before {
    top: 0;
}

.twofa-inner-box::after {
    bottom: 0;
}

@keyframes moveLight {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

