/* 登入/註冊頁面樣式 */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 190px); /* 考慮頁頭和頁尾的高度 */
    padding: 40px 20px;
}

.auth-card {
    width: 100%;
    max-width: 400px;
    perspective: 1000px;
}

.card-inner {
    position: relative;
    width: 100%;
    transition: transform 0.8s;
    transform-style: preserve-3d;
}

.auth-card.flipped .card-inner {
    transform: rotateY(180deg);
}

.card-front, .card-back {
    position: absolute;
    width: 100%;
    backface-visibility: hidden;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    padding: 30px;
    display: flex;
    flex-direction: column;
}

.card-back {
    transform: rotateY(180deg);
}

.auth-card h2 {
    font-size: 1.8rem;
    color: #333;
    margin-bottom: 25px;
    text-align: center;
}

.auth-form {
    flex: 1;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #555;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    font-family: inherit;
}

.form-group input:focus {
    border-color: #4a7bff;
    outline: none;
    box-shadow: 0 0 0 2px rgba(74, 123, 255, 0.2);
}

.btn-block {
    width: 100%;
    margin-top: 10px;
    text-align: center;
}

.notice {
    font-size: 0.9rem;
    color: #666;
    margin-top: 15px;
    text-align: center;
}

.auth-toggle {
    text-align: center;
    margin-top: 15px;
    font-size: 0.9rem;
}

.auth-toggle a {
    color: #4a7bff;
    text-decoration: none;
    font-weight: 500;
}

.auth-toggle a:hover {
    text-decoration: underline;
}

.home-link {
    text-align: center;
    margin-top: 10px;
    font-size: 0.9rem;
}

.home-link a {
    color: #666;
    text-decoration: none;
}

.home-link a:hover {
    color: #4a7bff;
    text-decoration: underline;
}

/* 修正翻面卡片的高度問題 */
/* 使用絕對定位確保兩面卡片重疊並且修正高度計算 */
.card-front, .card-back {
    position: absolute;
    top: 0;
    left: 0;
}

/* 改進的高度處理 */
.card-inner {
    min-height: 500px; /* 給予最小高度以確保足夠空間 */
}

/* 當翻面時確保正面卡片不會影響布局 */
.auth-card.flipped .card-front {
    z-index: -1;
    display: none;
    pointer-events: none;
}

.auth-card:not(.flipped) .card-back {
    z-index: -1;
    display: none;
    pointer-events: none;
}

/* 在移動端確保更好的體驗 */
@media (max-width: 480px) {
    .auth-card h2 {
        font-size: 1.5rem;
        margin-bottom: 20px;
    }
    
    .form-group {
        margin-bottom: 12px;
    }
    
    .card-inner {
        min-height: 520px; /* 在移動端給予更多空間 */
    }
}

/* 確保整個內容區域有足夠的空間，不會出現滾動留白 */
main.auth-container {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* 確保頁腳始終在頁面底部 */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.footer {
    margin-top: auto;
}