/* Smart UI - 統一 30px 版（2026-09-18）
   TextBox / SmartTextBox / DropDownList / 單行按鈕統一高度 30px。
   TextArea、ListBox、GridView 保留多行或表格需要的自然高度。
   請將本檔放在 smarttextbox-theme.css、site.css 之後載入。
   移除 ASPX 控制項的 Height 屬性，避免 inline style 覆蓋本 CSS。
   僅調整視覺樣式，不修改 DLL、輸入驗證及資料庫安全功能。 */

/* Shared colors/sizing. Explicit values instead of CSS custom properties for older-browser fallback. */
input.smartui-input,
input.smarttb-modern,
select.smartui-select,
textarea.smartui-textarea,
select.smartui-listbox {
    box-sizing: border-box;
    max-width: 100%;
    border: 1px solid #b9c7d9;
    border-radius: 8px;
    background: #ffffff;
    color: #182941;
    font: 14px/1.4 "Segoe UI", "Microsoft JhengHei", Arial, sans-serif;
    outline: none;
    vertical-align: middle;
    transition: border-color .15s ease, box-shadow .15s ease;
}

input.smartui-input,
input.smarttb-modern,
select.smartui-select {
    display: inline-block;
    width: 100%;
    min-width: 0;
    height: 30px;
    padding: 4px 9px;
}

/* Leave the native arrow so dropdown remains functional across browsers. */
select.smartui-select { padding-right: 24px; cursor: pointer; }
select.smartui-select option { color: #182941; }

textarea.smartui-textarea {
    display: block;
    width: 100%;
    min-height: 88px;
    padding: 9px 10px;
    resize: vertical;
}

/* ASP.NET ListBox renders as <select size="..." multiple> or a tall select. */
select.smartui-listbox {
    display: block;
    width: 100%;
    min-height: 100px;
    padding: 5px;
}
select.smartui-listbox option { padding: 5px 7px; border-radius: 4px; }

input.smartui-input:focus,
input.smarttb-modern:focus,
select.smartui-select:focus,
textarea.smartui-textarea:focus,
select.smartui-listbox:focus {
    border-color: #2f67e6;
    box-shadow: 0 0 0 3px rgba(47, 103, 230, .125);
}

input.smartui-input:disabled,
input.smarttb-modern:disabled,
select.smartui-select:disabled,
textarea.smartui-textarea:disabled,
select.smartui-listbox:disabled {
    background: #f1f5f9;
    border-color: #d7e0eb;
    color: #64748b;
    cursor: not-allowed;
    opacity: 1;
}
input.smartui-input[readonly],
input.smarttb-modern[readonly],
textarea.smartui-textarea[readonly] { background: #f8fafc; }
input.smartui-input::placeholder,
input.smarttb-modern::placeholder,
textarea.smartui-textarea::placeholder { color: #94a3b8; opacity: 1; }

/* Buttons: <asp:Button>, <asp:LinkButton> and standard HTML buttons. */
.smartui-btn,
.smartui-btn-secondary,
.smartui-btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    height: 30px;
    min-height: 30px;
    padding: 3px 12px;
    border: 1px solid transparent;
    border-radius: 8px;
    font: 600 13px/1.4 "Segoe UI", "Microsoft JhengHei", Arial, sans-serif;
    text-align: center;
    text-decoration: none;
    vertical-align: middle;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.smartui-btn { background: #2f67e6; color: #fff; border-color: #2f67e6; }
.smartui-btn:hover { background: #2457c7; border-color: #2457c7; color: #fff; }
.smartui-btn-secondary { background: #fff; color: #2f559c; border-color: #b9c7d9; }
.smartui-btn-secondary:hover { background: #eef4ff; border-color: #8fabde; color: #234986; }
.smartui-btn-danger { background: #fff; color: #b42318; border-color: #efb8b4; }
.smartui-btn-danger:hover { background: #fff2f0; }
.smartui-btn:focus-visible,
.smartui-btn-secondary:focus-visible,
.smartui-btn-danger:focus-visible { outline: 2px solid #2f67e6; outline-offset: 2px; }
.smartui-btn:disabled,
.smartui-btn-secondary:disabled,
.smartui-btn-danger:disabled { background: #e2e8f0; border-color: #e2e8f0; color: #64748b; cursor: not-allowed; }

/* 固定 30px，不需另外加高度類別。 */
input.smartui-input,
input.smarttb-modern,
select.smartui-select,
.smarttb-wrap > input.smarttb-modern {
    box-sizing: border-box;
    height: 30px;
    min-height: 30px;
    padding: 4px 9px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 20px;
}
select.smartui-select { padding-right: 24px; }

.smartui-btn, .smartui-btn-secondary, .smartui-btn-danger {
    box-sizing: border-box;
    height: 30px;
    min-height: 30px;
    padding: 3px 12px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 20px;
}

/* Password：30px 欄位內的眼睛圖示保持置中且不超出輸入框。 */
.smarttb-wrap > input.smarttb-modern ~ button.smarttb-eye {
    width: 28px;
    height: 28px;
    right: 3px;
}
.smarttb-wrap > input.smarttb-modern ~ button.smarttb-eye svg {
    width: 17px;
    height: 17px;
}
/* DLL 原有 Password 使用 !important，需以更明確選取器覆寫。 */
.smarttb-wrap > input.smarttb-modern[data-smart-type="Password"] {
    padding-right: 34px !important;
}

/* Checkbox/Radio: CssClass on ASP.NET controls can be rendered on a wrapping <span>.
   Both wrapper and input-selector forms are covered. */
.smartui-check,
.smartui-radio { display: inline-flex; align-items: center; gap: 6px; font: 14px/1.5 "Segoe UI", "Microsoft JhengHei", Arial, sans-serif; color: #24364f; vertical-align: middle; }
.smartui-check input[type="checkbox"], input.smartui-check[type="checkbox"],
.smartui-radio input[type="radio"], input.smartui-radio[type="radio"],
.smartui-options input[type="checkbox"], .smartui-options input[type="radio"] {
    width: 15px; height: 15px; margin: 0 4px 0 0; vertical-align: -2px;
    accent-color: #2f67e6; cursor: pointer;
}
.smartui-check label, .smartui-radio label, .smartui-options label { cursor: pointer; }
.smartui-options { display: block; color: #24364f; font: 14px/1.85 "Segoe UI", "Microsoft JhengHei", Arial, sans-serif; }
.smartui-options input { margin-right: 5px; }

/* Labels and validation. ASP validators/ValidationSummary render spans and divs. */
.smartui-label { display: block; margin-bottom: 6px; color: #24364f; font: 600 13px/1.5 "Segoe UI", "Microsoft JhengHei", Arial, sans-serif; }
.smartui-hint { display: block; margin-top: 5px; color: #6b7b92; font: 12px/1.55 "Segoe UI", "Microsoft JhengHei", Arial, sans-serif; }
.smartui-error { color: #b42318; font-size: 12px; line-height: 1.5; }
.smartui-summary { padding: 10px 12px; border: 1px solid #f4c7c3; border-radius: 8px; background: #fff5f4; color: #b42318; font-size: 13px; }
.smartui-summary:empty { display: none; }
.smartui-field { min-width: 0; max-width: 360px; margin-bottom: 14px; }
.smartui-field > .smarttb-wrap { display: block; width: 100%; }

/* GridView: apply CssClass="smartui-grid" to the GridView itself. */
table.smartui-grid { width: 100%; border: 1px solid #dce5f0; border-collapse: separate; border-spacing: 0; border-radius: 9px; overflow: hidden; color: #24364f; font: 13px/1.5 "Segoe UI", "Microsoft JhengHei", Arial, sans-serif; }
table.smartui-grid th { padding: 9px 12px; text-align: left; background: #eff4fc; color: #2d456a; border-bottom: 1px solid #dce5f0; font-weight: 700; }
table.smartui-grid td { padding: 9px 12px; border-bottom: 1px solid #e9eef5; }
table.smartui-grid tr:last-child td { border-bottom: 0; }
table.smartui-grid tr:hover td { background: #f7faff; }

/* FileUpload, useful but the browser may customize the system file picker. */
input.smartui-file[type="file"] { box-sizing: border-box; max-width: 100%; color: #24364f; font: 13px "Segoe UI", "Microsoft JhengHei", Arial, sans-serif; }
input.smartui-file[type="file"]::file-selector-button { min-height: 30px; margin-right: 10px; padding: 5px 12px; border: 1px solid #b9c7d9; border-radius: 7px; background: #f3f7ff; color: #2e5599; cursor: pointer; }

/* Reduced-motion preference. */
@media (prefers-reduced-motion: reduce) {
    input.smartui-input, input.smarttb-modern, select.smartui-select,
    textarea.smartui-textarea, select.smartui-listbox,
    .smartui-btn, .smartui-btn-secondary, .smartui-btn-danger { transition: none; }
}
