/* Path: Frontend/src/routes/auth/login.module.scss */

.login-page {
    min-height: 100dvh;
    width: 100%;
    overflow: clip;
    display: grid;
    place-items: center;
    padding: 1.5rem;
    background:
        radial-gradient(circle at top left, var(--page-glow-primary), transparent 30%),
        radial-gradient(circle at bottom right, var(--page-glow-secondary), transparent 28%),
        linear-gradient(135deg, var(--page-gradient-start), var(--page-gradient-end));
}

.login-shell {
    width: min(100%, 70rem);
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
    align-items: center;

    @include respond(tablet) {
        grid-template-columns: minmax(0, 1.05fr) minmax(22rem, 28rem);
        align-items: center;
        gap: 4rem;
    }
}

.mobileTopbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;

	@include respond(tablet) {
		display: none;
	}
}

.login-copy {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 32rem;

	@media (max-width: 767px) {
		display: none;
	}
}

.brandLogo {
	width: min(100%, 12rem);
	height: auto;
	display: block;
}

.mobileLogo {
	width: min(100%, 8.75rem);
	height: auto;
	display: block;
	flex-shrink: 0;
}

.back-link,
.description,
.card-header p,
.field-group label,
.field-group input,
.field-header a,
.checkbox-row,
.footer-copy,
.benefit-item p {
    @include text-smallest;
}

.back-link,
.field-header a,
.footer-copy a {
    color: var(--primary);
}

.back-link {
    width: fit-content;
    font-weight: 500;
}

.eyebrow {
    @include text-smallest;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.title {
    font-size: clamp(2.8rem, 2.2rem + 1.9vw, 4.5rem);
    line-height: 1.05;
    max-width: 10ch;
}

.description,
.footer-copy,
.card-header p,
.benefit-item p {
    color: var(--text-muted);
}

.benefit-list {
    display: grid;
    gap: 1rem;
    margin-top: 0.75rem;
}

.benefit-item {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.875rem;
    align-items: start;
    padding: 1rem 1.1rem;
    background: var(--surface-soft);
    border: 1px solid var(--border-soft);
	border-radius: var(--radius-md);
}

.benefit-number {
    display: inline-grid;
    place-items: center;
	width: 2.25rem;
	height: 2.25rem;
	border-radius: var(--radius-full);
    color: var(--primary);
    background: var(--surface-accent-soft);
    font-size: 0.9rem;
    font-weight: 600;
}

.benefit-item h2 {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.login-card {
    display: flex;
    flex-direction: column;
    gap: 1.35rem;
    padding: 2rem;
    background: var(--surface-raised);
    border: 1px solid var(--border-strong);
    border-radius: 1.75rem;
    box-shadow: var(--shadow-elevated);
    backdrop-filter: blur(14px);

	@media (max-width: 767px) {
		padding: 1.2rem;
		gap: 1rem;
		border-radius: 1.2rem;
	}
}

.card-header {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    text-align: center;

	@media (max-width: 767px) {
		align-items: flex-start;
		text-align: left;
		gap: 0.2rem;
	}
}

.card-header h2 {
    font-size: 1.65rem;
    font-weight: 500;
}

.demoSection {
	display: flex;
	flex-direction: column;
	gap: 0.9rem;
	padding: 1.1rem;
	background: linear-gradient(180deg, color-mix(in srgb, var(--surface-soft) 82%, transparent), var(--surface-panel));
	border: 1px solid var(--border-soft);
	border-radius: var(--radius-xl);
}

.demoTitle {
	@include text-smallest;
	margin: 0;
	color: var(--text-muted);
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.08em;
}

.demoButtons {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.75rem;

	@include respond(phablet) {
		grid-template-columns: 1fr 1fr;
	}
}

.demoButton {
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	min-height: 4.75rem;
	padding: 1rem;
	color: var(--text);
	background: linear-gradient(180deg, color-mix(in srgb, var(--surface-raised) 92%, transparent), var(--surface-panel));
	border: 1px solid var(--border-strong);
	border-radius: var(--radius-xl);
	box-shadow: var(--shadow-soft);
	cursor: pointer;
	position: relative;
	overflow: hidden;
	isolation: isolate;
	transition:
		border-color 0.2s ease,
		background-color 0.2s ease,
		transform 0.2s ease,
		box-shadow 0.2s ease;

	&::before {
		content: "";
		position: absolute;
		inset: 0;
		opacity: 0.9;
		z-index: -1;
		background: radial-gradient(circle at top right, color-mix(in srgb, var(--primary) 24%, transparent), transparent 48%);
	}

	&[data-demo="teacher"]::before {
		background: radial-gradient(circle at top right, color-mix(in srgb, var(--info) 24%, transparent), transparent 48%);
	}

	&:hover {
		transform: translateY(-2px);
		border-color: color-mix(in srgb, var(--primary) 28%, var(--border-strong));
		background: linear-gradient(180deg, color-mix(in srgb, var(--surface-raised) 96%, transparent), var(--surface-soft));
		box-shadow: var(--shadow-elevated);
	}

	&:focus-visible {
		outline: none;
		box-shadow: var(--focus-ring-primary-soft-shadow), var(--shadow-elevated);
	}

	&:disabled {
		cursor: wait;
		opacity: 0.7;
		transform: none;
		box-shadow: var(--shadow-soft);
	}

	@media (max-width: 767px) {
		min-height: 3.5rem;
		padding: 0.8rem 0.65rem;
		border-radius: var(--radius-lg);
	}
}

.demoButtonLabel {
	font-size: 1rem;
	line-height: 1.25;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--text);

	@media (max-width: 767px) {
		font-size: 0.82rem;
		letter-spacing: 0.04em;
	}
}

.formHint,
.formError {
	@include text-smallest;
	margin: 0;
	text-align: center;
}

.formHint {
	color: var(--text-muted);

	@media (max-width: 767px) {
		display: none;
	}
}

.formError {
	padding: 0.75rem 0.9rem;
	border-radius: var(--radius-sm);
	background: var(--surface-warning-soft, rgba(255, 196, 87, 0.12));
	border: 1px solid var(--border-warning, rgba(255, 196, 87, 0.35));
	color: var(--text);
}

.field-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.field-grid {
    display: grid;
    gap: 0.85rem;

    @media (min-width: 540px) {
        grid-template-columns: 1fr 1fr;
    }
}

.field-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.field-group input {
    width: 100%;
	padding: 0.95rem 1rem;
	color: var(--text);
	background: var(--surface-field);
	border: 1px solid var(--border-field);
	border-radius: var(--radius-md);
    outline: none;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background-color 0.2s ease;

	&:focus {
		border-color: var(--primary);
		box-shadow: var(--focus-ring-primary-shadow);
		background: var(--surface-field-focus);
	}
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.checkbox-row input {
    width: 1rem;
    height: 1rem;
}

.submitButton {
    width: 100%;
	padding: 0.95rem 1.25rem;
	color: var(--action-primary-text);
	background: linear-gradient(135deg, var(--action-primary-start), var(--action-primary-end));
	border: none;
	border-radius: var(--radius-full);
    cursor: pointer;
    font-weight: 500;
    box-shadow: var(--action-primary-shadow);
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        filter 0.2s ease;

	&:hover {
		transform: translateY(-1px);
		box-shadow: var(--action-primary-shadow-hover);
		filter: brightness(1.03);
	}

	&:disabled {
		cursor: wait;
		opacity: 0.75;
		transform: none;
		box-shadow: var(--action-primary-shadow);
	}
}

.footer-copy {
    text-align: center;

	@media (max-width: 767px) {
		display: none;
	}
}

.support-copy {
    text-align: center;
    color: var(--text-muted);

    a {
        color: var(--primary);
    }
}

@media (max-width: 767px) {
	.login-page {
		place-items: center;
		padding: 1rem;
	}

	.login-shell {
		width: 100%;
		max-width: 28rem;
		min-height: calc(100dvh - 2rem);
		gap: 1rem;
		justify-content: center;
		position: relative;
	}

	.mobileTopbar {
		position: absolute;
		top: 0;
		left: 0;
		right: 0;
	}

	.back-link {
		font-size: 0.82rem;
	}

	.eyebrow,
	.description,
	.card-header p:not(:first-child) {
		display: none;
	}

	.card-header h2 {
		font-size: 1.35rem;
	}

	.demoSection {
		padding: 0;
		gap: 0.7rem;
		background: transparent;
		border: none;
		border-radius: 0;
	}

	.demoTitle {
		font-size: 0.7rem;
	}

	.checkbox-row {
		font-size: 0.82rem;
	}
}
