/* ==========================================================================
   MPCCI — Sign-in screen
   Madhya Pradesh Chamber of Commerce and Industry, Gwalior
   --------------------------------------------------------------------------
   Standalone stylesheet. login_view.php does NOT include _header.php, so this
   file loads on its own -- no Bootstrap, no AdminLTE, nothing to override.

   The palette is sampled from assets/img/logo.png: the wordmark red and the
   gold of the 1906 wreath. The intent is institutional and a little formal --
   this is a 100+ year old chamber of commerce, not a consumer app.
   ========================================================================== */

/* --------------------------------------------------------------------------
   01. Tokens
   -------------------------------------------------------------------------- */
:root {
	/* Brand, from the logo */
	--red-500: #e0330a;	/* wordmark red, deepened slightly for UI use */
	--red-600: #c22a08;
	--red-700: #a32314;
	--red-900: #5c1108;

	--gold-300: #e6d696;	/* wreath highlight */
	--gold-400: #d8c587;
	--gold-500: #c5a866;	/* wreath body */
	--gold-600: #a58956;

	/* Neutrals */
	--ink-900: #1c1614;
	--ink-700: #453b37;
	--ink-500: #6b5f5a;
	--ink-400: #8c807a;
	--line: #e6ded9;
	--surface: #ffffff;
	--page: #f6f2ef;

	--danger: #c0271b;
	--danger-bg: #fdf0ee;
	--success: #16794c;
	--success-bg: #eefaf3;

	--r-sm: 8px;
	--r-md: 12px;
	--r-lg: 18px;

	--sh-sm: 0 1px 2px rgba(28, 22, 20, .06);
	--sh-md: 0 4px 16px rgba(28, 22, 20, .08);
	--sh-lg: 0 24px 60px rgba(28, 22, 20, .16);

	--ease: cubic-bezier(.4, 0, .2, 1);
}

/* --------------------------------------------------------------------------
   02. Base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

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

body {
	background: var(--page);
	color: var(--ink-900);
	font: 400 15px/1.55 "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

/* --------------------------------------------------------------------------
   03. Split layout
   Single column on phones; brand panel on the left from 900px up.
   -------------------------------------------------------------------------- */
.auth {
	min-height: 100vh;
	display: grid;
	grid-template-columns: 1fr;
	grid-template-rows: auto 1fr;
}

@media (min-width: 900px) {
	.auth {
		grid-template-columns: 1fr 480px;
		grid-template-rows: 1fr;
	}
}

/* --------------------------------------------------------------------------
   04. Brand panel
   -------------------------------------------------------------------------- */
.brand {
	position: relative;
	overflow: hidden;
	background:
		radial-gradient(900px 520px at 18% 12%, rgba(224, 51, 10, .38), transparent 62%),
		radial-gradient(700px 480px at 88% 78%, rgba(197, 168, 102, .26), transparent 60%),
		linear-gradient(158deg, #2a0d08 0%, #4a1109 52%, #2a0d08 100%);
	color: #fff;
	padding: 34px 28px;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	text-align: center;
}

@media (min-width: 900px) {
	.brand { padding: 64px 56px; }
}

/* Faint gold rule-work, faded out from the centre so it never competes
   with the emblem. Decorative only. */
.brand::after {
	content: "";
	position: absolute;
	inset: 0;
	background-image:
		linear-gradient(to right, rgba(197, 168, 102, .16) 1px, transparent 1px),
		linear-gradient(to bottom, rgba(197, 168, 102, .16) 1px, transparent 1px);
	background-size: 52px 52px;
	-webkit-mask-image: radial-gradient(circle at 50% 45%, #000 0%, transparent 72%);
	mask-image: radial-gradient(circle at 50% 45%, #000 0%, transparent 72%);
	pointer-events: none;
}

.brand > * { position: relative; z-index: 1; }

/* The logo is dark maroon type on transparent, so it cannot sit directly on
   the dark panel. It gets an ivory plaque -- which also reads as a seal. */
.brand-plaque {
	background: #fffdfa;
	border-radius: var(--r-lg);
	padding: 20px 26px;
	box-shadow: var(--sh-lg), 0 0 0 1px rgba(197, 168, 102, .5);
	max-width: 430px;
	width: 100%;
}

.brand-plaque img {
	display: block;
	width: 100%;
	height: auto;
	max-width: 370px;
	margin: 0 auto;
}

.brand-est {
	margin: 22px 0 0;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: .18em;
	text-transform: uppercase;
	color: var(--gold-400);
}

.brand-rule {
	width: 54px;
	height: 2px;
	margin: 14px auto 0;
	border: 0;
	background: linear-gradient(90deg, transparent, var(--gold-500), transparent);
}

.brand-address {
	margin: 14px auto 0;
	max-width: 38ch;
	font-size: 13px;
	line-height: 1.6;
	color: rgba(255, 255, 255, .72);
}

/* On phones the panel is a slim bar: keep the logo, drop the supporting text. */
@media (max-width: 899px) {
	.brand { padding: 26px 20px; }
	.brand-plaque { max-width: 300px; padding: 14px 18px; }
	.brand-est { margin-top: 16px; }
	.brand-rule, .brand-address { display: none; }
}

/* --------------------------------------------------------------------------
   05. Form panel
   -------------------------------------------------------------------------- */
.form-panel {
	background: var(--surface);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 40px 22px;
}

@media (min-width: 900px) {
	.form-panel { padding: 48px 44px; }
}

.form-card {
	width: 100%;
	max-width: 380px;
}

.form-card h1 {
	margin: 0;
	font-size: 26px;
	font-weight: 650;
	letter-spacing: -.015em;
	color: var(--ink-900);
}

.form-card .sub {
	margin: 6px 0 26px;
	font-size: 14px;
	color: var(--ink-500);
}

/* --------------------------------------------------------------------------
   06. Alerts
   -------------------------------------------------------------------------- */
.alert {
	display: flex;
	gap: 10px;
	align-items: flex-start;
	margin: 0 0 18px;
	padding: 11px 13px;
	border-radius: var(--r-sm);
	font-size: 13.5px;
	line-height: 1.5;
}

.alert svg { flex: 0 0 auto; margin-top: 1px; }

.alert-error {
	background: var(--danger-bg);
	color: var(--danger);
	border: 1px solid rgba(192, 39, 27, .22);
}

.alert-success {
	background: var(--success-bg);
	color: var(--success);
	border: 1px solid rgba(22, 121, 76, .22);
}

/* The app's own messages arrive as pre-built HTML (a <p> with inline colour).
   Neutralise that inline styling so it matches the alert box. */
.alert p { margin: 0; color: inherit !important; font-size: inherit !important; }

/* --------------------------------------------------------------------------
   07. Fields
   -------------------------------------------------------------------------- */
.field { margin-bottom: 15px; }

.field label {
	display: block;
	margin-bottom: 6px;
	font-size: 12.5px;
	font-weight: 600;
	color: var(--ink-700);
}

.field .wrap {
	position: relative;
	display: flex;
	align-items: center;
}

.field .wrap > svg {
	position: absolute;
	left: 12px;
	color: var(--ink-400);
	pointer-events: none;
}

.field input {
	width: 100%;
	height: 46px;
	padding: 0 14px 0 40px;
	font: inherit;
	font-size: 14.5px;
	color: var(--ink-900);
	background: #fcfaf9;
	border: 1px solid var(--line);
	border-radius: var(--r-sm);
	outline: 0;
	transition: border-color .16s var(--ease), box-shadow .16s var(--ease), background .16s var(--ease);
}

.field input::placeholder { color: var(--ink-400); }

.field input:hover { border-color: #d8ccc5; }

.field input:focus {
	background: #fff;
	border-color: var(--red-500);
	box-shadow: 0 0 0 3px rgba(224, 51, 10, .14);
}

/* Password reveal toggle */
.field .toggle {
	position: absolute;
	right: 6px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	padding: 0;
	border: 0;
	border-radius: 7px;
	background: transparent;
	color: var(--ink-400);
	cursor: pointer;
	transition: color .16s var(--ease), background .16s var(--ease);
}

.field .toggle:hover { color: var(--ink-700); background: #f2ebe7; }

.field .toggle:focus-visible {
	outline: 0;
	box-shadow: 0 0 0 3px rgba(224, 51, 10, .18);
	color: var(--ink-700);
}

.field input[type="password"], .field input#password { padding-right: 46px; }

/* --------------------------------------------------------------------------
   08. Submit
   -------------------------------------------------------------------------- */
.btn-submit {
	width: 100%;
	height: 47px;
	margin-top: 8px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 9px;
	font: inherit;
	font-size: 15px;
	font-weight: 600;
	color: #fff;
	background: linear-gradient(180deg, var(--red-500), var(--red-600));
	border: 0;
	border-radius: var(--r-sm);
	box-shadow: 0 1px 2px rgba(92, 17, 8, .28);
	cursor: pointer;
	transition: transform .14s var(--ease), box-shadow .16s var(--ease), filter .16s var(--ease);
}

.btn-submit:hover {
	filter: brightness(1.05);
	box-shadow: 0 6px 18px rgba(194, 42, 8, .3);
}

.btn-submit:active { transform: translateY(1px); }

.btn-submit:focus-visible {
	outline: 0;
	box-shadow: 0 0 0 3px rgba(224, 51, 10, .3);
}

.btn-submit svg { transition: transform .16s var(--ease); }
.btn-submit:hover svg { transform: translateX(2px); }

/* --------------------------------------------------------------------------
   09. Footer
   -------------------------------------------------------------------------- */
.form-foot {
	margin-top: 26px;
	padding-top: 16px;
	border-top: 1px solid var(--line);
	font-size: 12px;
	line-height: 1.6;
	color: var(--ink-400);
	text-align: center;
}

.form-foot a { color: var(--ink-500); text-decoration: none; font-weight: 600; }
.form-foot a:hover { color: var(--red-600); text-decoration: underline; }

/* --------------------------------------------------------------------------
   10. Reduced motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		animation-duration: .001ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: .001ms !important;
	}
}
