/**
 * YS PayUni Agent 前端樣式
 */

/* 表單容器 */
.ys-payuni-apply-form-wrap,
.ys-payuni-status-wrap {
	max-width: 720px;
	margin: 0 auto;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* === 入口頁（開始申請） === */
.ys-payuni-landing {
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 12px;
	padding: 48px 30px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
	text-align: center;
}

.ys-payuni-landing-icon {
	color: #0073aa;
	margin-bottom: 16px;
}

.ys-payuni-landing-title {
	margin: 0 0 8px;
	font-size: 1.5em;
	color: #23282d;
}

.ys-payuni-landing-desc {
	margin: 0 0 28px;
	color: #666;
	font-size: 15px;
}

.ys-payuni-start-btn {
	display: inline-block;
	padding: 14px 48px;
	background: #0073aa;
	color: #fff;
	border: none;
	border-radius: 6px;
	font-size: 17px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.2s, transform 0.1s;
}

.ys-payuni-start-btn:hover {
	background: #005a87;
	transform: translateY(-1px);
}

.ys-payuni-start-btn:active {
	transform: translateY(0);
}

.ys-payuni-landing-notice {
	margin-top: 24px;
	padding: 16px 20px;
	background: #f8f9fa;
	border: 1px solid #e9ecef;
	border-radius: 8px;
	text-align: left;
	color: #555;
	font-size: 13px;
	line-height: 1.7;
}

.ys-payuni-landing-notice p {
	margin: 0 0 6px;
}

.ys-payuni-landing-notice p:last-child {
	margin-bottom: 0;
}

.ys-payuni-form {
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	padding: 30px;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.ys-payuni-form-title {
	margin: 0 0 24px;
	padding-bottom: 12px;
	border-bottom: 2px solid #0073aa;
	color: #23282d;
	font-size: 1.4em;
}

/* 區段 */
.ys-payuni-form-section {
	margin-bottom: 24px;
	padding-bottom: 16px;
	border-bottom: 1px solid #f0f0f0;
}

.ys-payuni-form-section:last-of-type {
	border-bottom: none;
}

.ys-payuni-form-section h4 {
	margin: 0 0 12px;
	color: #0073aa;
	font-size: 1.05em;
}

/* 欄位 */
.ys-payuni-field {
	margin-bottom: 16px;
}

.ys-payuni-field label {
	display: block;
	margin-bottom: 4px;
	font-weight: 500;
	color: #333;
}

.ys-payuni-field input[type="text"],
.ys-payuni-field input[type="email"],
.ys-payuni-field input[type="url"],
.ys-payuni-field input[type="tel"],
.ys-payuni-field textarea,
.ys-payuni-field select {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid #ccc;
	border-radius: 4px;
	font-size: 14px;
	transition: border-color 0.2s;
	box-sizing: border-box;
}

.ys-payuni-field input:focus,
.ys-payuni-field textarea:focus,
.ys-payuni-field select:focus {
	border-color: #0073aa;
	outline: none;
	box-shadow: 0 0 0 1px #0073aa;
}

.ys-payuni-field .required {
	color: #dc3232;
}

.ys-payuni-hint {
	display: block;
	margin-top: 4px;
	color: #888;
	font-size: 12px;
}

/* 欄位佈局 */
.ys-payuni-row {
	display: flex;
	gap: 16px;
	flex-wrap: wrap;
}

.ys-payuni-col-6 {
	flex: 1;
	min-width: 200px;
}

/* 會員類型按鈕 */
.ys-payuni-member-type-toggle {
	display: flex;
	gap: 12px;
}

.ys-payuni-toggle-btn {
	flex: 1;
	display: flex;
	flex-direction: row;
	align-items: center;
	justify-content: center;
	gap: 10px;
	padding: 16px 20px !important;
	margin: 0 !important;
	border: 2px solid #ddd;
	border-radius: 8px;
	cursor: pointer;
	transition: all 0.2s ease;
	background: #fafafa;
	box-sizing: border-box;
	min-height: 56px;
}

.ys-payuni-toggle-btn:hover {
	border-color: #0073aa;
	background: #f0f7fc;
}

.ys-payuni-toggle-btn.active {
	border-color: #0073aa;
	background: #eaf4fc;
	box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

.ys-payuni-toggle-btn input[type="radio"] {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
}

.ys-payuni-toggle-icon {
	width: 22px;
	height: 22px;
	flex-shrink: 0;
	color: #666;
}

.ys-payuni-toggle-btn.active .ys-payuni-toggle-icon {
	color: #0073aa;
}

.ys-payuni-toggle-label {
	font-size: 15px;
	font-weight: 600;
	color: #333;
}

.ys-payuni-toggle-btn.active .ys-payuni-toggle-label {
	color: #0073aa;
}

/* 地址 */
.ys-payuni-address-row {
	display: flex;
	gap: 8px;
	align-items: center;
}

.ys-payuni-address-row select {
	flex: 1;
}

.ys-payuni-postcode {
	width: 80px !important;
	flex: 0 0 80px;
	text-align: center;
	background-color: #f9f9f9;
}

/* 按鈕 */
.ys-payuni-form-actions {
	text-align: center;
	margin-top: 20px;
}

.ys-payuni-submit-btn {
	display: inline-block;
	padding: 12px 40px;
	background-color: #0073aa;
	color: #fff;
	border: none;
	border-radius: 4px;
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
	transition: background-color 0.2s;
}

.ys-payuni-submit-btn:hover {
	background-color: #005a87;
}

.ys-payuni-submit-btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

/* 訊息 */
.ys-payuni-message {
	margin-top: 16px;
	padding: 12px 16px;
	border-radius: 4px;
	font-size: 14px;
}

.ys-payuni-msg-success {
	background-color: #ecf9ec;
	color: #1d7324;
	border: 1px solid #c6e6c6;
}

.ys-payuni-msg-error {
	background-color: #fef0f0;
	color: #c00;
	border: 1px solid #f5c6c6;
}

/* 查詢結果 */
.ys-payuni-result {
	margin-top: 20px;
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	padding: 20px;
}

.ys-payuni-result h4 {
	margin: 0 0 12px;
	color: #23282d;
}

.ys-payuni-result-table {
	width: 100%;
	border-collapse: collapse;
}

.ys-payuni-result-table th,
.ys-payuni-result-table td {
	padding: 10px 12px;
	text-align: left;
	border-bottom: 1px solid #eee;
}

.ys-payuni-result-table th {
	background-color: #f8f8f8;
	font-weight: 600;
}

/* 狀態顏色 */
.ys-status-1 { color: #46b450; font-weight: bold; }
.ys-status-9,
.ys-status-91 { color: #ffb900; }
.ys-status-2,
.ys-status-8,
.ys-status-92,
.ys-status-99 { color: #dc3232; }
.ys-status-0 { color: #888; }

/* === 條款彈窗 === */
.ys-payuni-terms-link {
	color: #0073aa;
	text-decoration: underline;
	cursor: pointer;
}

.ys-payuni-modal {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
}

.ys-payuni-modal-overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.5);
}

.ys-payuni-modal-content {
	position: relative;
	background: #fff;
	border-radius: 12px;
	width: 90%;
	max-width: 600px;
	max-height: 80vh;
	display: flex;
	flex-direction: column;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.ys-payuni-modal-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 16px 24px;
	border-bottom: 1px solid #eee;
}

.ys-payuni-modal-header h3 {
	margin: 0;
	font-size: 1.1em;
	color: #23282d;
}

.ys-payuni-modal-close {
	background: none;
	border: none;
	font-size: 24px;
	color: #999;
	cursor: pointer;
	padding: 0 4px;
	line-height: 1;
}

.ys-payuni-modal-close:hover {
	color: #333;
}

.ys-payuni-modal-body {
	padding: 20px 24px;
	overflow-y: auto;
	flex: 1;
	font-size: 14px;
	line-height: 1.7;
	color: #444;
}

.ys-payuni-modal-body p {
	margin: 0 0 12px;
}

.ys-payuni-modal-footer {
	padding: 12px 24px;
	border-top: 1px solid #eee;
	text-align: right;
}

.ys-payuni-modal-close-btn {
	padding: 8px 24px;
	background: #0073aa;
	color: #fff;
	border: none;
	border-radius: 4px;
	cursor: pointer;
	font-size: 14px;
}

.ys-payuni-modal-close-btn:hover {
	background: #005a87;
}

/* Radio 按鈕樣式 */
.ys-payuni-field label input[type="radio"],
.ys-payuni-field label input[type="checkbox"] {
	margin-right: 6px;
	width: auto;
}

.ys-payuni-field label + label {
	margin-left: 20px;
}

/* === 金流利率表格 === */
.ys-payuni-fee-table-wrap {
	max-width: 720px;
	margin: 0 auto;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.ys-payuni-fee-title {
	text-align: center;
	font-size: 1.5em;
	color: #23282d;
	margin-bottom: 24px;
	padding-bottom: 12px;
	border-bottom: 2px solid #0073aa;
}

.ys-payuni-fee-section {
	margin-bottom: 24px;
}

.ys-payuni-fee-section-title {
	font-size: 1.1em;
	color: #333;
	margin: 0 0 12px;
	padding: 8px 12px;
	background: #f8f9fa;
	border-radius: 6px;
}

.ys-payuni-fee-grid {
	width: 100%;
	border-collapse: collapse;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	overflow: hidden;
}

.ys-payuni-fee-grid thead th {
	background: #f0f4f8;
	padding: 12px 16px;
	text-align: left;
	font-weight: 600;
	color: #333;
	font-size: 13px;
	border-bottom: 2px solid #ddd;
}

.ys-payuni-fee-grid tbody td {
	padding: 12px 16px;
	border-bottom: 1px solid #eee;
	font-size: 14px;
}

.ys-payuni-fee-grid tbody tr:last-child td {
	border-bottom: none;
}

.ys-payuni-fee-grid tbody tr:hover {
	background: #f9fbfd;
}

.ys-fee-rate {
	font-weight: 600;
	color: #0073aa;
}

.ys-fee-disabled {
	opacity: 0.45;
}

.ys-fee-badge {
	display: inline-block;
	padding: 3px 10px;
	border-radius: 12px;
	font-size: 12px;
	font-weight: 600;
}

.ys-fee-open {
	background: #e8f5e9;
	color: #2e7d32;
}

.ys-fee-closed {
	background: #f5f5f5;
	color: #999;
}

.ys-payuni-fee-note {
	text-align: center;
	color: #888;
	font-size: 12px;
	margin-top: 16px;
}

/* 響應式 */
@media (max-width: 600px) {
	.ys-payuni-form {
		padding: 16px;
	}

	.ys-payuni-row {
		flex-direction: column;
		gap: 0;
	}

	.ys-payuni-address-row {
		flex-wrap: wrap;
	}

	.ys-payuni-address-row select {
		min-width: 45%;
	}
}
