/* ═══════════════════════════════════════════════
   IranDV Lottery Manager — استایل فرانت (فرم + پنل)
   ═══════════════════════════════════════════════ */

:root {
	--ivl-navy: #0b1f3a;
	--ivl-navy-2: #102a4c;
	--ivl-green: #10b981;
	--ivl-green-dark: #059669;
	--ivl-gold: #d97706;
	--ivl-gold-bg: #fffbeb;
	--ivl-gold-border: #fcd34d;
	--ivl-bg: #f6f8fb;
	--ivl-border: #e2e8f0;
	--ivl-text: #0f172a;
	--ivl-text-2: #475569;
	--ivl-text-3: #94a3b8;
	--ivl-radius: 14px;
	--ivl-shadow: 0 10px 30px rgba(11, 31, 58, 0.08);
}

.iv-form-wrap, .iv-auth, .iv-dash {
	max-width: 920px;
	margin-inline: auto;
	direction: rtl;
	font-family: inherit;
	color: var(--ivl-text);
}

/* ─────────── هشدارها ─────────── */
.iv-form-alert {
	background: var(--ivl-bg);
	border: 1.5px solid var(--ivl-border);
	border-radius: 12px;
	padding: 14px 18px;
	margin: 0 0 18px;
	font-size: 14.5px;
	color: var(--ivl-text-2);
	line-height: 1.9;
}

.iv-form-alert--info { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }
.iv-form-alert--error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.iv-form-alert--success { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }

.iv-form-alert--gold { background: var(--ivl-gold-bg); border-color: var(--ivl-gold-border); color: #92400e; }
.iv-form-alert ul { margin: 8px 0 0; padding-right: 20px; }

/* ─────────── بخش‌های فرم ─────────── */
.iv-form { background: #fff; border: 1px solid var(--ivl-border); border-radius: 18px; padding: 28px; box-shadow: var(--ivl-shadow); }

.iv-form-section {
	border: 1.5px solid var(--ivl-border);
	border-radius: var(--ivl-radius);
	padding: 22px;
	margin: 0 0 22px;
	background: #fff;
}

.iv-form-section legend {
	font-weight: 800;
	font-size: 16px;
	color: var(--ivl-navy);
	padding: 2px 14px;
	background: #fff;
	border: 1.5px solid var(--ivl-border);
	border-radius: 99px;
}

.iv-form-section--gold { border-color: var(--ivl-gold-border); background: linear-gradient(180deg, #fffdf6, #fff); }

.iv-new-tag {
	display: inline-block;
	font-size: 11.5px;
	font-weight: 700;
	background: var(--ivl-gold);
	color: #fff;
	border-radius: 99px;
	padding: 1px 10px;
	vertical-align: middle;
	margin-inline-start: 6px;
}

.iv-form-note { color: var(--ivl-text-2); font-size: 13.5px; margin: 0 0 14px; }

.iv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; margin-bottom: 4px; }
.iv-grid--3 { grid-template-columns: repeat(3, 1fr); }
.iv-grid--4 { grid-template-columns: repeat(4, 1fr); }

.iv-field label { display: block; font-weight: 700; font-size: 13.5px; margin-bottom: 6px; color: var(--ivl-navy); }
.iv-field label small { font-weight: 500; color: var(--ivl-text-3); }

.iv-req-mark { color: #dc2626; }

.iv-input {
	width: 100%;
	font-family: inherit;
	font-size: 14.5px;
	padding: 11px 13px;
	border: 1.5px solid var(--ivl-border);
	border-radius: 10px;
	background: #fff;
	color: var(--ivl-text);
	transition: border-color 0.2s, box-shadow 0.2s;
}

.iv-input:focus { outline: none; border-color: var(--ivl-green); box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.12); }

.iv-input--latin { text-transform: uppercase; letter-spacing: 0.3px; }
.iv-input--day { max-width: 90px; }
.iv-input--month { flex: 1; }
.iv-input--year { max-width: 110px; }
.iv-input--small { max-width: 140px; }

.iv-date-row { display: flex; gap: 8px; }

.iv-hint { color: var(--ivl-text-3); font-weight: 500; }

.iv-jalali-hint { display: block; color: var(--ivl-green-dark); font-size: 12.5px; margin-top: 4px; min-height: 18px; }

/* آپلود عکس */
.iv-upload-box {
	background: var(--ivl-bg);
	border: 2px dashed var(--ivl-border);
	border-radius: var(--ivl-radius);
	padding: 18px;
	text-align: center;
	transition: border-color 0.2s;
}

.iv-upload-box:hover { border-color: var(--ivl-green); }

.iv-upload-label { cursor: pointer; display: inline-flex; flex-direction: column; align-items: center; gap: 10px; }

.iv-upload-label input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; }

.iv-upload-cta {
	display: inline-block;
	background: var(--ivl-navy);
	color: #fff;
	font-size: 14px;
	font-weight: 700;
	padding: 10px 22px;
	border-radius: 10px;
	transition: background 0.2s;
}

.iv-upload-label:hover .iv-upload-cta { background: var(--ivl-green-dark); }

.iv-upload-preview { margin-top: 12px; }

.iv-upload-preview img {
	width: 150px;
	height: 150px;
	object-fit: cover;
	border-radius: 12px;
	border: 3px solid var(--ivl-green);
	display: block;
	margin-inline: auto;
}

.iv-upload-preview .iv-upload-meta { font-size: 12.5px; color: var(--ivl-text-2); margin-top: 8px; }
.iv-upload-preview .iv-upload-meta.is-bad { color: #dc2626; }
.iv-upload-preview .iv-upload-meta.is-ok { color: var(--ivl-green-dark); }

/* چک‌باکس */
.iv-check { display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; color: var(--ivl-text-2); margin-bottom: 18px; }
.iv-check input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--ivl-green); }

/* ردیف فرزند */
.iv-child-row { border: 1.5px solid var(--ivl-border); border-radius: var(--ivl-radius); padding: 18px; margin-bottom: 16px; background: #fcfdff; }

.iv-child-row__head { margin-bottom: 12px; }
.iv-child-row__head strong { color: var(--ivl-navy); }

/* ارسال */
.iv-submit-row { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }

.ivl-btn, .iv-form .iv-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	background: linear-gradient(135deg, var(--ivl-green), var(--ivl-green-dark));
	color: #fff !important;
	border: 0;
	border-radius: 12px;
	font-family: inherit;
	font-size: 15.5px;
	font-weight: 800;
	padding: 13px 30px;
	cursor: pointer;
	box-shadow: 0 8px 22px rgba(16, 185, 129, 0.32);
	transition: all 0.22s;
	text-decoration: none;
}

.iv-form .iv-btn:hover, .ivl-btn:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(16, 185, 129, 0.4); }

.iv-btn--ghost { background: transparent !important; border: 2px solid var(--ivl-border); color: var(--ivl-text) !important; box-shadow: none; }
.iv-btn--ghost:hover { border-color: var(--ivl-green); color: var(--ivl-green-dark) !important; }

.iv-btn--sm { padding: 8px 16px; font-size: 13.5px; }
.iv-btn--block { width: 100%; }

.iv-fee-note { font-size: 14px; color: var(--ivl-text-2); }
.iv-fee-note strong { color: var(--ivl-navy); }

.iv-form-actions-top { margin-bottom: 18px; }

/* ─────────── ورود/عضویت ─────────── */
.iv-auth { max-width: 520px; background: #fff; border: 1px solid var(--ivl-border); border-radius: 18px; padding: 26px; box-shadow: var(--ivl-shadow); }

.iv-auth__tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; background: var(--ivl-bg); border-radius: 12px; padding: 6px; margin-bottom: 20px; }

.iv-auth__tab {
	background: transparent;
	border: 0;
	font-family: inherit;
	font-size: 14.5px;
	font-weight: 700;
	color: var(--ivl-text-2);
	padding: 10px;
	border-radius: 9px;
	cursor: pointer;
	transition: all 0.2s;
}

.iv-auth__tab.is-active { background: #fff; color: var(--ivl-navy); box-shadow: 0 2px 8px rgba(11, 31, 58, 0.1); }

.iv-auth__panel { display: none; }
.iv-auth__panel.is-active { display: block; }

.iv-auth__hint { font-size: 13px; color: var(--ivl-text-3); margin-top: 14px; }

/* ─────────── داشبورد ─────────── */
.iv-dash { max-width: 960px; }

.iv-dash__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 24px; }

.iv-dash__title { font-size: 24px; margin: 0 0 4px; color: var(--ivl-navy); }
.iv-dash__welcome { color: var(--ivl-text-2); margin: 0; }

.iv-dash__user { display: flex; align-items: center; gap: 12px; }
.iv-dash__email { color: var(--ivl-text-3); font-size: 13.5px; direction: ltr; }

.iv-dash__section-title { font-size: 17px; color: var(--ivl-navy); margin: 34px 0 14px; padding-bottom: 8px; border-bottom: 2px solid var(--ivl-border); }

.iv-dash__empty { background: #fff; border: 1.5px dashed var(--ivl-border); border-radius: var(--ivl-radius); padding: 24px; color: var(--ivl-text-2); }
.iv-dash__hint { font-size: 13.5px; color: var(--ivl-text-2); background: #ecfdf5; border-radius: 10px; padding: 12px 16px; border: 1px solid #a7f3d0; }
.iv-dash__waiting { color: var(--ivl-text-2); font-size: 14.5px; }

/* کارت دوره جاری */
.iv-dash-card {
	background: linear-gradient(160deg, var(--ivl-navy), var(--ivl-navy-2));
	color: #fff;
	border-radius: 18px;
	padding: 26px;
	box-shadow: var(--ivl-shadow);
	position: relative;
	overflow: hidden;
}

.iv-dash-card::before {
	content: "";
	position: absolute;
	inset: 0;
	background: radial-gradient(400px 200px at 90% 0%, rgba(16, 185, 129, 0.18), transparent 60%);
	pointer-events: none;
}

.iv-dash-card--cta { text-align: right; }

.iv-dash-card__icon { font-size: 34px; margin-bottom: 10px; }

.iv-dash-card h3 { color: #fff; font-size: 19px; margin: 0 0 10px; }

.iv-dash-card p { color: rgba(255, 255, 255, 0.75); font-size: 14.5px; margin: 0 0 18px; }

.iv-dash-card__row { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.iv-dash-card__row h3 { margin: 0; }
.iv-dash-card__actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

/* وضعیت‌ها */
.iv-status {
	display: inline-block;
	font-size: 12px;
	font-weight: 800;
	border-radius: 99px;
	padding: 4px 12px;
	white-space: nowrap;
}

.iv-status--awaiting_payment { background: #fef3c7; color: #92400e; }
.iv-status--paid { background: #dbeafe; color: #1e40af; }
.iv-status--submitted { background: #e0e7ff; color: #3730a3; }
.iv-status--completed { background: #d1fae5; color: #065f46; }
.iv-status--rejected { background: #fee2e2; color: #991b1b; }

/* تایم‌لاین */
.iv-timeline { display: flex; gap: 0; margin: 18px 0; }

.iv-timeline__step { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; position: relative; }

.iv-timeline__step:not(:last-child)::after {
	content: "";
	position: absolute;
	top: 9px;
	right: 50%;
	width: 100%;
	height: 2.5px;
	background: rgba(255, 255, 255, 0.15);
	z-index: 0;
}

.iv-timeline__step.done:not(:last-child)::after,
.iv-timeline__step.active:not(:last-child)::after { background: var(--ivl-green); }

.iv-timeline__dot {
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.15);
	z-index: 1;
	position: relative;
}

.iv-timeline__step.done .iv-timeline__dot { background: var(--ivl-green); box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.2); }
.iv-timeline__step.active .iv-timeline__dot { background: var(--ivl-green); animation: ivlPulse 1.6s infinite; }

@keyframes ivlPulse {
	0%, 100% { box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.25); }
	50% { box-shadow: 0 0 0 9px rgba(16, 185, 129, 0.08); }
}

.iv-timeline__label { font-size: 12px; color: rgba(255, 255, 255, 0.65); }
.iv-timeline__step.active .iv-timeline__label { color: #6ee7b7; font-weight: 700; }
.iv-timeline__step.done .iv-timeline__label { color: rgba(255, 255, 255, 0.9); }

/* جدول آرشیو */
.iv-table-wrap { background: #fff; border: 1px solid var(--ivl-border); border-radius: var(--ivl-radius); overflow-x: auto; box-shadow: var(--ivl-shadow); }

.iv-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 560px; }

.iv-table th, .iv-table td { padding: 12px 16px; text-align: right; border-bottom: 1px solid var(--ivl-border); }
.iv-table thead th { background: var(--ivl-bg); color: var(--ivl-navy); font-weight: 800; font-size: 13px; white-space: nowrap; }
.iv-table tbody tr:last-child td { border-bottom: 0; }
.iv-table tbody tr.is-current { background: #ecfdf5; }

.iv-table--kv tbody th { width: 180px; color: var(--ivl-text-2); font-weight: 600; background: var(--ivl-bg); }

/* واکنش‌گرا */
@media (max-width: 768px) {
	.iv-grid, .iv-grid--3, .iv-grid--4 { grid-template-columns: 1fr; }
	.iv-form { padding: 18px; }
	.iv-form-section { padding: 16px; }
	.iv-submit-row { flex-direction: column; align-items: stretch; }
	.iv-submit-row .iv-btn { width: 100%; }
	.iv-timeline__label { font-size: 10.5px; }
}

/* ═══════════ v1.1: قیمت پویا، دوشانسه، مشاهده ثبت‌نام ═══════════ */
.iv-status--in_progress { background: #fef9c3; color: #854d0e; }

.iv-price-box {
	background: #f0fdf4;
	border: 2px solid #10b981;
	border-radius: 14px;
	padding: 18px 20px;
	margin: 16px 0;
}
.iv-price-box__title {
	font-weight: 800;
	color: #065f46;
	margin-bottom: 10px;
	font-size: 15px;
}
.iv-price-box__row {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	padding: 7px 0;
	border-bottom: 1px dashed #a7f3d0;
	font-size: 14px;
}
.iv-price-box__row b { white-space: nowrap; }
.iv-price-box__total {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding-top: 12px;
	margin-top: 4px;
	font-size: 16px;
	font-weight: 800;
	color: #065f46;
}
.iv-price-box__total b { font-size: 20px; }
.iv-price-box__hint { font-size: 12px; color: #059669; margin-top: 8px; }
.iv-price-box--sc { padding: 12px 16px; margin: 12px 0 0; }

.iv-tag-sc {
	display: inline-block;
	background: #fef3c7;
	color: #92400e;
	font-size: 11px;
	font-weight: 700;
	padding: 2px 8px;
	border-radius: 999px;
	margin-inline-start: 6px;
}

.iv-photos-grid {
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
	margin-bottom: 18px;
}
.iv-photos-grid figure {
	margin: 0;
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	padding: 8px;
	text-align: center;
}
.iv-photos-grid img {
	width: 96px;
	height: 96px;
	object-fit: cover;
	border-radius: 8px;
	display: block;
}
.iv-photos-grid figcaption { font-size: 12px; margin-top: 6px; color: #4b5563; }

.iv-sub-view .iv-dash-card { margin-bottom: 18px; }
