/* Login / register / password reset (HomePages/Akam/Login.aspx) */
:root {
	--primary: #3546d1;
	--primary-dark: #2633a8;
	--primary-soft: #eceffd;
	--accent: #7b5cf5;
	--success: #1f9d61;
	--danger: #d6334a;
	--warning: #c9850c;
	--text: #1d2433;
	--muted: #6b7386;
	--border: #dfe3ec;
	--field: #f7f8fb;
	--card: #ffffff;
	--page: #eef1f8;
	--radius: 14px;
	--shadow: 0 24px 60px -24px rgba(29, 36, 80, .35);
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
	font-family: IRANSans, Tahoma, sans-serif;
	font-size: 14px;
	color: var(--text);
	background: var(--page);
	background-image:
		radial-gradient(circle at 15% 20%, rgba(123, 92, 245, .14), transparent 40%),
		radial-gradient(circle at 85% 80%, rgba(53, 70, 209, .14), transparent 45%);
	-webkit-font-smoothing: antialiased;
}

button, input, select { font-family: inherit; font-size: inherit; color: inherit; }

.auth {
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 24px 16px;
}

.auth-shell {
	width: 100%;
	max-width: 960px;
	display: grid;
	grid-template-columns: 1fr 1fr;
	background: var(--card);
	border-radius: 22px;
	box-shadow: var(--shadow);
	overflow: hidden;
}

/* Brand panel */
.auth-brand {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	padding: 40px;
	color: #fff;
	background: linear-gradient(150deg, rgba(38, 51, 168, .94), rgba(123, 92, 245, .9)), url('../images/b4.jpg') center / cover;
}

.auth-brand-top { display: flex; align-items: center; gap: 12px; }
.auth-brand-logo { height: 40px; max-width: 140px; object-fit: contain; background: rgba(255, 255, 255, .92); border-radius: 10px; padding: 4px 8px; }
.auth-brand-name { font-weight: bold; font-size: 16px; }
.auth-brand-body h2 { font-size: 26px; line-height: 1.6; margin: 0 0 8px; }
.auth-brand-body p { margin: 0 0 28px; opacity: .85; line-height: 1.9; }
.auth-features { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.auth-features li { display: flex; align-items: center; gap: 12px; }
.auth-features .fa {
	width: 34px; height: 34px; border-radius: 10px;
	display: inline-flex; align-items: center; justify-content: center;
	background: rgba(255, 255, 255, .16); font-size: 15px;
}
.auth-brand-foot { font-size: 12px; opacity: .75; min-height: 1em; }

/* Card */
.auth-card { padding: 40px 44px; display: flex; flex-direction: column; min-width: 0; }

.auth-head { text-align: center; margin-bottom: 22px; }
.auth-head-logo { display: none; height: 44px; max-width: 160px; object-fit: contain; margin: 0 auto 12px; }
.auth-head h1 { font-size: 20px; margin: 0 0 6px; }
.auth-head p { margin: 0; color: var(--muted); font-size: 13px; }

.auth-tabs {
	display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
	background: var(--field); border: 1px solid var(--border); border-radius: 12px; padding: 4px; margin-bottom: 20px;
}
.auth-tab {
	border: 0; background: transparent; border-radius: 9px; padding: 9px 0; cursor: pointer;
	color: var(--muted); font-weight: 500; transition: background .2s, color .2s, box-shadow .2s;
}
.auth-tab.active { background: var(--card); color: var(--primary); box-shadow: 0 2px 8px rgba(29, 36, 80, .1); }

.auth-alert {
	border-radius: 10px; padding: 10px 12px; margin-bottom: 16px; font-size: 13px; line-height: 1.8;
	background: #fdecef; color: var(--danger); border: 1px solid #f6c7cf;
}
.auth-alert.success { background: #e7f6ee; color: var(--success); border-color: #bfe6d0; }
.auth-alert.info { background: var(--primary-soft); color: var(--primary-dark); border-color: #d3d9fb; }

.auth-view { display: flex; flex-direction: column; gap: 12px; animation: view-in .25s ease; }
.auth-view[hidden] { display: none; }

@keyframes view-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.auth-note { margin: 0; color: var(--muted); line-height: 1.9; font-size: 13px; }
.auth-note bdi { color: var(--text); font-weight: bold; }

/* Fields with floating labels */
.field { position: relative; }
.field input {
	width: 100%; height: 50px; padding: 18px 42px 4px 42px;
	border: 1px solid var(--border); border-radius: 12px; background: var(--field);
	outline: none; transition: border-color .2s, box-shadow .2s, background .2s;
	text-align: right;
}
.field input:focus { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 4px rgba(53, 70, 209, .12); }
.field input[dir="ltr"] { text-align: left; }
.field label {
	position: absolute; right: 42px; top: 15px; color: var(--muted); pointer-events: none;
	transition: top .15s, font-size .15s, color .15s;
}
.field input:focus + label,
.field input:not(:placeholder-shown) + label { top: 5px; font-size: 11px; color: var(--primary); }
.field.invalid input { border-color: var(--danger); box-shadow: 0 0 0 4px rgba(214, 51, 74, .1); }
.field.invalid label { color: var(--danger); }

.field-icon { position: absolute; right: 15px; top: 17px; color: #9aa1b2; font-size: 16px; width: 16px; text-align: center; }
.field-toggle {
	position: absolute; left: 8px; top: 9px; width: 32px; height: 32px; border: 0; border-radius: 8px;
	background: transparent; color: #9aa1b2; cursor: pointer;
}
.field-toggle:hover { color: var(--primary); background: var(--primary-soft); }
.field-status { position: absolute; left: 14px; top: 16px; font-size: 16px; }
.field-status.ok { color: var(--success); }
.field-status.bad { color: var(--danger); }
.field-hint { font-size: 12px; color: var(--muted); margin-top: -6px; padding-right: 4px; }
.caps-hint { color: var(--warning); }
.caps-hint .fa { margin-left: 6px; }

.field-code input { padding: 18px 16px 4px; text-align: center; letter-spacing: 12px; font-size: 20px; font-weight: bold; }
.field-code label { right: 0; left: 0; text-align: center; }

/* Password strength */
.strength { display: flex; align-items: center; gap: 10px; margin-top: -4px; }
.strength span { flex: 1; height: 5px; border-radius: 4px; background: var(--border); position: relative; overflow: hidden; }
.strength span::after {
	content: ""; position: absolute; inset: 0 auto 0 0; width: var(--level, 0%);
	background: var(--level-color, var(--danger)); border-radius: 4px; transition: width .25s, background .25s;
}
.strength em { font-style: normal; font-size: 12px; color: var(--muted); min-width: 40px; }

/* User type */
.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; }
.segmented label { position: relative; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; }
.segmented span {
	display: block; text-align: center; padding: 10px; border: 1px solid var(--border); border-radius: 12px;
	background: var(--field); color: var(--muted); transition: all .2s;
}
.segmented input:checked + span { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); font-weight: 500; }
.segmented input:focus-visible + span { box-shadow: 0 0 0 4px rgba(53, 70, 209, .12); }

/* Captcha */
.captcha { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 10px; align-items: center; }
.captcha-slot:empty { display: none; }
.captcha-image { direction: ltr; border: 1px solid var(--border); border-radius: 12px; background: #fff; padding: 4px; overflow: hidden; }
.captcha-image img { display: block; max-width: 100%; }
.captcha-image .BDC_CaptchaDiv { margin: 0 !important; }
.captcha-image .BDC_CaptchaImageDiv img { cursor: pointer; }
/* The narrow column clips BotDetect's icons; the field has its own reload button */
.captcha-image .BDC_CaptchaIconsDiv { display: none !important; }
.field-captcha input { text-align: center !important; padding-right: 14px; padding-left: 40px; letter-spacing: 4px; }
.field-captcha label { right: 14px; }

/* Buttons and links */
.btn {
	position: relative; height: 50px; border: 0; border-radius: 12px; cursor: pointer; font-weight: bold;
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	transition: transform .1s, box-shadow .2s, background .2s, opacity .2s;
}
.btn-primary {
	color: #fff; background: linear-gradient(135deg, var(--primary), var(--accent));
	box-shadow: 0 10px 24px -10px rgba(53, 70, 209, .7);
}
.btn-primary:hover { box-shadow: 0 14px 28px -10px rgba(53, 70, 209, .8); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .65; cursor: default; }
.btn-spinner {
	display: none; width: 18px; height: 18px; border-radius: 50%;
	border: 2px solid rgba(255, 255, 255, .45); border-top-color: #fff; animation: spin .7s linear infinite;
}
.btn.busy .btn-spinner { display: inline-block; }
.btn.busy .btn-text { opacity: .8; }

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

.btn-link {
	border: 0; background: none; padding: 0; color: var(--primary); cursor: pointer; font-weight: 500;
}
.btn-link[disabled] { color: var(--muted); cursor: default; }
.auth-row { display: flex; justify-content: flex-start; }
.auth-row-split { justify-content: space-between; align-items: center; }
.auth-link { color: var(--primary); text-decoration: none; font-size: 13px; }
.auth-link:hover { text-decoration: underline; }

.auth-footer { margin-top: 18px; color: var(--muted); font-size: 12px; text-align: center; }

/* Panel extension (ExtendedPanel.aspx) */
.auth-card > .auth-row { margin-top: 16px; }
.extend-loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 24px 0; }
.extend-loading .btn-spinner { display: inline-block; border-color: var(--primary-soft); border-top-color: var(--primary); }
.extend-summary { border: 1px solid var(--border); border-radius: 12px; background: var(--field); padding: 4px 16px; }
.extend-summary > div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.extend-summary > div:last-child { border-bottom: 0; }
.extend-summary span { color: var(--muted); }
.extend-summary .extend-total { font-size: 15px; }
.extend-summary .extend-total b { color: var(--primary-dark); }
.extend-caption { margin: 4px 0 8px; color: var(--muted); font-size: 13px; }
.extend-gateways { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.extend-gateways label { position: relative; cursor: pointer; }
.extend-gateways input { position: absolute; opacity: 0; }
.extend-gateways span {
	display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 8px; border: 1px solid var(--border);
	border-radius: 12px; background: var(--field); color: var(--muted); font-size: 13px; transition: all .2s;
}
.extend-gateways img { max-height: 34px; max-width: 100%; }
.extend-gateways input:checked + span { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); font-weight: 500; }
.extend-gateways input:focus-visible + span { box-shadow: 0 0 0 4px rgba(53, 70, 209, .12); }

/* showMiniNotification (routines.js); its icons use Font Awesome 5 names */
.mini-notification {
	position: fixed; right: -320px; max-width: 320px;
	display: flex; align-items: center; gap: 8px;
	padding: 11px 15px; border-radius: 10px; background: #fff; font-size: 13px; line-height: 1.7;
	box-shadow: 0 8px 24px rgba(29, 36, 80, .18); border-right: 4px solid #4dabf7;
	z-index: 1000; transition: right .3s ease;
}
.mini-notification.success { border-right-color: var(--success); color: var(--success); }
.mini-notification.error { border-right-color: var(--danger); color: var(--danger); }
.mini-notification.warning { border-right-color: var(--warning); color: var(--warning); }
.mini-notification.info { border-right-color: var(--primary); color: var(--primary-dark); }
.mini-notification .fas { font: normal normal normal 15px/1 FontAwesome; }

/* Tablet and phone: the card only */
@media (max-width: 860px) {
	.auth-shell { grid-template-columns: 1fr; max-width: 460px; }
	.auth-brand { display: none; }
	.auth-head-logo { display: block; }
}

@media (max-width: 480px) {
	.auth { padding: 16px; justify-content: flex-start; }
	.auth-card { padding: 28px 18px; }
	.captcha { grid-template-columns: 1fr; }
	.captcha-image { order: -1; }
}

@media (prefers-reduced-motion: reduce) {
	* { animation: none !important; transition: none !important; }
}
