/* ============================================================
   CSS CUSTOM PROPERTIES
   Dark mode is the default. Light mode overrides when the
   system preference is explicitly set to light.
   ============================================================ */

:root {
	--bg-page:       #1a1a1a;
	--bg-bar:        #0f0f0f;
	--bg-input:      #252525;
	--bg-btn:        #2a2a2a;
	--color-text:    #e0e0e0;
	--color-sub:     #888888;
	--border:        #444444;
	--accent:        #2a6db5;
	--accent-text:   #ffffff;
	--radius:        4px;
	--header-h:      44px;
	--footer-h:      44px;
}

@media (prefers-color-scheme: light) {
	:root {
		--bg-page:     #f9f9f9;
		--bg-bar:      #e9e9e9;
		--bg-input:    #ffffff;
		--bg-btn:      #f0f0f0;
		--color-text:  #333333;
		--color-sub:   #666666;
		--border:      #cccccc;
		--accent:      #3388cc;
		--accent-text: #ffffff;
	}
}


/* ============================================================
   RESET & BASE
   ============================================================ */

*, *::before, *::after {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

html, body {
	height: 100%;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 16px;
	background-color: var(--bg-page);
	color: var(--color-text);
}

a {
	color: var(--accent);
	text-decoration: none;
}

a:hover {
	text-decoration: underline;
}


/* ============================================================
   APP SHELL  (header / scrollable main / footer)
   ============================================================ */

#app {
	display: flex;
	flex-direction: column;
	height: 100%;
}

/* ── Header ── */
#site-header {
	flex-shrink: 0;
	height: var(--header-h);
	background: var(--bg-bar);
	border-bottom: 1px solid var(--border);
	display: flex;
	align-items: center;
	justify-content: center;
}

#site-header h1 {
	font-size: 1.05em;
	font-weight: 600;
	letter-spacing: 0.03em;
	color: var(--color-text);
}

/* ── Main (scrollable) ── */
#site-main {
	flex: 1;
	overflow-y: auto;
	background: var(--bg-page);
}

/* ── Footer / tab bar ── */
#site-footer {
	flex-shrink: 0;
	height: var(--footer-h);
	background: var(--bg-bar);
	border-top: 1px solid var(--border);
}


/* ============================================================
   TAB NAVIGATION
   ============================================================ */

.nav-tabs {
	display: flex;
	list-style: none;
	height: 100%;
}

.nav-tabs li {
	flex: 1;
}

.nav-tabs .nav-link {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 100%;
	font-size: 0.85em;
	color: var(--color-sub);
	border-right: 1px solid var(--border);
	transition: background 0.12s;
}

.nav-tabs li:last-child .nav-link {
	border-right: none;
}

.nav-tabs .nav-link:hover {
	background: color-mix(in srgb, var(--accent) 15%, transparent);
	text-decoration: none;
}

.nav-tabs .nav-link.active {
	background: var(--accent);
	color: var(--accent-text);
}


/* ============================================================
   PAGE SECTIONS
   ============================================================ */

.page {
	display: none;
	padding: 1em;
}

.page.active {
	display: block;
}


/* ============================================================
   FORM ELEMENTS
   ============================================================ */

label {
	display: block;
	font-size: 0.85em;
	margin-bottom: 0.3em;
	color: var(--color-text);
}

input[type="text"],
input[type="password"] {
	display: block;
	width: 100%;
	padding: 0.55em 0.75em;
	margin-bottom: 0.75em;
	background: var(--bg-input);
	color: var(--color-text);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	font-size: 1em;
	text-align: center;
	outline: none;
	appearance: none;
}

input[type="text"]:focus,
input[type="password"]:focus {
	border-color: var(--accent);
}

input[type="text"][readonly] {
	cursor: default;
	color: var(--color-sub);
}

input[type="checkbox"],
input[type="radio"] {
	accent-color: var(--accent);
	cursor: pointer;
}


/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
	display: inline-block;
	padding: 0.45em 1em;
	background: var(--bg-btn);
	color: var(--color-text);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	font-size: 0.85em;
	font-family: inherit;
	cursor: pointer;
	text-align: center;
	user-select: none;
	transition: border-color 0.12s;
}

.btn:hover,
.btn:focus {
	border-color: var(--accent);
	outline: none;
}

.btn-block {
	display: block;
	width: 100%;
	padding: 0.6em;
	margin-top: 0.1em;
	margin-bottom: 0.75em;
	font-size: 0.95em;
}


/* ============================================================
   GENERATOR FORM LAYOUT
   ============================================================ */

/* Row: Show/Hide Key  +  Include Symbols */
.row-controls {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 0.75em;
	gap: 0.5em;
}

.toggle-wrap {
	display: flex;
}

/* Row: short / long algorithm */
.row-algo {
	display: flex;
	gap: 1.5em;
	margin-bottom: 0.75em;
}

.check-label,
.radio-label {
	display: flex;
	align-items: center;
	gap: 0.35em;
	font-size: 0.9em;
	color: var(--color-text);
	cursor: pointer;
	user-select: none;
}

/* Countdown */
.countdown-wrap {
	display: flex;
	align-items: center;
	gap: 0.6em;
	margin-top: 0.4em;
	font-size: 0.82em;
	color: var(--color-sub);
}

.countdown-wrap[hidden] {
	display: none;
}


/* ============================================================
   ABOUT PAGE
   ============================================================ */

#aboutPassifier h2 {
	font-size: 1.15em;
	margin-bottom: 0.15em;
}

#aboutPassifier .description {
	display: block;
	font-style: italic;
	color: var(--color-sub);
	margin-bottom: 1em;
}

#aboutPassifier p {
	line-height: 1.4em;
	margin-bottom: 0.75em;
	font-size: 0.95em;
}

#aboutPassifier .disclaimer {
	font-style: italic;
	font-size: 0.82em;
	color: var(--color-sub);
}
