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

html {
    overflow-x: hidden;
}

body {
    font-family: 'Microsoft JhengHei', Arial, sans-serif;
    background: #f5f7fa;
    min-height: 100vh;
    margin: 0;
    color: #243447;
    overflow-x: hidden;
}

h1 {
    text-align: center;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 0.04em;
    margin-bottom: 30px;
}

/* ----- 頁面／容器 ----- */
.reg-page {
    min-height: 100vh;
    background: linear-gradient(180deg, #eef4fc 0%, #e3edf8 100%);
    padding: 28px 16px 32px;
    overflow-x: hidden;
    max-width: 100%;
}

.reg-page h1 {
    color: #1565c0;
    --title-ic: #1565c0;
}

.reg-page .page-title-text {
    background: linear-gradient(135deg, #1565c0 0%, #3b82f6 55%, #6366f1 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: #1565c0;
}

.reg-container {
    max-width: 700px;
    width: 100%;
    margin: 0 auto;
    padding: 28px 26px;
    background: #ffffff;
    border: 1px solid #dce3ec;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.07);
    overflow-x: hidden;
}

.reg-page .reg-container {
    border-color: #bbdefb;
    box-shadow: 0 8px 20px rgba(21, 101, 192, 0.1);
}

/* ----- 表單列 ----- */
.form-group {
    margin-bottom: 14px;
    display: grid;
    grid-template-columns: 132px minmax(0, 1fr);
    column-gap: 8px;
    row-gap: 4px;
    align-items: start;
}

label {
    grid-column: 1;
    color: #0b44c0;
    font-size: 22px;
    font-weight: 400;
    padding-top: 10px;
    line-height: 1.3;
    word-break: keep-all;
}

.reg-page label {
    display: flex;
    align-items: center;
    gap: 7px;
}

/* ----- 輸入／下拉／多行 ----- */
.reg-container input[type="text"],
.reg-container input[type="password"],
.reg-container input[type="tel"],
.reg-container select,
.reg-container textarea {
    grid-column: 2;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 36px;
    padding: 0 12px;
    border: 1px solid #c8d2df;
    border-radius: 8px;
    font-size: 22px;
    line-height: 1.25;
    color: #0b44c0;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    font-family: 'Microsoft JhengHei', Arial, sans-serif;
    background: #ffffff;
}

.reg-container textarea {
    height: 36px;
    padding: 3px 0 0 5px;
    resize: vertical;
    overflow-y: auto;
}

.reg-container input:focus,
.reg-container select:focus,
.reg-container textarea:focus {
    outline: none;
    border-color: #2f6fb7;
    box-shadow: 0 0 0 3px rgba(47, 111, 183, 0.16);
}

.reg-page .reg-container input:focus,
.reg-page .reg-container select:focus,
.reg-page .reg-container textarea:focus {
    border-color: #1f5fae;
    box-shadow: 0 0 0 3px rgba(31, 95, 174, 0.16);
}

input[readonly] {
    background: #f3f4f6;
    color: #6b7280;
    cursor: not-allowed;
}

select {
    cursor: pointer;
}

.input-with-hint {
    display: contents;
}

.input-with-hint input,
.input-with-hint select {
    grid-column: 2;
}

/* ----- 生日三欄 ----- */
.birthdate-selects {
    grid-column: 2;
    display: grid;
    grid-template-columns: minmax(4.5rem, 1.4fr) minmax(3rem, 1fr) minmax(3rem, 1fr);
    gap: 8px;
    min-width: 0;
    width: 100%;
    align-items: center;
}

.reg-container .birthdate-selects > select {
    grid-column: auto;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 0 0 0 2px;
    margin: 0;
    font-size: 21px;
}

/* ----- 欄位提示 ----- */
.field-hint {
    grid-column: 2;
    margin: 0;
    color: #6b7280;
    font-size: 18px;
    line-height: 1.4;
    word-break: break-word;
}

.field-hint.field-hint-focus {
    display: none;
    grid-column: 1 / -1;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin-top: 4px;
    padding: 6px 10px;
    border: 1px solid #fecaca;
    border-radius: 6px;
    background: #fff1f2;
    color: #dc2626;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
}

.form-group:focus-within > .field-hint.field-hint-focus {
    display: block;
}

/* ----- 送出鈕 ----- */
.reg-container button[type="submit"] {
    min-width: 130px;
    min-height: 44px;
    padding: 0 18px;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0.02em;
    font-family: 'Microsoft JhengHei', Arial, sans-serif;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: filter 0.18s ease;
}

.reg-page .reg-container button[type="submit"] {
    background: linear-gradient(135deg, #1565c0 0%, #1e88e5 100%);
}

.reg-page .reg-container button[type="submit"]:hover {
    filter: brightness(1.04);
}

.reg-page .reg-container button[type="submit"]:active {
    filter: brightness(0.98);
}

.form-submit {
    display: block;
    margin-top: 10px;
    margin-bottom: 2px;
    text-align: right;
}

/* ----- 頁尾連結 ----- */
.page-footer-link {
    margin-top: 18px;
    text-align: center;
    font-size: 18px;
    color: #6b7280;
}

.page-footer-link a {
    color: #1f5fae;
    font-size: 18px;
    font-weight: 600;
    text-decoration: none;
}

.page-footer-link a:hover {
    text-decoration: underline;
}

.reg-page .page-footer-link a {
    color: #1565c0;
}

.reg-page .page-footer-link a:hover {
    color: #0d47a1;
}

.page-footer-home {
    margin-top: 20px;
}

/* ----- 會員表單分區（註冊／修改共用） ----- */
.profile-block {
    margin-bottom: 16px;
    padding: 16px 16px 6px;
    border: 1px solid transparent;
    border-radius: 12px;
}

.profile-form .form-group:not(.form-submit) {
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: 4px;
    row-gap: 4px;
    align-items: center;
}

.profile-form .form-group:not(.form-submit) > label {
    grid-column: 1;
    padding-top: 0;
    font-size: 22px;
    font-weight: 400;
    word-break: keep-all;
    white-space: nowrap;
    color: #0b44c0;
}

.profile-form .form-group:not(.form-submit) > input,
.profile-form .form-group:not(.form-submit) > select,
.profile-form .form-group:not(.form-submit) > textarea,
.profile-form .form-group:not(.form-submit) > .field-hint,
.profile-form .form-group:not(.form-submit) > .birthdate-selects,
.profile-form .input-with-hint input,
.profile-form .input-with-hint select,
.profile-form .input-with-hint .field-hint {
    grid-column: 2;
    width: 100%;
}

.profile-form .form-group:not(.form-submit) > input,
.profile-form .form-group:not(.form-submit) > select,
.profile-form .input-with-hint input,
.profile-form .input-with-hint select {
    font-size: 22px;
    padding: 0 12px;
    min-height: 38px;
    color: #111827;
}

.profile-form .form-group:not(.form-submit) > textarea {
    font-size: 22px;
    color: #111827;
    padding: 3px 0 0 5px;
    min-height: 38px;
    height: 38px;
}

.profile-form .form-group:not(.form-submit) > .field-hint.field-hint-focus {
    grid-column: 1 / -1;
}

.profile-form .form-submit {
    display: block;
    grid-template-columns: 1fr;
    margin-top: 8px;
    text-align: center;
}

.profile-form .form-submit button {
    width: 100%;
    font-size: 18px;
}

.reg-page .profile-block-basic {
    background: #eef4fc;
    border-color: #bbdefb;
}

.reg-page .profile-block-account {
    background: #eef2f7;
    border-color: #d5dde8;
}

.reg-page .profile-block-address {
    background: #fff4ed;
    border-color: #fdd6c0;
}

.reg-page .profile-block-password {
    background: #fef2f2;
    border-color: #fecaca;
}

/* ----- 手機版 ----- */
@media (max-width: 768px) {
    h1 {
        margin-bottom: 26px;
    }

    .reg-page {
        padding: 10px 10px 24px;
    }

    .reg-container {
        padding: 18px 12px;
    }

    .form-group {
        grid-template-columns: 108px minmax(0, 1fr);
        column-gap: 6px;
        margin-bottom: 16px;
    }

    label {
        padding-top: 11px;
    }

    .reg-page label {
        gap: 5px;
    }

    .reg-container input[type="text"],
    .reg-container input[type="password"],
    .reg-container input[type="tel"],
    .reg-container select {
        min-height: 34px;
        padding: 0 10px;
    }

    .reg-container textarea {
        min-height: 34px;
        height: 34px;
    }

    .reg-container button[type="submit"] {
        width: 100%;
    }

    .form-submit {
        text-align: center;
    }

    .profile-form .form-group:not(.form-submit) > input,
    .profile-form .form-group:not(.form-submit) > select,
    .profile-form .input-with-hint input,
    .profile-form .input-with-hint select {
        padding: 0 10px;
        min-height: 36px;
    }

    .profile-form .form-group:not(.form-submit) > textarea {
        min-height: 36px;
        height: 36px;
    }
}
