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

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

html {
    overflow-x: hidden;
}

h1 {
    text-align: center;
    font-size: 30px;
    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 {
    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-page .reg-container {
    border-color: #bbdefb;
    box-shadow: 0 8px 20px rgba(21, 101, 192, 0.1);
}

.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;
}

.form-group {
    margin-bottom: 14px;
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    column-gap: 10px;
    row-gap: 4px;
    align-items: start;
}

label {
    grid-column: 1;
    color: #3b4b5d;
    font-size: 18px;
    font-weight: 600;
    padding-top: 10px;
    line-height: 1.3;
    word-break: break-word;
}

.reg-container input[type="text"],
.reg-container input[type="email"],
.reg-container input[type="password"],
.reg-container input[type="tel"],
.reg-container input[type="date"],
.reg-container select {
    grid-column: 2;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid #c8d2df;
    border-radius: 8px;
    font-size: 15px;
    color: #1f2937;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    font-family: 'Microsoft JhengHei', Arial, sans-serif;
    background: #ffffff;
}

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

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

/* 標題（label）前的彩色圖示 */
.reg-page label {
    display: flex;
    align-items: center;
    gap: 7px;
}

.reg-page .label-icon {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    color: var(--ic, #1f5fae);
    background: color-mix(in srgb, var(--ic, #1f5fae) 12%, #ffffff);
    transition: transform 0.18s ease;
}

.reg-page .label-icon svg {
    width: 17px;
    height: 17px;
}

/* 讓 label 有足夠空間容納圖示 + 文字 */
.reg-page .form-group {
    grid-template-columns: 150px minmax(0, 1fr);
}

.reg-page .form-group:focus-within .label-icon {
    transform: scale(1.1);
}

.field-hint {
    grid-column: 2;
    margin: 0;
    color: #6b7280;
    font-size: 13px;
    line-height: 1.4;
    word-break: break-word;
}

.form-group > .field-hint {
    grid-column: 2;
}

select {
    cursor: pointer;
}

.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);
}

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

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

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

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

.label-spacer {
    display: inline-block;
    width: 120px;
    margin-right: 8px;
    flex-shrink: 0;
}

.form-message {
    margin-bottom: 20px;
    padding: 14px 16px;
    border-radius: 8px;
    color: #0b6f39;
    background: #eefcf4;
    border: 1px solid #b4ebc7;
}

.validation-summary-errors {
    margin-bottom: 20px;
    padding: 14px 16px;
    border-radius: 8px;
    background: #fff2f4;
    border: 1px solid #ffc8d1;
    color: #c62828;
    font-size: 14px;
}

.validation-summary-errors ul {
    margin: 0;
    padding-left: 20px;
}

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

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

.page-footer-link {
    margin-top: 18px;
    text-align: center;
    font-size: 17px;
    color: #6b7280;
}

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

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

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

@media (max-width: 768px) {
    h1 {
        font-size: 26px;
        margin-bottom: 26px;
    }

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

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

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

    label {
        font-size: 14px;
        padding-top: 11px;
    }

    .field-hint {
        font-size: 12px;
    }

    .label-spacer {
        width: 84px;
    }

    .reg-container input[type="text"],
    .reg-container input[type="email"],
    .reg-container input[type="password"],
    .reg-container input[type="tel"],
    .reg-container input[type="date"],
    .reg-container select {
        min-height: 42px;
        font-size: 14px;
        padding: 9px 10px;
    }

    .reg-page .form-group {
        grid-template-columns: 108px minmax(0, 1fr);
    }

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

    .reg-page .label-icon {
        width: 24px;
        height: 24px;
        border-radius: 7px;
    }

    .reg-page .label-icon svg {
        width: 15px;
        height: 15px;
    }

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

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