/**
 * Squadra Page — /squadra/
 *
 * Pro layout with cinematic patterns from federation/event pages.
 * Uses NE design system tokens throughout.
 *
 * @see Issue #145, #763, #766
 */

/* ═══════════════════════════════════════════════════════
   MY SQUADRA — Cinematic Card
   ═══════════════════════════════════════════════════════ */
.ne-sq {
	background: var(--ne-surface);
	border: 1px solid var(--ne-border);
	border-radius: var(--ne-radius-lg);
	overflow: hidden;
	margin-bottom: var(--ne-space-6);
}

/* Banner */
.ne-sq__banner {
	position: relative;
	height: 200px;
	overflow: hidden;
}

.ne-sq__banner--empty {
	height: 80px;
	background: linear-gradient(135deg, var(--ne-accent-deep) 0%, var(--ne-accent-soft) 100%);
}

.ne-sq__banner img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	filter: saturate(1.1);
}

.ne-sq__banner-overlay {
	position: absolute;
	inset: 0;
	background: var(--ne-overlay-cinematic);
}

/* Identity row */
.ne-sq__identity {
	display: flex;
	align-items: center;
	gap: var(--ne-space-4);
	padding: var(--ne-space-5);
	padding-bottom: 0;
	margin-top: -36px;
	position: relative;
	z-index: 2;
}

.ne-sq__logo {
	width: 72px;
	height: 72px;
	border-radius: var(--ne-radius-md);
	object-fit: cover;
	border: 3px solid var(--ne-surface);
	box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
	flex-shrink: 0;
}

.ne-sq__logo--placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--ne-accent-glow);
	color: var(--ne-accent);
	font-weight: 700;
	font-size: 1.3rem;
	text-transform: uppercase;
}

.ne-sq__title-block {
	flex: 1;
	min-width: 0;
}

.ne-sq__name {
	font-size: 1.5rem;
	font-weight: 700;
	margin: 0;
	line-height: 1.2;
}

.ne-sq__tag {
	display: inline-block;
	padding: 2px 10px;
	border-radius: var(--ne-radius-sm);
	font-family: var(--ne-font-mono);
	font-size: 0.65rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	background: rgba(255, 255, 255, 0.08);
	color: var(--ne-text-muted);
	margin-top: var(--ne-space-1);
}

.ne-sq__stats {
	display: flex;
	gap: var(--ne-space-4);
}

.ne-sq__stat {
	display: flex;
	flex-direction: column;
	align-items: center;
	min-width: 52px;
}

.ne-sq__stat-val {
	font-family: var(--ne-font-mono);
	font-size: 1.4rem;
	font-weight: 700;
	line-height: 1;
}

.ne-sq__stat-lbl {
	font-family: var(--ne-font-mono);
	font-size: 0.6rem;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: var(--ne-text-muted);
	margin-top: 2px;
}

/* Description */
.ne-sq__desc {
	padding: var(--ne-space-3) var(--ne-space-5) 0;
	color: var(--ne-text-muted);
	font-size: 0.9rem;
	line-height: 1.6;
}

/* Section label */
.ne-sq__section-label {
	display: block;
	font-family: var(--ne-font-mono);
	font-size: 0.688rem;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: var(--ne-text-subtle);
	margin-bottom: var(--ne-space-3);
}

.ne-sq__section {
	padding: var(--ne-space-4) var(--ne-space-5);
}

/* Roster */
.ne-sq__roster {
	display: flex;
	flex-direction: column;
	gap: 0;
}

.ne-sq__pilot {
	display: flex;
	align-items: center;
	gap: var(--ne-space-3);
	padding: var(--ne-space-2) 0;
	border-bottom: 1px solid var(--ne-border);
}

.ne-sq__pilot:last-child {
	border-bottom: none;
}

.ne-sq__pilot-avatar {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	object-fit: cover;
}

.ne-sq__pilot-name {
	flex: 1;
	font-weight: 500;
}

.ne-sq__role-badge {
	display: inline-block;
	padding: 2px 8px;
	border-radius: var(--ne-radius-sm);
	font-size: 0.65rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	background: rgba(234, 179, 8, 0.15);
	color: #eab308;
}

/* Actions */
.ne-sq__actions {
	display: flex;
	gap: var(--ne-space-3);
	padding: var(--ne-space-4) var(--ne-space-5);
	border-top: 1px solid var(--ne-border);
}

/* Edit panel */
.ne-sq__edit {
	padding: var(--ne-space-5);
	border-top: 1px solid var(--ne-border);
	background: var(--ne-elevated);
}

.ne-sq__edit-actions {
	display: flex;
	gap: var(--ne-space-3);
	margin-top: var(--ne-space-3);
}

/* ═══════════════════════════════════════════════════════
   HERO — No squadra / Not logged in
   ═══════════════════════════════════════════════════════ */
.ne-sq-hero {
	position: relative;
	border-radius: var(--ne-radius-lg);
	overflow: hidden;
	padding: var(--ne-space-8) var(--ne-space-6);
	margin-bottom: var(--ne-space-5);
	background: linear-gradient(135deg, var(--ne-accent-deep) 0%, var(--ne-surface) 60%, var(--ne-accent-soft) 100%);
	border: 1px solid var(--ne-border);
}

.ne-sq-hero__content {
	max-width: 520px;
}

.ne-sq-hero__title {
	font-family: var(--ne-font-display);
	font-size: 2.5rem;
	font-weight: 400;
	margin: 0 0 var(--ne-space-3);
}

.ne-sq-hero__sub {
	color: var(--ne-text-muted);
	font-size: 0.95rem;
	line-height: 1.6;
	margin-bottom: var(--ne-space-5);
}

/* ═══════════════════════════════════════════════════════
   CREATE PANEL (expandable)
   ═══════════════════════════════════════════════════════ */
.ne-sq-create {
	background: var(--ne-surface);
	border: 1px solid var(--ne-border);
	border-radius: var(--ne-radius-lg);
	padding: var(--ne-space-5);
	margin-bottom: var(--ne-space-5);
	max-width: 640px;
}

/* ═══════════════════════════════════════════════════════
   GRID — All Squadras
   ═══════════════════════════════════════════════════════ */
.ne-sq-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: var(--ne-space-4);
}

.ne-sq-grid__card {
	background: var(--ne-surface);
	border: 1px solid var(--ne-border);
	border-radius: var(--ne-radius-lg);
	overflow: hidden;
	transition: transform var(--ne-duration) var(--ne-ease),
	            border-color var(--ne-duration),
	            box-shadow var(--ne-duration);
}

.ne-sq-grid__card:hover {
	transform: translateY(-2px);
	border-color: var(--ne-border-s);
	box-shadow: var(--ne-shadow-card-hover);
}

/* Card banner */
.ne-sq-grid__banner {
	position: relative;
	height: 100px;
	overflow: hidden;
}

.ne-sq-grid__banner img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 600ms var(--ne-ease);
}

.ne-sq-grid__card:hover .ne-sq-grid__banner img {
	transform: scale(1.05);
}

.ne-sq-grid__banner-overlay {
	position: absolute;
	inset: 0;
	background: linear-gradient(to bottom, transparent 20%, rgba(0, 0, 0, 0.65));
}

/* Card body */
.ne-sq-grid__body {
	padding: var(--ne-space-4);
}

.ne-sq-grid__rank {
	margin-bottom: var(--ne-space-2);
}

.ne-sq-grid__identity {
	display: flex;
	align-items: flex-start;
	gap: var(--ne-space-3);
	margin-bottom: var(--ne-space-3);
}

.ne-sq-grid__logo {
	width: 40px;
	height: 40px;
	border-radius: var(--ne-radius-sm);
	object-fit: cover;
	flex-shrink: 0;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.ne-sq-grid__logo--placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--ne-accent-glow);
	color: var(--ne-accent);
	font-weight: 700;
	font-size: 0.8rem;
	text-transform: uppercase;
}

.ne-sq-grid__info {
	min-width: 0;
	flex: 1;
}

.ne-sq-grid__name {
	font-weight: 700;
	font-size: 1rem;
	display: block;
	margin-bottom: 2px;
}

.ne-sq-grid__desc {
	font-size: 0.78rem;
	color: var(--ne-text-muted);
	line-height: 1.4;
	margin: var(--ne-space-1) 0 0;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.ne-sq-grid__meta {
	display: flex;
	gap: var(--ne-space-3);
	margin-bottom: var(--ne-space-3);
}

.ne-sq-grid__stat {
	font-size: 0.75rem;
	color: var(--ne-text-muted);
}

.ne-sq-grid__stat strong {
	color: var(--ne-text);
	font-family: var(--ne-font-mono);
}

.ne-sq-grid__footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding-top: var(--ne-space-3);
	border-top: 1px solid var(--ne-border);
}

.ne-sq-grid__pts {
	font-family: var(--ne-font-mono);
	font-weight: 700;
	font-size: 0.9rem;
}

/* Empty state */
.ne-sq-empty {
	text-align: center;
	padding: var(--ne-space-8);
	color: var(--ne-text-muted);
}

/* Textarea */
textarea.ne-form-input {
	resize: vertical;
	min-height: 72px;
}

.ne-char-count {
	font-size: 0.7rem;
	color: var(--ne-text-muted);
	text-align: right;
	margin-top: var(--ne-space-1);
}

/* Registration modal team info banner */
.ne-modal-reg__team-info {
	display: flex;
	align-items: flex-start;
	gap: var(--ne-space-2);
	padding: var(--ne-space-3);
	margin-top: var(--ne-space-3);
	border-radius: var(--ne-radius-sm);
	background: rgba(255, 255, 255, 0.04);
	font-size: 0.85rem;
	line-height: 1.5;
}

.ne-modal-reg__team-info i {
	flex-shrink: 0;
	margin-top: 2px;
	color: var(--ne-text-muted);
}

.ne-modal-reg__team-info a {
	color: var(--ne-accent);
	text-decoration: underline;
}

/* ═══════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
	.ne-sq-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 768px) {
	.ne-sq__identity {
		flex-direction: column;
		align-items: flex-start;
		margin-top: -28px;
	}

	.ne-sq__stats {
		flex-wrap: wrap;
	}

	.ne-sq-grid {
		grid-template-columns: 1fr;
	}

	.ne-sq-hero {
		padding: var(--ne-space-6) var(--ne-space-4);
	}

	.ne-sq-hero__title {
		font-size: 2rem;
	}
}

@media (max-width: 600px) {
	.ne-sq__actions {
		flex-direction: column;
	}

	.ne-sq__actions .ne-btn {
		width: 100%;
	}

	.ne-sq__edit-actions {
		flex-direction: column;
	}

	.ne-sq__edit-actions .ne-btn {
		width: 100%;
	}

	.ne-sq__banner {
		height: 140px;
	}

	.ne-sq__logo {
		width: 56px;
		height: 56px;
	}

	.ne-sq-grid__banner {
		height: 80px;
	}
}
