/**
 * Rukn Insurance Manager — customer portal (sign in / account + dashboard).
 * Loaded after rkim-auth, rkim-dashboard and rkim-rukn on the portal page.
 */

/* ---------- Tabs (guest card + dashboard) ---------- */
.rkim-auth .rkim-tabs,
.rkim-portal .rkim-tabs {
	display: flex;
	gap: 4px;
	margin: 0 0 22px;
	padding: 4px;
	background: #EEF2F6;
	border-radius: 12px;
	border: 0;
}
.rkim-auth .rkim-tabs__tab,
.rkim-portal .rkim-tabs__tab {
	flex: 1;
	text-align: center;
	padding: 9px 14px;
	border-radius: 9px;
	font-size: 14px;
	font-weight: 600;
	color: var(--rk-muted, #5B6B80);
	text-decoration: none;
}
.rkim-auth .rkim-tabs__tab.is-active,
.rkim-portal .rkim-tabs__tab.is-active {
	background: #fff;
	color: var(--rk-navy, #0A3A6B);
	box-shadow: 0 2px 8px rgba(10, 58, 107, 0.1);
}
.rkim-auth .rkim-tabs__tab:focus-visible,
.rkim-portal .rkim-tabs__tab:focus-visible { outline: 3px solid color-mix(in srgb, var(--rk-teal, #0B9282) 45%, #fff); outline-offset: 1px; }
.rkim-portal .rkim-tabs--portal { max-width: 360px; margin: 0 0 18px; }

/* ---------- Guest (sign in / create account) ---------- */
.rkim-portal-guest .rkim-auth__card { padding-top: 36px; }
.rkim-portal-guest .rkim-auth__pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.rkim-auth__hint { margin: -6px 0 16px; font-size: 12.5px; color: var(--rk-muted, #5B6B80); }
.rkim-auth__switch { margin: 18px 0 0; font-size: 14px; color: var(--rk-muted, #5B6B80); text-align: center; }
.rkim-auth__switch a { color: var(--rk-teal, #0B9282); font-weight: 600; }
.rkim-auth__hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.rkim-auth .rkim-auth__field input[type="email"],
.rkim-auth .rkim-auth__field input[type="tel"] {
	width: 100%;
	padding: 12px 14px;
	font-size: 14px;
	font-family: inherit;
	border: 1.5px solid var(--rkim-line, #DDE4EC);
	border-radius: 10px;
	background: #F7F9FB;
	color: var(--rk-ink, #0B2340);
	box-sizing: border-box;
}
.rkim-auth .rkim-auth__field input:focus {
	outline: none;
	border-color: var(--rk-teal, #0B9282);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--rk-teal, #0B9282) 18%, transparent);
}
.rkim-portal-guest .rkim-auth__panel { min-height: 560px; }
@media (max-width: 760px) {
	.rkim-portal-guest .rkim-auth__panel { min-height: 0; }
	.rkim-portal-guest .rkim-auth__pair { grid-template-columns: 1fr; }
}

/* ---------- Dashboard shell ---------- */
.rkim-portal {
	max-width: 1080px;
	margin: 28px auto;
	padding: 0 12px;
}
.rkim-portal__notice {
	margin: 0 0 18px;
	padding: 12px 16px;
	border-radius: 12px;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.5;
	border: 1px solid transparent;
}
.rkim-portal__notice--success { background: #EAF7F4; border-color: #BFE6DE; color: #0A5E53; }
.rkim-portal__notice--error { background: #FEF3F2; border-color: #FECDCA; color: #B42318; }
.rkim-portal__notice--info { background: #EEF3F8; border-color: #D5E0EC; color: var(--rk-navy, #0A3A6B); }

.rkim-portal .rkim-detail__card {
	background: #fff;
	border: 1px solid var(--rkim-line, #DDE4EC);
	border-radius: 16px;
	padding: 22px 24px;
	margin: 0 0 18px;
	box-shadow: 0 4px 18px rgba(10, 58, 107, 0.05);
}
.rkim-portal .rkim-detail__cardtitle { margin: 0 0 14px; font-size: 16px; font-weight: 600; color: var(--rk-navy, #0A3A6B); }
.rkim-portal__cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; align-items: start; }
.rkim-portal__muted { margin: 0; font-size: 13px; color: var(--rk-muted, #5B6B80); line-height: 1.5; }

/* Forms inside the portal. */
.rkim-portal__form .rkim-field { display: flex; flex-direction: column; gap: 6px; margin: 0 0 14px; }
.rkim-portal__form .rkim-field label { font-size: 13px; font-weight: 600; }
.rkim-portal__form input,
.rkim-portal__form textarea {
	width: 100%;
	padding: 11px 13px;
	font-size: 14px;
	font-family: inherit;
	color: var(--rk-ink, #0B2340);
	background: #F7F9FB;
	border: 1.5px solid var(--rkim-line, #DDE4EC);
	border-radius: 10px;
	box-sizing: border-box;
}
.rkim-portal__form textarea { resize: vertical; min-height: 96px; }
.rkim-portal__form input[readonly] { color: var(--rk-muted, #5B6B80); background: #EEF2F6; }
.rkim-portal .rkim-field__hint { font-size: 12.5px; color: var(--rk-muted, #5B6B80); }

/* ---------- Stats ---------- */
.rkim-portal .rkim-portal__stats { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.rkim-portal .rkim-stat--alert { border-top-color: #F59E0B; background: #FFFBF1; }

/* ---------- Request list ---------- */
.rkim-portal__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.rkim-portal__item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 18px 20px;
	background: #fff;
	border: 1px solid var(--rkim-line, #DDE4EC);
	border-radius: 14px;
	box-shadow: 0 2px 10px rgba(10, 58, 107, 0.04);
}
.rkim-portal__item.is-action { border-left: 4px solid #F59E0B; }
.rkim-portal__itemmain { min-width: 0; }
.rkim-portal__itemtitle { display: inline-block; margin-bottom: 4px; font-size: 16px; font-weight: 600; color: var(--rk-navy, #0A3A6B); text-decoration: none; }
.rkim-portal__itemtitle:hover { color: var(--rk-teal, #0B9282); }
.rkim-portal__flag { margin: 6px 0 0; font-size: 13px; font-weight: 600; color: #B45309; }
.rkim-portal__itemside { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.rkim-portal__itemprem { font-size: 14px; font-weight: 700; color: var(--rk-ink, #0B2340); white-space: nowrap; }
.rkim-portal__empty { text-align: left; }
.rkim-portal__empty p { margin: 0 0 16px; color: var(--rk-muted, #5B6B80); }

/* ---------- Request detail ---------- */
.rkim-portal__back { display: inline-block; margin: 0 0 12px; font-size: 14px; font-weight: 600; color: var(--rk-navy, #0A3A6B); text-decoration: none; }
.rkim-portal__back:hover { color: var(--rk-teal, #0B9282); }
.rkim-portal__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.rkim-portal__ref { margin: 0 0 4px; font-size: 13px; font-weight: 600; color: var(--rk-teal, #0B9282); letter-spacing: .2px; }
.rkim-portal__qtitle { margin: 0; font-size: 22px; font-weight: 700; color: var(--rk-navy, #0A3A6B); }
.rkim-portal__sub { margin: 4px 0 0; font-size: 14px; color: var(--rk-muted, #5B6B80); }
.rkim-portal__headside { text-align: right; }
.rkim-portal__dates { margin: 8px 0 0; font-size: 13px; color: var(--rk-muted, #5B6B80); }
.rkim-portal__premium { margin: 0 0 4px; font-size: 28px; font-weight: 700; color: var(--rk-navy, #0A3A6B); letter-spacing: -.3px; }
.rkim-portal__dl { margin-top: 14px; }
.rkim-portal__message { margin-top: 16px; padding: 14px 16px; background: #F3F6F9; border-radius: 12px; }
.rkim-portal__message p { margin: 0; font-size: 14px; line-height: 1.55; }
.rkim-portal__msglabel { margin: 0 0 6px !important; font-size: 12.5px !important; font-weight: 600; color: var(--rk-teal, #0B9282); }
.rkim-portal__action { border-left: 4px solid #F59E0B !important; }
.rkim-portal__ask { margin: 0 0 16px; padding: 12px 14px; background: #FFFBF1; border-radius: 10px; font-size: 14px; line-height: 1.55; }
.rkim-portal__replies { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 10px; }
.rkim-portal__replies li { padding: 10px 14px; background: #EAF7F4; border-radius: 10px; }
.rkim-portal__replies p { margin: 4px 0 0; font-size: 14px; line-height: 1.5; }
.rkim-portal .rkim-timeline { margin: 0; padding: 0; }
.rkim-portal .rkim-timeline__item.is-done .rkim-timeline__marker { background: var(--rk-teal, #0B9282); border-color: var(--rk-teal, #0B9282); }
.rkim-portal .rkim-timeline__item.is-current .rkim-timeline__marker { background: var(--rk-navy, #0A3A6B); border-color: var(--rk-navy, #0A3A6B); }

.rkim-portal__submitted summary { cursor: pointer; margin: 0; list-style: none; }
.rkim-portal__submitted summary::-webkit-details-marker { display: none; }
.rkim-portal__submitted summary::after { content: "+"; float: right; font-weight: 400; color: var(--rk-muted, #5B6B80); }
.rkim-portal__submitted[open] summary::after { content: "–"; }
.rkim-portal__submitted[open] summary { margin-bottom: 8px; }
.rkim-portal__sectitle { margin: 16px 0 8px; font-size: 13.5px; font-weight: 600; color: var(--rk-muted, #5B6B80); }
.rkim-portal__dl-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; margin: 0; }
.rkim-portal__dl-grid > div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid #EEF1F5; }
.rkim-portal__dl-grid dt { font-size: 13px; color: var(--rk-muted, #5B6B80); }
.rkim-portal__dl-grid dd { margin: 0; font-size: 13.5px; font-weight: 600; text-align: right; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
	.rkim-portal .rkim-portal__stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
	.rkim-portal { margin: 14px auto; padding: 0 8px; }
	.rkim-portal__cols, .rkim-portal__dl-grid { grid-template-columns: 1fr; }
	.rkim-portal .rkim-portal__stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.rkim-portal .rkim-stat--total { grid-column: 1 / -1; }
	.rkim-portal__item { flex-direction: column; align-items: flex-start; }
	.rkim-portal__itemside { width: 100%; justify-content: space-between; flex-wrap: wrap; }
	.rkim-portal__headside { text-align: left; }
	.rkim-portal .rkim-detail__card { padding: 18px; }
	.rkim-portal .rkim-tabs--portal { max-width: none; }
}

/* ---------- Processing fee (customer) ---------- */
.rkim-portal .rkim-fee { border-left: 4px solid var(--rk-teal, #0B9282); }
.rkim-portal .rkim-fee--due,
.rkim-portal .rkim-fee--rejected { border-left-color: #F59E0B; }
.rkim-portal .rkim-fee--submitted { border-left-color: #2563EB; }
.rkim-fee__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 12px; }
.rkim-fee__head .rkim-detail__cardtitle { margin-bottom: 6px; }
.rkim-fee__amount { margin: 0 0 4px; font-size: 30px; font-weight: 700; color: var(--rk-navy, #0A3A6B); letter-spacing: -.3px; }
.rkim-fee__instr { margin: 4px 0 14px; font-size: 14px; line-height: 1.55; }
.rkim-fee__status { margin: 0 0 6px; font-size: 14px; line-height: 1.55; }
.rkim-fee__status--paid { color: #0A5E53; font-weight: 600; }
.rkim-fee__reject { margin: 0 0 14px; padding: 12px 14px; background: #FEF3F2; border-radius: 10px; }
.rkim-fee__reject p { margin: 0; font-size: 14px; }
.rkim-fee__reject .rkim-portal__msglabel { color: #B42318 !important; }
.rkim-fee__bank {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0 24px;
	margin: 0 0 18px;
	padding: 6px 16px;
	background: #F3F6F9;
	border-radius: 12px;
}
.rkim-fee__bank > div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid #E3E9F0; }
.rkim-fee__bank > div:nth-last-child(-n+2) { border-bottom: 0; }
.rkim-fee__bank dt { font-size: 13px; color: var(--rk-muted, #5B6B80); }
.rkim-fee__bank dd { margin: 0; font-size: 14px; font-weight: 600; text-align: right; word-break: break-all; }
.rkim-fee__formgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.rkim-fee__form input[type="file"] { padding: 9px; background: #fff; }
.rkim-portal__flag--info { color: #1D4ED8; }
.rkim-portal__flag--ok { color: #0A5E53; }
@media (max-width: 760px) {
	.rkim-fee__head { flex-direction: column-reverse; }
	.rkim-fee__bank, .rkim-fee__formgrid { grid-template-columns: 1fr; }
	.rkim-fee__bank > div:nth-last-child(2) { border-bottom: 1px solid #E3E9F0; }
}
