/* ═══════════════════════════════════════════════════════════════════════════
   Tetris – Global Stylesheet
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── CSS Reset ───────────────────────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    -moz-text-size-adjust: none;
    -webkit-text-size-adjust: none;
    text-size-adjust: none;
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img, picture, video, canvas, svg {
    display: block;
    max-width: 100%;
}

input, button, textarea, select {
    font: inherit;
    color: inherit;
}

p, h1, h2, h3, h4, h5, h6 {
    overflow-wrap: break-word;
}

a {
    color: inherit;
    text-decoration: none;
}

ul, ol {
    list-style: none;
}

table {
    border-collapse: collapse;
    border-spacing: 0;
}

/* ─── CSS Custom Properties: Light Mode ───────────────────────────────────── */
:root {
    /* Backgrounds */
    --bg-primary: #f8f9fc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #eef0f5;

    /* Text */
    --text-primary: #1a1d27;
    --text-secondary: #4a4e5c;
    --text-muted: #8b8fa3;

    /* Accents */
    --accent-primary: #00bcd4;
    --accent-primary-hover: #0097a7;
    --accent-primary-light: rgba(0, 188, 212, 0.1);
    --accent-secondary: #7c4dff;
    --accent-secondary-hover: #651fff;

    /* Borders & Shadows */
    --border-color: #e0e3eb;
    --shadow-color: rgba(0, 0, 0, 0.08);
    --shadow-sm: 0 1px 3px var(--shadow-color);
    --shadow-md: 0 4px 12px var(--shadow-color);
    --shadow-lg: 0 8px 30px var(--shadow-color);

    /* Status */
    --success: #4caf50;
    --success-bg: rgba(76, 175, 80, 0.1);
    --warning: #ff9800;
    --warning-bg: rgba(255, 152, 0, 0.1);
    --danger: #f44336;
    --danger-bg: rgba(244, 67, 54, 0.1);

    /* Navigation */
    --nav-bg: rgba(255, 255, 255, 0.92);
    --nav-text: #1a1d27;
    --nav-border: #e0e3eb;

    /* Footer */
    --footer-bg: #1a1d27;
    --footer-text: #b0b3c0;

    /* Forms */
    --input-bg: #ffffff;
    --input-border: #d1d5e0;
    --input-focus: var(--accent-primary);
    --input-placeholder: #a0a4b5;

    /* Cards */
    --card-bg: #ffffff;
    --card-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    --card-hover-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);

    /* Misc */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 400ms ease;
    --z-dropdown: 100;
    --z-navbar: 1000;
    --z-modal: 2000;
    --z-flash: 3000;
}

/* ─── Dark Mode ───────────────────────────────────────────────────────────── */
[data-theme="dark"] {
    --bg-primary: #13151c;
    --bg-secondary: #1a1d27;
    --bg-tertiary: #22252f;

    --text-primary: #e8eaf0;
    --text-secondary: #b0b3c0;
    --text-muted: #6b6f80;

    --accent-primary: #26c6da;
    --accent-primary-hover: #4dd0e1;
    --accent-primary-light: rgba(38, 198, 218, 0.12);
    --accent-secondary: #b388ff;
    --accent-secondary-hover: #d1b3ff;

    --border-color: #2c2f3a;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --shadow-sm: 0 1px 3px var(--shadow-color);
    --shadow-md: 0 4px 12px var(--shadow-color);
    --shadow-lg: 0 8px 30px var(--shadow-color);

    --success: #66bb6a;
    --success-bg: rgba(102, 187, 106, 0.12);
    --warning: #ffa726;
    --warning-bg: rgba(255, 167, 38, 0.12);
    --danger: #ef5350;
    --danger-bg: rgba(239, 83, 80, 0.12);

    --nav-bg: rgba(26, 29, 39, 0.95);
    --nav-text: #e8eaf0;
    --nav-border: #2c2f3a;

    --footer-bg: #0d0f14;
    --footer-text: #6b6f80;

    --input-bg: #22252f;
    --input-border: #353845;
    --input-focus: var(--accent-primary);
    --input-placeholder: #555869;

    --card-bg: #1a1d27;
    --card-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    --card-hover-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

/* ─── Typography ──────────────────────────────────────────────────────────── */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
                 Ubuntu, Cantarell, 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
                 Arial, sans-serif;
    font-size: 16px;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    transition: background-color var(--transition-base), color var(--transition-base);
}

h1 { font-size: 2.5rem; font-weight: 800; line-height: 1.2; letter-spacing: -0.02em; }
h2 { font-size: 2rem; font-weight: 700; line-height: 1.25; letter-spacing: -0.015em; }
h3 { font-size: 1.5rem; font-weight: 700; line-height: 1.3; }
h4 { font-size: 1.25rem; font-weight: 600; line-height: 1.35; }
h5 { font-size: 1.1rem; font-weight: 600; line-height: 1.4; }
h6 { font-size: 1rem; font-weight: 600; line-height: 1.5; }

p {
    color: var(--text-secondary);
    line-height: 1.7;
}

small {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* ─── Layout ──────────────────────────────────────────────────────────────── */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.main-content {
    min-height: calc(100vh - 72px - 120px);
    padding-top: 72px; /* navbar height */
}

.flex {
    display: flex;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.grid {
    display: grid;
}

.hidden {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.text-center { text-align: center; }
.text-muted  { color: var(--text-muted); }

/* ─── Navigation ──────────────────────────────────────────────────────────── */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 72px;
    background: var(--nav-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--nav-border);
    z-index: var(--z-navbar);
    transition: background var(--transition-base), border-color var(--transition-base);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    gap: 1rem;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    flex-shrink: 0;
    transition: color var(--transition-fast);
}

.nav-brand:hover {
    color: var(--accent-primary);
}

.nav-logo {
    color: var(--accent-primary);
    flex-shrink: 0;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    justify-content: flex-end;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.9rem;
    font-size: 0.925rem;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: color var(--transition-fast), background var(--transition-fast);
    white-space: nowrap;
}

.nav-link:hover {
    color: var(--text-primary);
    background: var(--accent-primary-light);
}

.nav-link.active {
    color: var(--accent-primary);
    background: var(--accent-primary-light);
}

.nav-user {
    font-weight: 600;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 0.5rem;
}

/* Hamburger */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    padding: 8px;
    background: none;
    border: none;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
}

.nav-toggle:hover {
    background: var(--bg-tertiary);
}

.hamburger-line {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: transform var(--transition-base), opacity var(--transition-base);
}

.nav-toggle[aria-expanded="true"] .hamburger-line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .hamburger-line:nth-child(2) {
    opacity: 0;
}

.nav-toggle[aria-expanded="true"] .hamburger-line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Language Switcher */
.lang-switcher {
    position: relative;
}

.lang-btn {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.4rem 0.65rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.lang-btn:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.lang-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 120px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all var(--transition-fast);
    z-index: var(--z-dropdown);
}

.lang-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-option {
    display: block;
    width: 100%;
    padding: 0.55rem 0.9rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.lang-option:first-child {
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.lang-option:last-child {
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

.lang-option:hover {
    background: var(--accent-primary-light);
    color: var(--accent-primary);
}

.lang-option.active {
    color: var(--accent-primary);
    font-weight: 600;
}

/* Theme Toggle */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: none;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.theme-toggle:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background: var(--accent-primary-light);
}

.icon-sun { display: none; }
.icon-moon { display: block; }

[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }

/* ─── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    text-decoration: none;
    line-height: 1.4;
}

.btn:active {
    transform: scale(0.97);
}

.btn-sm {
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
}

.btn-lg {
    padding: 0.9rem 2rem;
    font-size: 1.1rem;
}

.btn-primary {
    color: #ffffff;
    background: var(--accent-primary);
    box-shadow: 0 2px 8px rgba(0, 188, 212, 0.3);
}

.btn-primary:hover {
    background: var(--accent-primary-hover);
    box-shadow: 0 4px 14px rgba(0, 188, 212, 0.4);
}

.btn-secondary {
    color: var(--text-primary);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background: var(--accent-primary-light);
}

.btn-danger {
    color: #ffffff;
    background: var(--danger);
    box-shadow: 0 2px 8px rgba(244, 67, 54, 0.3);
}

.btn-danger:hover {
    background: #d32f2f;
    box-shadow: 0 4px 14px rgba(244, 67, 54, 0.4);
}

.btn-ghost {
    color: var(--text-secondary);
    background: transparent;
}

.btn-ghost:hover {
    color: var(--accent-primary);
    background: var(--accent-primary-light);
}

.btn:disabled,
.btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* ─── Forms ───────────────────────────────────────────────────────────────── */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.form-control {
    display: block;
    width: 100%;
    padding: 0.7rem 1rem;
    font-size: 0.95rem;
    color: var(--text-primary);
    background: var(--input-bg);
    border: 1.5px solid var(--input-border);
    border-radius: var(--radius-sm);
    outline: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control::placeholder {
    color: var(--input-placeholder);
}

.form-control:focus {
    border-color: var(--input-focus);
    box-shadow: 0 0 0 3px var(--accent-primary-light);
}

.form-control.error {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px var(--danger-bg);
}

.form-error {
    display: block;
    margin-top: 0.3rem;
    font-size: 0.825rem;
    color: var(--danger);
}

.form-hint {
    display: block;
    margin-top: 0.3rem;
    font-size: 0.825rem;
    color: var(--text-muted);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%238b8fa3' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.9rem center;
    padding-right: 2.5rem;
}

/* ─── Cards ───────────────────────────────────────────────────────────────── */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--card-shadow);
    padding: 1.5rem;
    transition: box-shadow var(--transition-base), border-color var(--transition-base),
                background var(--transition-base);
}

.card:hover {
    box-shadow: var(--card-hover-shadow);
}

.card-header {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.card-title {
    font-size: 1.15rem;
    font-weight: 700;
}

/* ─── Flash Messages ──────────────────────────────────────────────────────── */
.flash-container {
    position: fixed;
    top: 84px;
    right: 1.5rem;
    z-index: var(--z-flash);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}

.flash {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.25rem;
    min-width: 280px;
    max-width: 420px;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    pointer-events: auto;
    animation: flash-in 0.3s ease forwards;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.flash.flash-out {
    animation: flash-out 0.3s ease forwards;
}

.flash-success {
    color: #1b5e20;
    background: #e8f5e9;
    border-left: 4px solid var(--success);
}

[data-theme="dark"] .flash-success {
    color: #a5d6a7;
    background: rgba(76, 175, 80, 0.15);
}

.flash-error {
    color: #b71c1c;
    background: #ffebee;
    border-left: 4px solid var(--danger);
}

[data-theme="dark"] .flash-error {
    color: #ef9a9a;
    background: rgba(244, 67, 54, 0.15);
}

.flash-warning {
    color: #e65100;
    background: #fff3e0;
    border-left: 4px solid var(--warning);
}

[data-theme="dark"] .flash-warning {
    color: #ffcc80;
    background: rgba(255, 152, 0, 0.15);
}

.flash-close {
    margin-left: auto;
    padding: 0.2rem;
    background: none;
    border: none;
    color: inherit;
    opacity: 0.6;
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    transition: opacity var(--transition-fast);
}

.flash-close:hover {
    opacity: 1;
}

@keyframes flash-in {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes flash-out {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(30px);
    }
}

/* ─── Tables ──────────────────────────────────────────────────────────────── */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

table.table {
    width: 100%;
    font-size: 0.925rem;
}

table.table thead {
    background: var(--bg-tertiary);
}

table.table th {
    padding: 0.75rem 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-align: left;
    white-space: nowrap;
}

table.table td {
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    border-top: 1px solid var(--border-color);
}

table.table tbody tr {
    transition: background var(--transition-fast);
}

table.table tbody tr:hover {
    background: var(--accent-primary-light);
}

/* ─── Error Page ──────────────────────────────────────────────────────────── */
.error-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 72px - 120px);
    text-align: center;
    padding: 3rem 1.5rem;
}

.error-content {
    max-width: 480px;
}

.error-code {
    font-size: 8rem;
    font-weight: 900;
    line-height: 1;
    color: var(--accent-primary);
    letter-spacing: -0.04em;
}

.error-title {
    margin-top: 0.5rem;
    font-size: 1.75rem;
}

.error-description {
    margin: 1rem 0 2rem;
}

/* ─── Footer ──────────────────────────────────────────────────────────────── */
.footer {
    background: var(--footer-bg);
    color: var(--footer-text);
    padding: 2rem 0;
    margin-top: auto;
    transition: background var(--transition-base);
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-logo {
    font-size: 1.1rem;
    font-weight: 700;
    color: #e8eaf0;
}

.footer-copy {
    font-size: 0.85rem;
    color: var(--footer-text);
    margin-top: 0.25rem;
}

.footer-nav {
    display: flex;
    gap: 1.5rem;
}

.footer-link {
    font-size: 0.9rem;
    color: var(--footer-text);
    transition: color var(--transition-fast);
}

.footer-link:hover {
    color: #e8eaf0;
}

/* ─── Utility: Loading Spinner ────────────────────────────────────────────── */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2.5px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.spinner-lg {
    width: 40px;
    height: 40px;
    border-width: 3.5px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ─── Utility: Badges ─────────────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    line-height: 1.4;
}

.badge-primary {
    color: var(--accent-primary);
    background: var(--accent-primary-light);
}

.badge-success {
    color: var(--success);
    background: var(--success-bg);
}

.badge-warning {
    color: var(--warning);
    background: var(--warning-bg);
}

.badge-danger {
    color: var(--danger);
    background: var(--danger-bg);
}

/* ─── Utility: Tooltips ───────────────────────────────────────────────────── */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
    color: #fff;
    background: var(--text-primary);
    border-radius: var(--radius-sm);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity var(--transition-fast), visibility var(--transition-fast);
    z-index: var(--z-dropdown);
}

[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
}

/* ─── Scrollbar Styling ───────────────────────────────────────────────────── */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

[data-theme="dark"] ::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) var(--bg-primary);
}

/* ─── Responsive: Tablet (768px) ──────────────────────────────────────────── */
@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.6rem; }
    h3 { font-size: 1.3rem; }

    .nav-toggle {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 72px;
        left: 0;
        right: 0;
        bottom: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 1.5rem;
        background: var(--bg-secondary);
        border-top: 1px solid var(--border-color);
        overflow-y: auto;
        transform: translateX(100%);
        transition: transform var(--transition-base);
        z-index: calc(var(--z-navbar) - 1);
    }

    .nav-menu.open {
        transform: translateX(0);
    }

    .nav-links {
        flex-direction: column;
        gap: 0.25rem;
        margin-bottom: 1.5rem;
    }

    .nav-link {
        padding: 0.75rem 1rem;
        font-size: 1rem;
        border-radius: var(--radius-sm);
    }

    .nav-actions {
        flex-direction: column;
        margin-left: 0;
        gap: 0.75rem;
        padding-top: 1.5rem;
        border-top: 1px solid var(--border-color);
    }

    .nav-actions .btn {
        width: 100%;
    }

    .nav-actions .nav-link {
        padding: 0.75rem 1rem;
    }

    .lang-switcher {
        width: 100%;
    }

    .lang-btn {
        width: 100%;
        justify-content: space-between;
    }

    .lang-dropdown {
        left: 0;
        right: 0;
    }

    .theme-toggle {
        width: 100%;
        height: 44px;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .footer-nav {
        justify-content: center;
    }

    .flash-container {
        left: 1rem;
        right: 1rem;
    }

    .flash {
        min-width: unset;
        max-width: unset;
    }
}

/* ─── Responsive: Mobile (480px) ──────────────────────────────────────────── */
@media (max-width: 480px) {
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.4rem; }
    h3 { font-size: 1.15rem; }

    .container {
        padding: 0 1rem;
    }

    .btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }

    .btn-lg {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }

    .error-code {
        font-size: 5rem;
    }
}

/* ─── Responsive: Desktop (1024px+) ──────────────────────────────────────── */
@media (min-width: 1024px) {
    .container {
        padding: 0 2rem;
    }
}

/* ─── Responsive: Wide (1200px+) ──────────────────────────────────────────── */
@media (min-width: 1200px) {
    .container {
        padding: 0 2.5rem;
    }
}

/* ─── Print ───────────────────────────────────────────────────────────────── */
@media print {
    .navbar,
    .footer,
    .flash-container,
    .theme-toggle,
    .lang-switcher,
    .nav-toggle {
        display: none !important;
    }

    .main-content {
        padding-top: 0;
    }

    body {
        color: #000;
        background: #fff;
    }
}

/* ─── Reduced Motion ──────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
