﻿/* =============================================================================
   Trustvane — shared auth layout (login / register / forgot / reset)
   Path: C:\NewPD\Peak\Peak\Trustvane.Web\Content\auth.css
   Load AFTER trustvane-tokens.css. Component styles only (uses --tv-* tokens).

   Wide split card on large screens: a brand/gradient panel + a form panel, so
   the card fills horizontal space instead of a narrow strip. Inputs stay
   readable via an inner max-width; the brand panel absorbs the extra width.
   Mobile-first: single column, brand panel hidden.
   ============================================================================= */

.tv-auth {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: var(--tv-space-5) var(--tv-space-4);
	min-height: calc(100vh - 72px); /* full height minus navbar */
}

.tv-auth-card {
	width: 100%;
	max-width: 480px; /* mobile / small: compact single column */
	background: var(--tv-surface);
	border: 1px solid var(--tv-border);
	border-radius: var(--tv-radius-lg);
	box-shadow: var(--tv-shadow-lg);
	overflow: hidden;
	display: grid;
	grid-template-columns: 1fr; /* single column by default */
}

/* ---- Brand panel (left) — only appears on large screens ---- */
.tv-auth-brand {
	display: none;
}

/* ---- Form panel (right / only) ---- */
.tv-auth-form {
	padding: clamp(1.5rem, 1rem + 3vw, 3rem);
}

	.tv-auth-form .tv-form-inner {
		max-width: 420px; /* keep fields readable inside a wide card */
		margin-inline: auto;
		width: 100%;
	}

.tv-auth-title {
	font-family: var(--tv-font-heading);
	font-weight: var(--tv-weight-heading);
	color: var(--tv-color-heading);
	font-size: var(--tv-text-2xl);
	margin: 0 0 var(--tv-space-2);
}

.tv-auth-subtitle {
	color: var(--tv-color-text-muted);
	margin: 0 0 var(--tv-space-5);
}

/* ---- Widen the card into a split layout from lg up ---- */
@media (min-width: 992px) {
	.tv-auth-card {
		max-width: 960px;
		grid-template-columns: 1.05fr 1fr; /* brand | form */
	}

	.tv-auth-brand {
		display: flex;
		flex-direction: column;
		justify-content: center;
		gap: var(--tv-space-4);
		padding: var(--tv-space-7);
		background: var(--tv-gradient-dark);
		color: #eef1fb;
	}

		.tv-auth-brand .tv-auth-logo {
			height: 44px;
			width: auto;
			align-self: flex-start;
			max-width: 100%;
		}

		.tv-auth-brand h2 {
			color: #fff;
			font-size: var(--tv-text-2xl);
			margin: 0;
		}

		.tv-auth-brand p {
			color: #c4cbe6;
			margin: 0;
			line-height: var(--tv-leading-body);
		}

		.tv-auth-brand .tv-auth-points {
			list-style: none;
			margin: var(--tv-space-3) 0 0;
			padding: 0;
			display: grid;
			gap: var(--tv-space-3);
		}

			.tv-auth-brand .tv-auth-points li {
				display: flex;
				align-items: flex-start;
				gap: var(--tv-space-3);
				color: #dfe4f5;
			}

			.tv-auth-brand .tv-auth-points svg {
				flex: 0 0 auto;
				margin-top: 2px;
				color: var(--tv-teal-bright);
			}
}

@media (min-width: 1200px) {
	.tv-auth-card {
		max-width: 1040px;
	}
}

/* ---- Form fields ---- */
.tv-field {
	margin-bottom: var(--tv-space-4);
}

	.tv-field label {
		display: block;
		font-weight: var(--tv-weight-medium);
		font-size: var(--tv-text-sm);
		color: var(--tv-color-heading);
		margin-bottom: var(--tv-space-1);
	}

	.tv-field .form-control {
		border-radius: var(--tv-radius);
		padding: 0.7rem 0.9rem;
		border-color: var(--tv-border);
	}

		.tv-field .form-control:focus {
			border-color: var(--tv-color-primary);
			box-shadow: var(--tv-focus-ring);
		}

		.tv-field .form-control.is-invalid {
			border-color: #dc3545;
		}

/* Field-level validation message */
.tv-field-error {
	display: none;
	color: #dc3545;
	font-size: var(--tv-text-sm);
	margin-top: var(--tv-space-1);
}

.tv-field.has-error .tv-field-error {
	display: block;
}

.tv-field.has-error .form-control {
	border-color: #dc3545;
}

/* Password field with show/hide toggle */
.tv-pw-wrap {
	position: relative;
}

	.tv-pw-wrap .form-control {
		padding-right: 3rem;
	}

.tv-pw-toggle {
	position: absolute;
	top: 0;
	right: 0;
	height: 100%;
	width: 3rem;
	border: 0;
	background: transparent;
	color: var(--tv-muted);
	display: grid;
	place-items: center;
	cursor: pointer;
}

	.tv-pw-toggle:hover {
		color: var(--tv-color-primary);
	}

/* ---- Buttons ---- */
.tv-btn-submit {
	width: 100%;
	background: var(--tv-gradient-brand);
	color: #fff;
	border: 0;
	font-weight: var(--tv-weight-medium);
	border-radius: var(--tv-radius-pill);
	padding: 0.75rem 1.25rem;
	transition: filter var(--tv-transition), box-shadow var(--tv-transition);
}

	.tv-btn-submit:hover:not(:disabled) {
		color: #fff;
		filter: brightness(1.05);
		box-shadow: var(--tv-shadow);
	}

	.tv-btn-submit:disabled {
		opacity: 0.65;
		cursor: default;
	}

/* ---- Inline general error/success banner ---- */
.tv-auth-banner {
	display: none;
	align-items: center;
	gap: var(--tv-space-2);
	padding: 0.75rem 1rem;
	border-radius: var(--tv-radius);
	font-size: var(--tv-text-sm);
	margin-bottom: var(--tv-space-4);
}

	.tv-auth-banner.is-error {
		display: flex;
		background: rgba(220,53,69,.10);
		color: #b02a37;
	}

	.tv-auth-banner.is-success {
		display: flex;
		background: rgba(16,185,129,.12);
		color: var(--tv-emerald-deep);
	}

/* ---- Footer links ---- */
.tv-auth-alt {
	margin-top: var(--tv-space-5);
	text-align: center;
	color: var(--tv-color-text-muted);
	font-size: var(--tv-text-sm);
}

	.tv-auth-alt a {
		font-weight: var(--tv-weight-medium);
	}

.tv-auth-row {
	display: flex;
	justify-content: flex-end;
	margin-top: calc(-1 * var(--tv-space-2));
	margin-bottom: var(--tv-space-4);
}

	.tv-auth-row a {
		font-size: var(--tv-text-sm);
		font-weight: var(--tv-weight-medium);
	}

/* =============================================================================
   Password strength meter + requirement checklist (registration)
   ============================================================================= */
.tv-pw-meter {
	height: 6px;
	border-radius: var(--tv-radius-pill);
	background: var(--tv-border);
	overflow: hidden;
	margin-top: var(--tv-space-2);
}

.tv-pw-meter-bar {
	height: 100%;
	width: 0;
	border-radius: var(--tv-radius-pill);
	transition: width var(--tv-transition), background var(--tv-transition);
}

	.tv-pw-meter-bar.s1 {
		width: 20%;
		background: #dc3545;
	}

	.tv-pw-meter-bar.s2 {
		width: 45%;
		background: var(--tv-gold-deep);
	}

	.tv-pw-meter-bar.s3 {
		width: 70%;
		background: var(--tv-gold);
	}

	.tv-pw-meter-bar.s4 {
		width: 88%;
		background: var(--tv-teal);
	}

	.tv-pw-meter-bar.s5 {
		width: 100%;
		background: var(--tv-emerald);
	}

.tv-pw-label {
	font-size: var(--tv-text-xs);
	font-weight: var(--tv-weight-medium);
	margin-top: var(--tv-space-1);
	color: var(--tv-muted);
	text-align: right;
}

.tv-pw-reqs {
	list-style: none;
	margin: var(--tv-space-3) 0 0;
	padding: 0;
	display: grid;
	gap: var(--tv-space-1);
}

	.tv-pw-reqs li {
		display: flex;
		align-items: center;
		gap: var(--tv-space-2);
		font-size: var(--tv-text-sm);
		color: var(--tv-muted);
		transition: color var(--tv-transition);
	}

		.tv-pw-reqs li .tv-req-dot {
			flex: 0 0 auto;
			width: 16px;
			height: 16px;
			border-radius: 50%;
			border: 2px solid var(--tv-border);
			display: grid;
			place-items: center;
		}

			.tv-pw-reqs li .tv-req-dot svg {
				width: 10px;
				height: 10px;
				opacity: 0;
				color: #fff;
			}

		.tv-pw-reqs li.is-met {
			color: var(--tv-emerald-deep);
		}

			.tv-pw-reqs li.is-met .tv-req-dot {
				background: var(--tv-emerald);
				border-color: var(--tv-emerald);
			}

				.tv-pw-reqs li.is-met .tv-req-dot svg {
					opacity: 1;
				}
