/*
 * Udyojak OS v5.4 — Platform Foundation
 * Passkey, credential-management and offline-shell presentation only.
 */

.ubos-login-divider {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 18px 0;
	color: var(--ubos-muted, #56647a);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .06em;
	text-transform: uppercase;
}

.ubos-login-divider::before,
.ubos-login-divider::after {
	content: "";
	flex: 1;
	height: 1px;
	background: var(--ubos-border, #dfe5ee);
}

.ubos-passkey-login {
	width: 100%;
	min-height: 48px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	border: 1px solid rgba(8, 43, 103, .22);
	border-radius: 12px;
	background: rgba(8, 43, 103, .06);
	color: var(--ubos-navy, #082b67);
	font: inherit;
	font-weight: 800;
	cursor: pointer;
	transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.ubos-passkey-login:hover:not(:disabled) {
	transform: translateY(-1px);
	background: rgba(8, 43, 103, .1);
	box-shadow: 0 10px 24px rgba(8, 43, 103, .1);
}

.ubos-passkey-login:disabled {
	cursor: not-allowed;
	opacity: .55;
}

.ubos-passkey-login svg {
	width: 20px;
	height: 20px;
	stroke: currentColor;
	fill: none;
	stroke-width: 1.8;
}

.ubos-passkey-login-status,
.ubos-passkey-status,
.ubos-passkey-support {
	margin-top: 12px;
	padding: 10px 12px;
	border-radius: 10px;
	font-size: 12px;
	line-height: 1.5;
}

.ubos-passkey-login-status[data-tone="working"],
.ubos-passkey-status[data-tone="working"] {
	background: #edf4ff;
	color: #174f92;
}

.ubos-passkey-login-status[data-tone="success"],
.ubos-passkey-status[data-tone="success"] {
	background: #eaf8f2;
	color: #0c6b48;
}

.ubos-passkey-login-status[data-tone="error"],
.ubos-passkey-status[data-tone="error"] {
	background: #fff0f1;
	color: #a61f32;
}

.ubos-passkey-support[data-tone="warning"] {
	background: var(--ubos-warning-bg, #fff4d6);
	color: var(--ubos-warning, #8a5700);
	border: 1px solid var(--ubos-warning-border, #f2cf78);
}

.ubos-login-fallback-note {
	margin: 12px 0 0;
	text-align: center;
	color: var(--ubos-muted, #56647a);
	font-size: 11px;
	line-height: 1.5;
}

.ubos-passkey-intro {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding: 14px;
	border: 1px solid rgba(124, 58, 237, .14);
	border-radius: 14px;
	background: linear-gradient(135deg, rgba(124, 58, 237, .07), rgba(8, 43, 103, .04));
}

.ubos-passkey-symbol {
	width: 42px;
	height: 42px;
	flex: 0 0 42px;
	display: grid;
	place-items: center;
	border-radius: 13px;
	background: #fff;
	color: var(--ubos-violet, #7c3aed);
	box-shadow: 0 8px 20px rgba(124, 58, 237, .12);
	font-size: 24px;
	font-weight: 900;
}

.ubos-passkey-intro strong,
.ubos-passkey-intro p {
	display: block;
	margin: 0;
}

.ubos-passkey-intro strong {
	color: var(--ubos-text, #12213a);
	font-size: 14px;
}

.ubos-passkey-intro p {
	margin-top: 4px;
	color: var(--ubos-muted, #56647a);
	font-size: 12px;
	line-height: 1.55;
}

.ubos-passkey-setup {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: 12px;
	margin-top: 14px;
}

.ubos-passkey-setup label {
	display: grid;
	gap: 6px;
}

.ubos-passkey-setup label span {
	color: var(--ubos-text, #12213a);
	font-size: 12px;
	font-weight: 700;
}

.ubos-passkey-setup input {
	width: 100%;
	min-height: 44px;
	border: 1px solid var(--ubos-border, #dfe5ee);
	border-radius: 11px;
	background: var(--ubos-surface, #fff);
	color: var(--ubos-text, #12213a);
	padding: 0 12px;
	font: inherit;
	font-size: 14px;
}

.ubos-passkey-setup input:focus {
	outline: 3px solid rgba(8, 43, 103, .14);
	border-color: var(--ubos-navy, #082b67);
}

.ubos-passkey-setup > button {
	grid-column: 1 / -1;
	justify-self: start;
}

.ubos-passkey-list {
	display: grid;
	gap: 10px;
	margin-top: 14px;
}

.ubos-passkey-loading,
.ubos-passkey-empty {
	min-height: 72px;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 9px;
	border: 1px dashed var(--ubos-border, #dfe5ee);
	border-radius: 13px;
	color: var(--ubos-muted, #56647a);
	font-size: 12px;
	text-align: center;
}

.ubos-passkey-loading span {
	width: 16px;
	height: 16px;
	border: 2px solid rgba(8, 43, 103, .16);
	border-top-color: var(--ubos-navy, #082b67);
	border-radius: 50%;
	animation: ubos-passkey-spin .8s linear infinite;
}

.ubos-passkey-empty {
	flex-direction: column;
}

.ubos-passkey-empty strong {
	color: var(--ubos-text, #12213a);
}

.ubos-passkey-item {
	display: grid;
	grid-template-columns: 38px minmax(0, 1fr) auto;
	align-items: center;
	gap: 10px;
	padding: 12px;
	border: 1px solid var(--ubos-border, #dfe5ee);
	border-radius: 13px;
	background: var(--ubos-surface, #fff);
}

.ubos-passkey-item-icon {
	width: 38px;
	height: 38px;
	display: grid;
	place-items: center;
	border-radius: 11px;
	background: #eaf8f2;
	color: #0c6b48;
	font-weight: 900;
}

.ubos-passkey-item-copy {
	min-width: 0;
}

.ubos-passkey-item-copy strong,
.ubos-passkey-item-copy span {
	display: block;
}

.ubos-passkey-item-copy strong {
	color: var(--ubos-text, #12213a);
	font-size: 13px;
}

.ubos-passkey-item-copy span {
	margin-top: 3px;
	color: var(--ubos-muted, #56647a);
	font-size: 11px;
	line-height: 1.45;
}

.ubos-passkey-item-actions {
	display: flex;
	gap: 8px;
}

.ubos-passkey-item-actions button {
	min-height: 40px;
	padding-inline: 12px;
}

.ubos-passkey-footnote {
	margin: 12px 0 0;
	color: var(--ubos-muted, #56647a);
	font-size: 11px;
	line-height: 1.55;
}

.ubos-offline-shell {
	min-height: 100dvh;
	display: grid;
	grid-template-rows: auto 1fr auto;
	background: #f4f7fb;
	color: #12213a;
	font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.ubos-offline-topbar {
	min-height: calc(68px + env(safe-area-inset-top));
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 16px;
	padding: env(safe-area-inset-top) 20px 14px;
	background-color: #082b67;
	color: #fff;
}

.ubos-offline-topbar img {
	width: auto;
	height: 36px;
}

.ubos-offline-topbar span {
	font-size: 12px;
	font-weight: 800;
	letter-spacing: .08em;
}

.ubos-offline-content {
	display: grid;
	place-items: center;
	padding: 30px 20px;
}

.ubos-offline-card {
	width: min(100%, 520px);
	padding: 28px;
	border: 1px solid #dfe5ee;
	border-radius: 22px;
	background: #fff;
	box-shadow: 0 22px 60px rgba(8, 43, 103, .12);
	text-align: center;
}

.ubos-offline-card-icon {
	width: 64px;
	height: 64px;
	display: grid;
	place-items: center;
	margin: 0 auto 16px;
	border-radius: 20px;
	background: #edf4ff;
	color: #082b67;
	font-size: 28px;
}

.ubos-offline-card h1 {
	margin: 0;
	font-size: clamp(24px, 5vw, 34px);
}

.ubos-offline-card p {
	margin: 10px auto 0;
	max-width: 410px;
	color: #56647a;
	font-size: 14px;
	line-height: 1.65;
}

.ubos-offline-card button,
.ubos-offline-card a {
	min-height: 48px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin-top: 20px;
	padding: 0 18px;
	border: 0;
	border-radius: 12px;
	background: #b84700;
	color: #fff;
	font: inherit;
	font-weight: 800;
	text-decoration: none;
	cursor: pointer;
}

.ubos-offline-footer {
	padding: 16px 20px calc(16px + env(safe-area-inset-bottom));
	color: #6b7890;
	font-size: 11px;
	text-align: center;
}

.dark .ubos-passkey-intro,
.dark .ubos-passkey-item,
.dark .ubos-passkey-setup input {
	background: rgba(15, 31, 55, .88);
	border-color: rgba(255, 255, 255, .12);
}

.dark .ubos-passkey-symbol {
	background: rgba(124, 58, 237, .16);
}

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

@media (max-width: 760px) {
	.ubos-passkey-setup {
		grid-template-columns: 1fr;
	}

	.ubos-passkey-setup input {
		min-height: 48px;
		font-size: 16px;
	}

	.ubos-passkey-setup > button {
		width: 100%;
		min-height: 48px;
	}

	.ubos-passkey-item {
		grid-template-columns: 38px minmax(0, 1fr);
	}

	.ubos-passkey-item-actions {
		grid-column: 1 / -1;
	}

	.ubos-passkey-item-actions button {
		min-width: 44px;
		min-height: 44px;
		flex: 1;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ubos-passkey-login,
	.ubos-passkey-loading span {
		transition: none;
		animation: none;
	}
}


.ubos-portal-topbar button#ubos-portal-security-toggle {
	display: block;
	margin: 3px 0 0;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--ubos-navy, #082b67);
	font: inherit;
	font-size: 9px;
	font-weight: 800;
	cursor: pointer;
}

.ubos-portal-security-panel {
	max-width: 1240px;
	margin: 18px auto 0;
	padding: 0 22px;
}

.ubos-portal-security-panel .ubos-panel {
	margin: 0;
}

#ubos-portal-security-close {
	min-width: 44px;
	min-height: 44px;
	font-size: 24px;
}

@media (max-width: 760px) {
	.ubos-portal-security-panel {
		margin-top: 12px;
		padding: 0 14px;
	}
}
