/* Reset & Base */
:root {
	/* Default values, can be overridden by PHP-injected styles */
	--borderage-success: #10b981;
	--borderage-error: #ef4444;
	--borderage-warning: #f59e0b;
	--borderage-border: rgba(0, 0, 0, 0.1);
}

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

body {
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
	background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
	min-height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

/* Container */
.borderage-container {
	background: var(--borderage-bg);
	color: var(--borderage-text);
	border-radius: var(--borderage-radius, 24px);
	box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
	width: 100%;
	max-width: var(--borderage-max-width, 440px);
	padding: var(--borderage-padding, 36px 32px);
	position: relative;
}

/* Specific for verify-page which uses flex layout inside container */
.borderage-container.flex-layout {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	min-height: var(--borderage-min-height, auto);
	aspect-ratio: var(--borderage-aspect-ratio, auto);
}

.borderage-content {
	padding: var(--borderage-content-padding, 36px 32px);
	flex: 1;
	display: flex;
	flex-direction: column;
}

/* Header & Logo */
.borderage-header {
	padding: 32px 32px 24px;
	text-align: center;
	border-bottom: 1px solid var(--borderage-text-muted);
}

.borderage-logo {
	margin-bottom: 24px;
	text-align: center;
}
.borderage-logo.small-margin { margin-bottom: 16px; }

.borderage-logo img {
	max-height: 48px;
	width: auto;
}

/* Typography */
.borderage-title {
	font-size: var(--borderage-title-size, 1.5rem);
	font-weight: 700;
	margin-bottom: 12px;
	line-height: 1.3;
	text-align: center; /* Most have center, verify-page overrides if needed */
}
.borderage-title.success { color: var(--borderage-success); }
.borderage-title.error { color: var(--borderage-error); }
.borderage-title.warning { color: var(--borderage-warning); }

.borderage-subtitle,
.borderage-description,
.borderage-message {
	font-size: 0.9rem;
	color: var(--borderage-text-muted);
	line-height: 1.5;
	margin-bottom: 24px;
	text-align: center;
}

.borderage-description strong {
	color: var(--borderage-text);
	font-weight: 600;
}

/* Icons */
.borderage-icon {
	font-size: 64px;
	margin-bottom: 20px;
	text-align: center;
}
.borderage-icon.success { color: var(--borderage-success); }
.borderage-icon.error { color: var(--borderage-error); }
.borderage-icon.warning { color: var(--borderage-warning); }

/* Error Code */
.borderage-error-code {
	display: inline-block;
	background: rgba(239, 68, 68, 0.1);
	color: var(--borderage-error);
	padding: 4px 12px;
	border-radius: 20px;
	font-size: 0.8rem;
	font-weight: 600;
	margin-bottom: 16px;
}

/* Features List (verify-page) */
.borderage-features {
	display: flex;
	flex-direction: column;
	gap: var(--borderage-features-gap, 16px);
	margin-bottom: auto;
}

.borderage-feature {
	display: flex;
	gap: 12px;
}

.borderage-feature-icon {
	font-size: 1.25rem;
	flex-shrink: 0;
}

.borderage-feature-content h3 {
	font-size: 0.95rem;
	font-weight: 600;
	margin-bottom: 2px;
}

.borderage-feature-content p {
	font-size: 0.85rem;
	color: var(--borderage-text-muted);
	line-height: 1.4;
}

/* Forms */
.borderage-form {
	padding: 24px 32px 32px;
}

.borderage-form-intro {
	background: rgba(99, 102, 241, 0.1);
	border-radius: 8px;
	padding: 16px;
	margin-bottom: 24px;
	font-size: 0.85rem;
	line-height: 1.5;
	color: var(--borderage-text-muted);
}

.borderage-form-intro strong {
	color: var(--borderage-text);
}

.borderage-field {
	margin-bottom: 16px;
}

.borderage-field label {
	display: block;
	font-size: 0.85rem;
	font-weight: 600;
	margin-bottom: 6px;
	color: var(--borderage-text);
}

.borderage-field input {
	width: 100%;
	padding: 12px 14px;
	font-size: 0.95rem;
	border: 2px solid var(--borderage-text-muted);
	border-radius: 8px;
	background: var(--borderage-bg);
	color: var(--borderage-text);
	transition: border-color 0.2s;
}

.borderage-field input:focus {
	outline: none;
	border-color: var(--borderage-primary);
}

.borderage-error-message {
	background: rgba(239, 68, 68, 0.1);
	border: 1px solid var(--borderage-error);
	color: var(--borderage-error);
	padding: 12px 16px;
	border-radius: 8px;
	margin-bottom: 16px;
	font-size: 0.85rem;
}

/* Actions & Buttons */
.borderage-actions {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.borderage-actions.with-border {
	padding: var(--borderage-actions-padding, 20px 32px);
	border-top: 1px solid var(--borderage-border);
	background: var(--borderage-bg);
	flex-direction: row; /* verify-page uses row by default for actions with border */
}

.borderage-btn {
	padding: var(--borderage-btn-padding, 14px 24px);
	font-size: 0.95rem;
	font-weight: 600;
	border-radius: var(--borderage-btn-radius, 12px);
	cursor: pointer;
	transition: all 0.2s;
	text-decoration: none;
	text-align: center;
	border: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.borderage-actions.with-border .borderage-btn {
	flex: 1;
}

.borderage-btn-primary {
	background: var(--borderage-primary);
	color: #fff;
	border: 2px solid var(--borderage-primary);
}

.borderage-btn-primary:hover {
	transform: translateY(-2px);
	box-shadow: 0 8px 20px -8px var(--borderage-primary);
}

.borderage-btn-secondary {
	background: transparent;
	border: 2px solid var(--borderage-primary);
	color: var(--borderage-primary);
}

.borderage-btn-secondary:hover {
	background: var(--borderage-primary);
	color: #fff;
}

.borderage-btn-link {
	background: transparent;
	color: var(--borderage-text-muted);
	font-size: 0.85rem;
}

.borderage-btn-link:hover {
	color: var(--borderage-primary);
}

/* Links & Dividers */
.borderage-login-link {
	display: block;
	text-align: center;
	padding: 12px 32px;
	font-size: 0.85rem;
	color: var(--borderage-text-muted);
	text-decoration: none;
	transition: color 0.2s;
}

.borderage-login-link:hover {
	color: var(--borderage-primary);
}

.borderage-login-link span {
	text-decoration: underline;
}

.borderage-divider {
	display: flex;
	align-items: center;
	margin: 20px 0;
	color: var(--borderage-text-muted);
	font-size: 0.8rem;
}

.borderage-divider::before,
.borderage-divider::after {
	content: '';
	flex: 1;
	height: 1px;
	background: var(--borderage-text-muted);
}

.borderage-divider span {
	padding: 0 12px;
}

/* Debug Panel */
.borderage-debug-panel {
	position: fixed;
	top: 20px;
	right: 20px;
	background: rgba(251, 191, 36, 0.95);
	backdrop-filter: blur(8px);
	border-radius: 12px;
	padding: 14px 18px;
	max-width: 300px;
	box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.3);
	font-size: 12px;
	color: #78350f;
	z-index: 1000;
}

.borderage-debug-panel strong {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-bottom: 8px;
	font-size: 13px;
}

.borderage-debug-panel p {
	margin: 0 0 8px 0;
	line-height: 1.4;
}

.borderage-debug-panel code {
	background: rgba(255, 255, 255, 0.6);
	padding: 1px 5px;
	border-radius: 3px;
	font-family: monospace;
	font-size: 11px;
}

/* Responsive */
@media (max-width: 480px) {
	.borderage-container {
		max-width: 100%;
		aspect-ratio: auto !important; /* Override inline/var aspect ratio */
	}

	.borderage-debug-panel {
		position: relative;
		top: 0;
		right: 0;
		max-width: 100%;
		margin-bottom: 16px;
	}

	.borderage-actions.with-border {
		flex-direction: column;
	}
}
