/* 專屬登入與註冊頁面的高質感分割配置 (Split-screen auth layout) */
.auth-wrapper {
    display: flex;
    min-height: 100vh;
    background-color: #ffffff;
    font-family: 'Inter', 'Noto Sans TC', sans-serif;
}

/* 左側：品牌形象區 (CIS Navy + Gold,搭配 SAIP brand 視覺) */
.auth-left {
    flex: 1;
    display: none;
    background: linear-gradient(135deg, #13204A 0%, #1B2C5A 50%, #2C3F73 100%);
    color: #fff;
    position: relative;
    overflow: hidden;
    flex-direction: column;
    justify-content: center;
    padding: 5rem;
}

/* CIS 紋理:金色光暈 + 細線網格 + 波浪 */
.auth-left::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 18% 20%, rgba(217, 164, 65, 0.22), transparent 38%),
        radial-gradient(circle at 82% 78%, rgba(232, 192, 120, 0.16), transparent 42%),
        linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><path d='M0 50 Q 25 30 50 50 T 100 50' stroke='rgba(217,164,65,0.10)' fill='none' stroke-width='0.4'/></svg>");
    background-size: auto, auto, 44px 44px, 44px 44px, 380px 380px;
    pointer-events: none;
}

/* 大型 SAIP 浮水印字 (右下) — CIS 質感前景 */
.auth-left::after {
    content: "SAIP";
    position: absolute;
    right: -.4rem;
    bottom: -3rem;
    font-family: 'Inter', 'Noto Sans TC', sans-serif;
    font-weight: 900;
    font-size: 18rem;
    letter-spacing: -10px;
    color: rgba(232, 192, 120, 0.05);
    line-height: 1;
    pointer-events: none;
    user-select: none;
}

@media (min-width: 1024px) {
    .auth-left {
        display: flex;
    }
}

.auth-brand {
    margin-bottom: 2.5rem;
    position: relative; z-index: 2;
}

.auth-brand a {
    font-size: 1.6rem;
    font-weight: 900;
    color: #fff;
    text-decoration: none;
    letter-spacing: 1.5px;
    display: inline-flex;
    align-items: center;
    gap: .8rem;
}

.auth-brand a::before {
    content: "";
    width: 38px; height: 38px; border-radius: 50%;
    background: linear-gradient(135deg, #D9A441, #E8C078);
    box-shadow: 0 8px 24px -8px rgba(217, 164, 65, 0.6);
}

/* 主標 */
.auth-left h2 {
    position: relative; z-index: 2;
    font-size: 2.6rem;
    font-weight: 900;
    color: #fff;
    line-height: 1.25;
    margin-bottom: 1.5rem;
    letter-spacing: -.5px;
}

.auth-left h2 br + * { color: #E8C078; }

.auth-left p {
    position: relative; z-index: 2;
    color: rgba(255, 255, 255, 0.78);
    font-size: 1.05rem;
    line-height: 1.85;
    max-width: 460px;
}

/* 底部 CIS 標語列 */
.auth-left .cis-tagline {
    position: absolute;
    left: 5rem; bottom: 3rem;
    z-index: 2;
    color: rgba(232, 192, 120, 0.85);
    font-weight: 700;
    font-size: .82rem;
    letter-spacing: 4px;
    display: inline-flex; align-items: center; gap: .8rem;
}
.auth-left .cis-tagline::before {
    content: ""; width: 2.4rem; height: 1px; background: rgba(232, 192, 120, 0.5);
}

/* 右側：乾淨的白色表單區 */
.auth-right {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    background: #ffffff;
    position: relative;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    animation: fadeUp 0.6s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
}

/* 移動端才顯示的 Logo (桌面版已在左側) */
.auth-mobile-logo {
    display: none;
    text-align: center;
    margin-bottom: 2rem;
}

@media (max-width: 1023px) {
    .auth-mobile-logo {
        display: block;
    }
}

.auth-card h1 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
}

.auth-card p.subtitle {
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 2.5rem;
}

/* 第三方登入按鈕 (OAuth 2.0) */
.social-login-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.btn-social {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
    border: none;
}

.btn-google {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: var(--text-main);
}

.btn-google:hover {
    background: #f8fafc;
    border-color: rgba(0, 0, 0, 0.15);
    box-shadow: var(--shadow-lg);
    transform: translateY(-1px);
}

.btn-line {
    background: #06C755;
    color: white;
}

.btn-line:hover {
    background: #05b04a;
    box-shadow: 0 4px 15px rgba(6, 199, 85, 0.3);
    transform: translateY(-1px);
}

.social-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

/* 分隔線 (或使用 Email) */
.auth-divider {
    display: flex;
    align-items: center;
    margin-bottom: 2.5rem;
    color: #cbd5e1;
    font-size: 0.9rem;
    font-weight: 500;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(0, 0, 0, 0.06);
}

.auth-divider span {
    padding: 0 1rem;
}

/* 時尚浮動標籤表單 Input (Floating Label) */
.form-group {
    position: relative;
    margin-bottom: 1.5rem;
}

.form-input {
    width: 100%;
    padding: 1.2rem 1rem 0.5rem;
    font-size: 1rem;
    background: var(--bg-color);
    border: 1px solid transparent;
    border-radius: 12px;
    color: var(--text-main);
    transition: all 0.3s;
    box-sizing: border-box;
    outline: none;
    font-weight: 500;
}

.form-input:focus {
    background: #ffffff;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

.form-label {
    position: absolute;
    left: 1rem;
    top: 1rem;
    font-size: 1rem;
    color: var(--text-muted);
    pointer-events: none;
    transition: 0.2s ease all;
    font-weight: 500;
}

.form-input:focus~.form-label,
.form-input:not(:placeholder-shown)~.form-label {
    top: 0.4rem;
    font-size: 0.75rem;
    color: var(--primary-color);
    font-weight: 600;
}

/* 顯示密碼的小眼睛按鈕 */
.toggle-password {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
}

/* 記住我與忘記密碼 */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-main);
    font-weight: 500;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 1.1rem;
    height: 1.1rem;
    accent-color: var(--primary-color);
    cursor: pointer;
}

.forgot-password {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

.forgot-password:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* 提交按鈕 */
.btn-submit {
    width: 100%;
    background: var(--text-main);
    color: white;
    border: none;
    padding: 1.1rem;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
}

.btn-submit:hover {
    background: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.25);
}

/* 切換頁面連結 */
.auth-switch {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
}

.auth-switch a {
    color: var(--primary-color);
    font-weight: 700;
    text-decoration: none;
    margin-left: 0.3rem;
}

.auth-switch a:hover {
    text-decoration: underline;
    color: var(--primary-hover);
}

/* 錯誤提示框 */
.alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #ef4444;
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    display: flex;
    gap: 0.5rem;
    align-items: center;
    animation: shake 0.5s ease-in-out;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

/* 絕對定位在右上角的返回首頁按鈕 */
.back-to-home {
    position: absolute;
    top: 1.5rem;
    right: 2rem;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: color 0.3s;
    background: rgba(0, 0, 0, 0.03);
    padding: 0.5rem 1rem;
    border-radius: 50px;
}

.back-to-home:hover {
    background: rgba(0, 0, 0, 0.06);
    color: var(--text-main);
}