/**
 * Auth Page - 神社風格登入頁面
 * 現代和風設計
 */

/* --- 頁面背景 --- */
.auth-page-wrapper {
    min-height: 100vh;
    background-color: #fdfbf7;
    background-image: radial-gradient(#e8e4df 1px, transparent 1px);
    background-size: 24px 24px;
    padding: 100px 20px 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* --- 頁面標題 --- */
.auth-page-header {
    text-align: center;
    margin-bottom: 24px;
}

.auth-page-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #2c1810;
    margin-bottom: 8px;
}

.auth-page-header p {
    font-size: 0.95rem;
    color: #6b5b4f;
}

.back-to-home {
    display: inline-block;
    margin-bottom: 20px;
    color: #8d6e63;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.back-to-home:hover {
    color: #5d4037;
}

/* --- 主容器（日式卡片） --- */
.auth-shrine-container {
    position: relative;
    width: 100%;
    max-width: 420px;
    background: #ffffff;
    border: 3px solid #3e2723;
    border-radius: 20px;
    box-shadow: 8px 8px 0 rgba(62, 39, 35, 0.12);
    overflow: visible;
    padding: 50px 32px 32px;
}

/* --- Q北 守門人 --- */
.auth-greeter {
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}

.auth-greeter img {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: 3px solid #3e2723;
    background: #fdfbf7;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.greeter-speech {
    position: absolute;
    top: -5px;
    left: 105%;
    white-space: nowrap;
    background: #fff;
    border: 1.5px solid #3e2723;
    border-radius: 8px;
    padding: 5px 10px;
    font-size: 0.75rem;
    color: #2c1810;
    box-shadow: 2px 2px 0 rgba(62, 39, 35, 0.1);
}

.greeter-speech::before {
    content: '';
    position: absolute;
    left: -10px;
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-right-color: #3e2723;
}

.greeter-speech::after {
    content: '';
    position: absolute;
    left: -6px;
    top: 50%;
    transform: translateY(-50%);
    border: 5px solid transparent;
    border-right-color: #fff;
}

/* --- Tab 切換 --- */
.auth-tabs-shrine {
    display: flex;
    gap: 0;
    margin-bottom: 24px;
    border: 2px solid #e0d6cc;
    border-radius: 12px;
    overflow: hidden;
    background: #f5f0e8;
}

.auth-tab-shrine {
    flex: 1;
    padding: 14px 20px;
    text-align: center;
    font-size: 1rem;
    font-weight: 600;
    color: #6b5b4f;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.auth-tab-shrine:hover {
    background: rgba(62, 39, 35, 0.05);
}

.auth-tab-shrine.active {
    background: #3e2723;
    color: #fbbf24;
}

/* --- 表單樣式 --- */
.auth-form-shrine {
    display: none;
}

.auth-form-shrine.active {
    display: block;
}

.form-group-shrine {
    margin-bottom: 20px;
}

.form-group-shrine label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #3e2723;
}

.form-group-shrine input,
.form-group-shrine select {
    width: 100%;
    padding: 14px 16px;
    font-size: 1rem;
    background: #fdfbf7;
    border: 2px solid #e0d6cc;
    border-radius: 10px;
    color: #2c1810;
    transition: all 0.2s;
    box-sizing: border-box;
}

.form-group-shrine input:focus,
.form-group-shrine select:focus {
    outline: none;
    border-color: #fbbf24;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.15);
}

.form-group-shrine input::placeholder {
    color: #a69b8c;
}

/* 密碼輸入框容器 */
.password-input-wrapper {
    position: relative;
}

.password-input-wrapper input {
    padding-right: 50px;
}

.password-toggle-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    color: #8d6e63;
    padding: 4px;
}

.password-toggle-btn:hover {
    color: #5d4037;
}

/* 密碼要求提示 */
.password-requirements {
    margin-top: 10px;
    font-size: 0.8rem;
}

.password-requirements div {
    margin-bottom: 4px;
    color: #6b5b4f;
}

.password-requirements .valid {
    color: #2e7d32;
}

.password-requirements .invalid {
    color: #c62828;
}

/* --- 主要按鈕（神社木頭風） --- */
.btn-shrine-primary {
    width: 100%;
    padding: 16px 24px;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 1px;
    background: linear-gradient(180deg, #4a3728 0%, #3e2723 100%);
    color: #fbbf24;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 0 #2a1a12, 0 6px 12px rgba(62, 39, 35, 0.25);
}

.btn-shrine-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #2a1a12, 0 10px 20px rgba(62, 39, 35, 0.3);
}

.btn-shrine-primary:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #2a1a12, 0 3px 6px rgba(62, 39, 35, 0.2);
}

/* --- 訊息提示 --- */
.auth-message {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 0.9rem;
    text-align: center;
}

.auth-message.error {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ef9a9a;
}

.auth-message.success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

/* --- 分隔線 --- */
.auth-divider {
    display: flex;
    align-items: center;
    margin: 24px 0;
    color: #a69b8c;
    font-size: 0.85rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e0d6cc;
}

.auth-divider span {
    padding: 0 16px;
}

/* --- Google 按鈕容器 --- */
.google-btn-wrapper {
    display: flex;
    justify-content: center;
}

.google-btn-wrapper > div {
    width: 100% !important;
}

/* --- 底部連結 --- */
.auth-footer-links {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e0d6cc;
    text-align: center;
}

.auth-footer-links a {
    color: #8d6e63;
    font-size: 0.9rem;
    text-decoration: none;
    transition: color 0.2s;
}

.auth-footer-links a:hover {
    color: #5d4037;
    text-decoration: underline;
}

/* --- 手機版響應式 --- */
@media (max-width: 480px) {
    .auth-page-wrapper {
        padding: 80px 16px 40px;
    }

    .auth-shrine-container {
        padding: 50px 20px 24px;
        border-radius: 16px;
    }

    .auth-greeter img {
        width: 60px;
        height: 60px;
    }

    .auth-greeter {
        top: -35px;
    }

    .greeter-speech {
        display: none;
    }

    .auth-tab-shrine {
        padding: 12px 16px;
        font-size: 0.95rem;
    }

    .form-group-shrine input,
    .form-group-shrine select {
        padding: 12px 14px;
    }

    .btn-shrine-primary {
        padding: 14px 20px;
    }
}
