/* register.css - 專為繁體中文優化的註冊頁面 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Heiti TC", "Microsoft JhengHei", "PingFang HK", 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #a97307 0%, #e2eb5f 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #333;
    line-height: 1.8; /* 中文閱讀更舒適 */
}

.register-container {
    background: white;
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 420px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.register-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.25);
}

h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: #2c3e50;
    font-weight: 600;
    font-size: 1.8rem;
    letter-spacing: 0.05em; /* 中文標題微調字距 */
}

.message {
    padding: 0.85rem;
    margin-bottom: 1.2rem;
    border-radius: 8px;
    font-size: 0.95rem;
    text-align: center;
    border: 1px solid transparent;
    animation: fadeIn 0.5s ease;
    line-height: 1.5;
}

/* 成功訊息（包含連結） */
.message:has(a) {
    background-color: #e6ffed;
    color: #2f855a;
    border-color: #c6f6d5;
}

/* 錯誤訊息（不含連結） */
.message:not(:has(a)) {
    background-color: #fdf2f2;
    color: #c53030;
    border-color: #fecaca;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem; /* 增加表單元素間距，提升中文可讀性 */
}

label {
    font-weight: 500;
    margin-bottom: 0.3rem;
    color: #2d3748;
    font-size: 1rem; /* 稍微放大中文標籤 */
    width: 100%;
    max-width: 350px;
    text-align: left;
    letter-spacing: 0.02em;
}

input[type="text"],
input[type="email"],
input[type="password"] {
    width: 100%;
    padding: 0.9rem;
    margin-top: 0.4rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit; /* 繼承中文字型 */
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background-color: #fafafa;
    letter-spacing: 0.03em;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.2);
}

button {
    background: linear-gradient(to right, #4f46e5, #3b82f6);
    color: white;
    border: none;
    padding: 0.9rem;
    font-size: 1.05rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1.2rem;
    width: 100%;
    max-width: 350px;
    letter-spacing: 0.05em;
}

button:hover {
    background: linear-gradient(to right, #4338ca, #2563eb);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(245, 87, 108, 0.3);
}

button:active {
    transform: translateY(0);
}

.login-link {
    text-align: center;
    margin-top: 1.3rem;
    font-size: 0.95rem;
    color: #4a5568;
    width: 100%;
    max-width: 350px;
    line-height: 1.6;
}

.login-link a {
    color: #f5576c;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s ease;
}

.login-link a:hover {
    color: #d2364c;
    text-decoration: underline;
}

/* 返回首頁連結 */
.back-home-link {
    display: inline-block;
    margin-bottom: 1rem;
    color: #555;
    font-size: 0.95rem;
    text-decoration: none;
    transition: color 0.3s ease;
    font-weight: 500;
}

.back-home-link:hover {
    color: #a855f7;
    text-decoration: underline;
}

/* === 響應式調整 === */

@media (max-width: 480px) {
    .register-container {
        margin: 1rem;
        padding: 2rem;
        width: 90%;
    }

    h2 {
        font-size: 1.6rem;
    }

    label,
    input,
    button,
    .login-link {
        max-width: 100%; /* 小螢幕全寬 */
        font-size: 1rem;
    }

    .message {
        font-size: 0.9rem;
        padding: 0.75rem;
    }
}

/* 超小螢幕（如 iPhone SE） */
@media (max-width: 380px) {
    .register-container {
        padding: 1.8rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    button {
        padding: 0.8rem;
        font-size: 1rem;
    }
}

select {
    width: 100%;
    max-width: 350px;
    padding: 0.85rem;
    margin-top: 0.4rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    background-color: #fafafa;
    color: #2d3748;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

select:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.2);
}