:root {
	--bg-main: #0a0d14;
	--bg-card: #111726;
	--bg-input: #0b0f19;
	--bg-input-focus: #0f1523;
	--bg-subtle: #182238;
	
	--border: #1e293b;
	--border-active: #38bdf8;
	--border-focus: #0ea5e9;
	
	--text-main: #f1f5f9;
	--text-muted: #94a3b8;
	--text-dim: #64748b;
	
	--accent-cyan: #06b6d4;
	--accent-emerald: #10b981;
	--accent-indigo: #6366f1;
	--accent-blue: #3b82f6;
	
	--danger-bg: rgba(239, 68, 68, 0.12);
	--danger-border: rgba(239, 68, 68, 0.35);
	--danger-text: #fca5a5;
	
	--success-bg: rgba(16, 185, 129, 0.12);
	--success-border: rgba(16, 185, 129, 0.35);
	--success-text: #6ee7b7;
	
	--radius-sm: 6px;
	--radius-md: 10px;
	--radius-lg: 14px;
	--radius-xl: 18px;
	
	--font-sans: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	--font-mono: "Fira Code", "SFMono-Regular", Consolas, Menlo, monospace;
}

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

body {
	background-color: var(--bg-main);
	color: var(--text-main);
	font-family: var(--font-sans);
	line-height: 1.55;
	min-height: 100vh;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	display: flex;
	justify-content: center;
	padding: 1.5rem 1rem 3rem;
}

#root {
	width: 100%;
	display: flex;
	justify-content: center;
}

.app-wrapper {
	width: 100%;
	max-width: 44rem;
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
}

/* Ambient glow background decoration */
.ambient-glow {
	position: absolute;
	top: -60px;
	left: 50%;
	transform: translateX(-50%);
	width: 80%;
	height: 250px;
	background: radial-gradient(ellipse at center, rgba(6, 182, 212, 0.15), rgba(99, 102, 241, 0.08), transparent 70%);
	pointer-events: none;
	z-index: 0;
	filter: blur(40px);
}

/* Header */
.header {
	position: relative;
	z-index: 1;
	text-align: center;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.5rem;
	padding-top: 1rem;
}

.brand-badge {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.3rem 0.85rem;
	border-radius: 9999px;
	background: rgba(16, 185, 129, 0.08);
	border: 1px solid rgba(16, 185, 129, 0.25);
	color: var(--accent-emerald);
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.brand-badge-dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background-color: var(--accent-emerald);
	box-shadow: 0 0 8px var(--accent-emerald);
	animation: pulse-dot 2s infinite ease-in-out;
}

@keyframes pulse-dot {
	0%, 100% { opacity: 1; transform: scale(1); }
	50% { opacity: 0.4; transform: scale(0.85); }
}

.title {
	font-size: clamp(2rem, 5vw, 2.75rem);
	font-weight: 800;
	letter-spacing: -0.03em;
	color: #ffffff;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.4rem;
}

.title-shield {
	font-size: 0.9em;
}

.text-accent {
	background: linear-gradient(135deg, #38bdf8 0%, #10b981 100%);
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
}

.subtitle {
	font-size: 1.125rem;
	font-weight: 500;
	color: #e2e8f0;
	margin-top: 0.1rem;
}

.security-subtext {
	font-size: 0.85rem;
	color: var(--text-muted);
	max-width: 34rem;
}

/* Main Card */
.main-card {
	position: relative;
	z-index: 1;
	background: var(--bg-card);
	border: 1px solid var(--border);
	border-radius: var(--radius-xl);
	padding: 1.5rem;
	box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.03);
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
}

.card-form-wrapper {
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
}

/* Card Top Shortcuts */
.card-top-actions {
	display: flex;
	justify-content: flex-end;
	align-items: center;
	gap: 0.5rem;
	padding-bottom: 0.5rem;
	border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.chip-btn {
	background: rgba(56, 189, 248, 0.1);
	border: 1px solid rgba(56, 189, 248, 0.2);
	color: #7dd3fc;
	font-size: 0.775rem;
	font-weight: 600;
	padding: 0.35rem 0.75rem;
	border-radius: var(--radius-sm);
	cursor: pointer;
	transition: all 0.15s ease;
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
}

.chip-btn:hover {
	background: rgba(56, 189, 248, 0.18);
	border-color: rgba(56, 189, 248, 0.4);
	color: #e0f2fe;
}

.chip-btn-muted {
	background: rgba(148, 163, 184, 0.08);
	border-color: rgba(148, 163, 184, 0.15);
	color: var(--text-muted);
}

.chip-btn-muted:hover {
	background: rgba(239, 68, 68, 0.12);
	border-color: rgba(239, 68, 68, 0.3);
	color: #fca5a5;
}

/* Form Groups */
.form-group {
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
}

.label-row {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	font-size: 0.875rem;
}

.field-label {
	font-weight: 600;
	color: #e2e8f0;
	letter-spacing: -0.01em;
}

.char-count {
	font-size: 0.75rem;
	color: var(--text-dim);
	font-family: var(--font-mono);
}

.strength-badge {
	font-size: 0.75rem;
	font-weight: 600;
	font-family: var(--font-mono);
}

.textarea-container {
	position: relative;
}

.input-textarea {
	width: 100%;
	background: var(--bg-input);
	border: 1px solid var(--border);
	border-radius: var(--radius-md);
	color: var(--text-main);
	font-family: var(--font-mono);
	font-size: 0.925rem;
	line-height: 1.5;
	padding: 0.85rem 1rem;
	resize: vertical;
	min-height: 110px;
	transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.input-textarea:focus {
	outline: none;
	background: var(--bg-input-focus);
	border-color: var(--border-active);
	box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

.password-input-wrapper {
	position: relative;
	display: flex;
	align-items: center;
}

.password-icon {
	position: absolute;
	left: 0.85rem;
	font-size: 0.95rem;
	pointer-events: none;
	user-select: none;
	opacity: 0.7;
}

.input-password {
	width: 100%;
	background: var(--bg-input);
	border: 1px solid var(--border);
	border-radius: var(--radius-md);
	color: var(--text-main);
	font-family: var(--font-sans);
	font-size: 0.95rem;
	padding: 0.75rem 5.5rem 0.75rem 2.6rem;
	transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.input-password:focus {
	outline: none;
	background: var(--bg-input-focus);
	border-color: var(--border-active);
	box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

.btn-toggle-password {
	position: absolute;
	right: 0.5rem;
	background: transparent;
	border: 1px solid rgba(255, 255, 255, 0.08);
	color: var(--text-muted);
	font-size: 0.75rem;
	font-weight: 600;
	padding: 0.35rem 0.6rem;
	border-radius: var(--radius-sm);
	cursor: pointer;
	transition: all 0.15s ease;
}

.btn-toggle-password:hover {
	background: rgba(255, 255, 255, 0.08);
	color: var(--text-main);
}

.strength-meter {
	width: 100%;
	height: 4px;
	background: rgba(255, 255, 255, 0.06);
	border-radius: 999px;
	overflow: hidden;
	margin-top: 0.25rem;
}

.strength-meter-bar {
	height: 100%;
	transition: width 0.3s ease, background-color 0.3s ease;
}

/* Status Alerts */
.status-alert {
	display: flex;
	align-items: flex-start;
	gap: 0.65rem;
	padding: 0.85rem 1rem;
	border-radius: var(--radius-md);
	font-size: 0.875rem;
	line-height: 1.45;
	animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
	from { opacity: 0; transform: translateY(-4px); }
	to { opacity: 1; transform: translateY(0); }
}

.status-alert-error {
	background: var(--danger-bg);
	border: 1px solid var(--danger-border);
	color: var(--danger-text);
}

.status-alert-success {
	background: var(--success-bg);
	border: 1px solid var(--success-border);
	color: var(--success-text);
}

.alert-icon {
	font-size: 1.05rem;
	flex-shrink: 0;
}

.alert-text {
	font-weight: 500;
}

/* Buttons Section */
.actions-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.85rem;
	margin-top: 0.25rem;
}

@media (max-width: 440px) {
	.actions-row {
		grid-template-columns: 1fr;
	}
}

.btn-action {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.6rem;
	padding: 0.9rem 1.25rem;
	border-radius: var(--radius-md);
	font-size: 1rem;
	font-weight: 700;
	font-family: var(--font-sans);
	letter-spacing: -0.01em;
	cursor: pointer;
	border: 1px solid transparent;
	transition: all 0.15s ease;
	user-select: none;
}

.btn-action:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.btn-encrypt {
	background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
	color: #ffffff;
	box-shadow: 0 4px 14px rgba(14, 165, 233, 0.35);
}

.btn-encrypt:hover:not(:disabled) {
	background: linear-gradient(135deg, #38bdf8 0%, #0369a1 100%);
	box-shadow: 0 6px 20px rgba(14, 165, 233, 0.5);
	transform: translateY(-1px);
}

.btn-encrypt:active:not(:disabled) {
	transform: translateY(1px);
}

.btn-decrypt {
	background: linear-gradient(135deg, #059669 0%, #047857 100%);
	color: #ffffff;
	box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}

.btn-decrypt:hover:not(:disabled) {
	background: linear-gradient(135deg, #10b981 0%, #065f46 100%);
	box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
	transform: translateY(-1px);
}

.btn-decrypt:active:not(:disabled) {
	transform: translateY(1px);
}

.btn-icon {
	font-size: 1.15rem;
}

/* Result Section */
.result-section {
	margin-top: 0.5rem;
	background: rgba(0, 0, 0, 0.25);
	border: 1px solid var(--border);
	border-radius: var(--radius-lg);
	padding: 1.15rem;
	display: flex;
	flex-direction: column;
	gap: 0.85rem;
}

.result-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.result-title-group {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.result-badge {
	font-size: 0.6875rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	padding: 0.15rem 0.5rem;
	border-radius: 4px;
	background: rgba(56, 189, 248, 0.12);
	color: var(--accent-cyan);
}

.result-heading {
	font-size: 1rem;
	font-weight: 700;
	color: #ffffff;
}

.result-actions {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	flex-wrap: wrap;
}

.btn-utility {
	background: rgba(255, 255, 255, 0.06);
	border: 1px solid rgba(255, 255, 255, 0.12);
	color: var(--text-muted);
	font-size: 0.775rem;
	font-weight: 600;
	padding: 0.35rem 0.65rem;
	border-radius: var(--radius-sm);
	cursor: pointer;
	transition: all 0.15s ease;
}

.btn-utility:hover {
	background: rgba(255, 255, 255, 0.12);
	color: var(--text-main);
}

.btn-copy {
	background: #1e293b;
	border: 1px solid rgba(255, 255, 255, 0.15);
	color: #ffffff;
	font-size: 0.825rem;
	font-weight: 600;
	padding: 0.4rem 0.85rem;
	border-radius: var(--radius-sm);
	cursor: pointer;
	transition: all 0.2s ease;
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
}

.btn-copy:hover {
	background: #334155;
	border-color: rgba(255, 255, 255, 0.3);
}

.btn-copied {
	background: #065f46 !important;
	border-color: #10b981 !important;
	color: #a7f3d0 !important;
}

.result-box-container {
	position: relative;
}

.result-box {
	width: 100%;
	background: #070a10;
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: var(--radius-md);
	color: #a5f3fc;
	font-family: var(--font-mono);
	font-size: 0.9rem;
	line-height: 1.5;
	padding: 0.85rem 1rem;
	resize: vertical;
	min-height: 100px;
	word-break: break-all;
}

.result-box::placeholder {
	color: var(--text-dim);
	font-family: var(--font-sans);
}

.result-box:focus {
	outline: none;
	border-color: rgba(56, 189, 248, 0.4);
}

/* Crypto Inspector */
.crypto-inspector {
	background: rgba(15, 23, 42, 0.6);
	border: 1px dashed rgba(56, 189, 248, 0.25);
	border-radius: var(--radius-md);
	padding: 0.85rem;
	font-size: 0.775rem;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.inspector-title {
	font-weight: 600;
	color: #7dd3fc;
}

.inspector-grid {
	display: grid;
	gap: 0.35rem;
}

.inspector-item {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.4rem;
}

.inspector-label {
	color: var(--text-muted);
}

.inspector-code {
	background: rgba(0, 0, 0, 0.3);
	padding: 0.1rem 0.35rem;
	border-radius: 4px;
	color: #e2e8f0;
	font-family: var(--font-mono);
	word-break: break-all;
}

.inspector-val {
	color: #38bdf8;
	font-weight: 600;
	font-family: var(--font-mono);
}

/* Footer Section */
.footer-info {
	display: flex;
	flex-direction: column;
	gap: 1rem;
	padding: 0.5rem 0.25rem;
}

.security-badges {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 0.6rem;
}

.sec-badge {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	background: rgba(17, 24, 39, 0.6);
	border: 1px solid rgba(255, 255, 255, 0.05);
	padding: 0.55rem 0.75rem;
	border-radius: var(--radius-md);
	font-size: 0.75rem;
	color: var(--text-muted);
}

.sec-icon {
	font-size: 0.95rem;
	flex-shrink: 0;
}

.footer-note {
	text-align: center;
	font-size: 0.785rem;
	color: var(--text-dim);
	line-height: 1.5;
}

.footer-note strong {
	color: var(--text-muted);
}

/* Focus styles for accessibility */
:where(a, button, input, textarea):focus-visible {
	outline: 2px solid var(--border-active);
	outline-offset: 2px;
}
