/**
 * 采购公告弹窗样式
 * Modal Styles for Procurement Forms
 *
 * @package nyocor-procurement
 */

/* 弹窗基础样式 */
.nyocor-proc-modal {
	--u: calc(100vw / 1920); /* 弹窗随画布等比：50% 缩放时与页面其他元素保持同一物理比例 */
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 9999;
}

.nyocor-proc-modal.nyocor-proc-modal-active {
	display: flex;
	align-items: center;
	justify-content: center;
}

/* 背景遮罩 */
.nyocor-proc-modal-overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.6);
	-webkit-backdrop-filter: blur(2px); /* Safari（含 Mac Safari）需要前缀 */
	backdrop-filter: blur(2px);
	z-index: 1;
}

/* 弹窗内容容器 */
.nyocor-proc-modal-content {
	position: relative;
	background: #ffffff;
	width: 90%;
	max-width: max(340px, calc(600 * var(--u)));
	max-height: 90vh;
	overflow-y: auto;
	overscroll-behavior: contain; /* 内容滚到头不再把滚动传导给遮罩下的页面（2026-09） */
	border-radius: 12px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
	z-index: 2;
	animation: nyocorProcModalSlide 0.3s ease-out;
}

@keyframes nyocorProcModalSlide {
	from {
		opacity: 0;
		transform: translateY(-50px) scale(0.95);
	}
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

/* 登录弹窗样式 */
.nyocor-proc-modal-login .nyocor-proc-modal-content {
	max-width: max(300px, calc(450 * var(--u)));
}

/* 关闭按钮 */
.nyocor-proc-modal-close {
	position: absolute;
	top: max(10px, calc(15 * var(--u)));
	right: max(10px, calc(15 * var(--u)));
	background: transparent;
	border: none;
	font-size: max(20px, calc(28 * var(--u)));
	line-height: 1;
	color: #999;
	cursor: pointer;
	width: max(28px, calc(32 * var(--u)));
	height: max(28px, calc(32 * var(--u)));
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	transition: all 0.2s ease;
	z-index: 10;
}

.nyocor-proc-modal-close:hover {
	background: #f0f0f0;
	color: #333;
}

.nyocor-proc-modal-body h2 {
	margin: 0 0 max(12px, calc(20 * var(--u))) 0;
	font-size: max(16px, calc(24 * var(--u)));
	color: #333;
	text-align: center;
	border-bottom: 2px solid #f0f0f0;
	padding-bottom: max(10px, calc(15 * var(--u)));
}

.nyocor-proc-modal-body > p {
	text-align: center;
	color: #666;
	margin-bottom: 25px;
}

/* 登录表单样式 */
.nyocor-proc-login-form .nyocor-proc-field {
	margin-bottom: 20px;
}

.nyocor-proc-login-form label {
	display: block;
	margin-bottom: 8px;
	font-weight: 500;
	color: #333;
}

.nyocor-proc-login-form input[type="text"],
.nyocor-proc-login-form input[type="password"] {
	width: 100%;
	padding: max(10px, calc(12 * var(--u))) max(12px, calc(15 * var(--u)));
	border: 1px solid #ddd;
	border-radius: 6px;
	font-size: max(13px, calc(15 * var(--u)));
	transition: border-color 0.2s ease;
	box-sizing: border-box;
}

.nyocor-proc-login-form input:focus {
	outline: none;
	border-color: #4a90e2;
	box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.nyocor-proc-login-form input[type="checkbox"] {
	margin-right: 8px;
}

/* 「记住我」label：用模板输出的 is-checkbox 类判定（替代 :has(input)，
   兼容不支持 :has 的旧内核浏览器） */
.nyocor-proc-login-form label.is-checkbox {
	display: flex;
	align-items: center;
	font-weight: 400;
	font-size: 14px;
}

/* 按钮样式 */
.nyocor-proc-btn {
	width: 100%;
	padding: max(12px, calc(14 * var(--u)));
	border: none;
	border-radius: 6px;
	font-size: max(13px, calc(16 * var(--u)));
	font-weight: 500;
	cursor: pointer;
	transition: all 0.2s ease;
}

.nyocor-proc-btn-primary {
	background: #4a90e2;
	color: #ffffff;
}

.nyocor-proc-btn-primary:hover {
	background: #357abd;
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

.nyocor-proc-btn-primary:active {
	transform: translateY(0);
}

/* 消息提示 */
.nyocor-proc-message {
	margin-top: 20px;
	padding: 12px 15px;
	border-radius: 6px;
	font-size: 14px;
	display: none;
}

.nyocor-proc-message.nyocor-proc-message-error {
	background: #fee;
	border: 1px solid #fcc;
	color: #c33;
	display: block;
}

.nyocor-proc-message.nyocor-proc-message-success {
	background: #efe;
	border: 1px solid #cfc;
	color: #363;
	display: block;
}

/* ---------- 报名成功态：居中仪式感（对勾描边动画 + 主文案 + 倒计时进度条） ---------- */
.nyocor-proc-success {
	padding: 28px 24px 30px;
	text-align: center;
	animation: nyocorProcSuccessIn 0.35s ease-out;
}

@keyframes nyocorProcSuccessIn {
	from { opacity: 0; transform: translateY(10px) scale(0.97); }
	to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* 对勾 SVG：圆环描边生长 + 对勾笔画绘出（stroke-dasharray 动画） */
.nyocor-proc-success__icon {
	display: inline-block;
	margin-bottom: 14px;
}

.nyocor-proc-success__circle {
	stroke: #2A6BB5;
	stroke-width: 2.5;
	stroke-linecap: round;
	stroke-dasharray: 151; /* 周长 2πr ≈ 150.8 */
	stroke-dashoffset: 151;
	animation: nyocorProcSuccessRing 0.55s ease-out forwards;
}

.nyocor-proc-success__check {
	stroke: #2A6BB5;
	stroke-width: 3.5;
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-dasharray: 36; /* 笔画长约 35 */
	stroke-dashoffset: 36;
	animation: nyocorProcSuccessRing 0.35s ease-out 0.5s forwards;
}

@keyframes nyocorProcSuccessRing {
	to { stroke-dashoffset: 0; }
}

.nyocor-proc-success__title {
	margin: 0 0 6px;
	font-size: max(16px, calc(19 * var(--u)));
	font-weight: 600;
	color: #2A6BB5;
}

.nyocor-proc-success__sub {
	margin: 0 0 max(14px, calc(20 * var(--u)));
	font-size: max(11px, calc(13 * var(--u)));
	color: #9aa7b4;
}

/* 倒计时进度条：2.6s 匀速收缩（与 JS 自动关闭延时一致） */
.nyocor-proc-success__bar {
	display: block;
	width: calc(140 * var(--u));
	height: 3px;
	margin: 0 auto;
	border-radius: 2px;
	background: #2A6BB5;
	transform-origin: center;
	animation: nyocorProcSuccessBar 2.6s linear forwards;
}

@keyframes nyocorProcSuccessBar {
	from { transform: scaleX(1); opacity: 1; }
	to   { transform: scaleX(0); opacity: 0.35; }
}

/* 报名表单在弹窗中的样式调整 */
.nyocor-proc-modal-content .nyocor-proc-form-wrap {
	padding: 0;
}

.nyocor-proc-modal-content .nyocor-proc-form {
	margin: 0;
}

/* 响应式设计 */
@media (max-width: 768px) {
	.nyocor-proc-modal-content {
		width: 95%;
		max-height: 95vh;
	}

	.nyocor-proc-modal-body {
		padding: 20px;
	}

	.nyocor-proc-modal-close {
		top: 10px;
		right: 10px;
	}

	.nyocor-proc-modal-body h2 {
		font-size: 20px;
	}
}

/* 加载动画 */
.nyocor-proc-loading {
	display: inline-block;
	width: 20px;
	height: 20px;
	border: 3px solid rgba(74, 144, 226, 0.3);
	border-radius: 50%;
	border-top-color: #4a90e2;
	animation: nyocorProcSpin 1s ease-in-out infinite;
	margin-right: 8px;
	vertical-align: middle;
}

@keyframes nyocorProcSpin {
	to {
		transform: rotate(360deg);
	}
}

/* 按钮加载状态 */
.nyocor-proc-btn.nyocor-proc-btn-loading {
	opacity: 0.7;
	cursor: not-allowed;
	position: relative;
}

.nyocor-proc-btn.nyocor-proc-btn-loading::before {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 20px;
	height: 20px;
	border: 3px solid rgba(255, 255, 255, 0.3);
	border-radius: 50%;
	border-top-color: #ffffff;
	animation: nyocorProcSpin 1s ease-in-out infinite;
}
/* 资质附件「选中即上传」状态（2026-09）：进度 / 已上传 / 失败重试 */
.file-item__status {
	margin-left: 8px;
	font-size: 12px;
	color: #888;
	white-space: nowrap;
}

.file-item__status--done {
	color: #1a9c5d;
	font-weight: 600;
}

.file-item__status--error {
	color: #d93025;
}

.file-item__retry {
	margin-left: 6px;
	padding: 1px 8px;
	font-size: 12px;
	color: #2a6bb5;
	background: #fff;
	border: 1px solid #2a6bb5;
	border-radius: 3px;
	cursor: pointer;
}

.file-item__retry:hover {
	color: #fff;
	background: #2a6bb5;
}
