/* ========================================
   SocietEase — Unified Design System
   Premium, modern, responsive.
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* === CSS Variables === */
:root {
    --primary: #4f46e5;
    --primary-dark: #3730a3;
    --primary-light: #818cf8;
    --primary-bg: #eef2ff;
    --accent: #06b6d4;
    --success: #10b981;
    --success-bg: #d1fae5;
    --warning: #f59e0b;
    --warning-bg: #fef3c7;
    --danger: #ef4444;
    --danger-bg: #fee2e2;
    --bg: #f8fafc;
    --surface: #ffffff;
    --surface-hover: #f1f5f9;
    --text: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
    --shadow-lg: 0 10px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.05);
    --shadow-xl: 0 20px 50px -12px rgba(0,0,0,0.15);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --transition: all 0.2s ease;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: var(--primary); transition: var(--transition); }
a:hover { color: var(--primary-dark); }

/* === Landing Page === */
.landing-hero {
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

.landing-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(3deg); }
}

.landing-content h1 { font-size: 3.5rem; font-weight: 800; margin-bottom: 1rem; letter-spacing: -0.02em; }
.landing-content p { font-size: 1.25rem; opacity: 0.9; max-width: 600px; margin: 0 auto 2rem; }

.landing-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* === 3D Landing Experience === */
.landing-body {
    min-height: 100vh;
    background: #07111f;
    overflow-x: hidden;
}

.landing-hero-3d {
    min-height: 100vh;
    display: grid;
    align-items: stretch;
    justify-content: stretch;
    text-align: left;
    padding: 0;
    background:
        linear-gradient(125deg, rgba(7, 17, 31, 0.96) 0%, rgba(13, 45, 50, 0.92) 48%, rgba(57, 44, 14, 0.88) 100%),
        #07111f;
    isolation: isolate;
}

.landing-hero-3d::before {
    content: none;
}

.society-scene {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
}

.landing-grid {
    position: absolute;
    inset: auto -10% -22% -10%;
    height: 52vh;
    z-index: -1;
    background-image:
        linear-gradient(rgba(125, 211, 252, 0.16) 1px, transparent 1px),
        linear-gradient(90deg, rgba(125, 211, 252, 0.16) 1px, transparent 1px);
    background-size: 58px 58px;
    transform: perspective(700px) rotateX(62deg);
    transform-origin: bottom;
    opacity: 0.7;
}

.landing-nav {
    width: min(1180px, calc(100% - 48px));
    height: 74px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: white;
    z-index: 2;
}

.landing-brand,
.landing-nav-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
}

.landing-brand {
    color: white;
    font-size: 1.05rem;
    font-weight: 800;
}

.landing-brand:hover,
.nav-link:hover {
    color: white;
}

.landing-brand span span {
    color: #7dd3fc;
}

.brand-mark {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.12);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
    font-size: 0.8rem;
}

.landing-nav-actions {
    gap: 1rem;
}

.nav-link {
    color: rgba(255, 255, 255, 0.78);
    font-weight: 700;
}

.landing-stage {
    width: min(1180px, calc(100% - 48px));
    min-height: calc(100vh - 210px);
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    align-items: center;
    gap: clamp(2rem, 6vw, 5.5rem);
    padding: 2rem 0 3rem;
    position: relative;
    z-index: 1;
}

.landing-copy {
    max-width: 650px;
}

.landing-kicker {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 0.85rem;
    border: 1px solid rgba(125, 211, 252, 0.32);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.36);
    color: #a7f3d0;
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.landing-copy h1 {
    margin: 1.1rem 0 1rem;
    color: white;
    font-size: clamp(3.5rem, 10vw, 8.2rem);
    line-height: 0.9;
    font-weight: 800;
    letter-spacing: 0;
    text-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.landing-lede {
    max-width: 600px;
    color: rgba(255, 255, 255, 0.82);
    font-size: 1.12rem;
    line-height: 1.8;
    margin-bottom: 2rem;
}

.landing-hero-3d .landing-actions {
    justify-content: flex-start;
}

.landing-hero-3d .btn-white {
    color: #0f766e;
}

.landing-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.8rem;
    max-width: 650px;
    margin-top: 2rem;
}

.landing-metrics div {
    min-height: 104px;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 8px;
    background: rgba(6, 17, 31, 0.54);
    backdrop-filter: blur(16px);
}

.landing-metrics strong,
.landing-metrics span {
    display: block;
}

.landing-metrics strong {
    color: #fde68a;
    font-size: 1.7rem;
    line-height: 1;
    margin-bottom: 0.6rem;
}

.landing-metrics span {
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.84rem;
    line-height: 1.45;
}

.landing-command-panel {
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    background: rgba(7, 17, 31, 0.58);
    backdrop-filter: blur(20px);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.28);
    padding: 1rem;
    color: white;
}

.panel-header {
    min-height: 38px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 0.85rem;
    font-weight: 800;
}

.status-dot {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: #a7f3d0;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.status-dot::before {
    content: '';
    width: 0.52rem;
    height: 0.52rem;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 18px #22c55e;
}

.mini-map {
    height: 220px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    align-items: end;
    gap: 0.8rem;
    margin: 1.4rem 0;
    padding: 1rem;
    border-radius: 8px;
    background:
        linear-gradient(160deg, rgba(14, 165, 233, 0.12), rgba(34, 197, 94, 0.08)),
        rgba(255, 255, 255, 0.06);
}

.tower {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.45rem;
    align-content: start;
    padding: 0.7rem;
    border-radius: 6px 6px 2px 2px;
    background: linear-gradient(135deg, rgba(226, 232, 240, 0.86), rgba(148, 163, 184, 0.68));
    box-shadow: 12px 16px 0 rgba(15, 23, 42, 0.25);
}

.tower-a { height: 142px; }
.tower-b { height: 176px; }
.tower-c { height: 126px; }

.tower span {
    height: 14px;
    border-radius: 2px;
    background: #38bdf8;
    box-shadow: 0 0 14px rgba(56, 189, 248, 0.8);
}

.tower-b span {
    background: #a7f3d0;
    box-shadow: 0 0 14px rgba(167, 243, 208, 0.8);
}

.tower-c span {
    background: #fde68a;
    box-shadow: 0 0 14px rgba(253, 230, 138, 0.8);
}

.workflow-list {
    display: grid;
    gap: 0.75rem;
}

.workflow-list div {
    min-height: 70px;
    display: grid;
    grid-template-columns: 42px 1fr;
    align-items: center;
    gap: 0.8rem;
    padding: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
}

.workflow-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: rgba(125, 211, 252, 0.16);
    color: #7dd3fc;
    font-size: 0.78rem;
    font-weight: 800;
}

.workflow-list p {
    margin: 0;
}

.workflow-list strong,
.workflow-list small {
    display: block;
}

.workflow-list strong {
    font-size: 0.95rem;
}

.workflow-list small {
    color: rgba(255, 255, 255, 0.62);
    font-size: 0.78rem;
    margin-top: 0.1rem;
}

.landing-feature-strip {
    width: min(1180px, calc(100% - 48px));
    min-height: 108px;
    margin: 0 auto 1.5rem;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.12);
    position: relative;
    z-index: 1;
}

.landing-feature-strip article {
    min-height: 106px;
    padding: 1.05rem;
    background: rgba(7, 17, 31, 0.62);
    backdrop-filter: blur(18px);
}

.landing-feature-strip span,
.landing-feature-strip strong {
    display: block;
}

.landing-feature-strip span {
    color: #a7f3d0;
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.45rem;
}

.landing-feature-strip strong {
    color: white;
    font-size: 0.95rem;
    line-height: 1.35;
}

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font);
}

.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0); }

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); color: white; }

.btn-white { background: white; color: var(--primary); }
.btn-white:hover { background: #f8fafc; }

.btn-outline { background: transparent; color: white; border: 2px solid rgba(255,255,255,0.5); }
.btn-outline:hover { background: rgba(255,255,255,0.15); border-color: white; color: white; }

.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #059669; }

.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #dc2626; }

.btn-secondary { background: var(--surface-hover); color: var(--text); }
.btn-secondary:hover { background: var(--border); }

.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.8rem; }
.btn-lg { padding: 1rem 2rem; font-size: 1.1rem; }

/* === Auth Pages (Login/Register) === */
.auth-page {
    min-height: 100vh;
    display: flex;
    background: var(--bg);
}

.auth-left {
    flex: 1;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    padding: 3rem;
}

.auth-left h2 { font-size: 2.5rem; font-weight: 800; margin-bottom: 1rem; }
.auth-left p { font-size: 1.1rem; opacity: 0.85; max-width: 400px; }

.auth-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 2.5rem;
}

.auth-card h2 { font-size: 1.75rem; font-weight: 700; margin-bottom: 0.5rem; color: var(--text); }
.auth-card .subtitle { color: var(--text-secondary); margin-bottom: 2rem; }

/* === Forms === */
.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; font-size: 0.875rem; font-weight: 600; color: var(--text); margin-bottom: 0.4rem; }

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-family: var(--font);
    transition: var(--transition);
    background: var(--surface);
    color: var(--text);
}

.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,0.1); }
.form-control::placeholder { color: var(--text-muted); }

select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2364748b' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 1rem center; padding-right: 2.5rem; }

textarea.form-control { min-height: 100px; resize: vertical; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

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

/* === Alerts === */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.alert-error { background: var(--danger-bg); color: #b91c1c; border: 1px solid #fecaca; }
.alert-success { background: var(--success-bg); color: #065f46; border: 1px solid #a7f3d0; }
.alert-warning { background: var(--warning-bg); color: #92400e; border: 1px solid #fde68a; }

/* === Sidebar Layout === */
.app-layout { display: flex; min-height: 100vh; }

.sidebar {
    width: 260px;
    background: linear-gradient(180deg, #1e1b4b 0%, #312e81 100%);
    color: white;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
    display: flex;
    flex-direction: column;
}

.sidebar-logo {
    padding: 1.5rem;
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-logo span { color: var(--primary-light); }

.sidebar-society {
    padding: 0.75rem 1.5rem;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.6);
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-nav { flex: 1; padding: 1rem 0; }

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    color: rgba(255,255,255,0.75);
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
}

.sidebar-nav a:hover, .sidebar-nav a.active {
    background: rgba(255,255,255,0.1);
    color: white;
}

.sidebar-nav a.active { border-left: 3px solid var(--primary-light); }

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.sidebar-footer a { color: rgba(255,255,255,0.6); font-size: 0.85rem; }
.sidebar-footer a:hover { color: white; }

/* === Main Content === */
.main-content { margin-left: 260px; padding: 2rem; flex: 1; }

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.page-header h1 { font-size: 1.75rem; font-weight: 700; }
.page-header p { color: var(--text-secondary); margin-top: 0.25rem; }

/* === Stat Cards === */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.25rem; margin-bottom: 2rem; }

.stat-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.stat-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.stat-card .stat-label { font-size: 0.85rem; color: var(--text-secondary); font-weight: 500; }
.stat-card .stat-value { font-size: 2rem; font-weight: 800; color: var(--primary); margin: 0.25rem 0; }
.stat-card .stat-sub { font-size: 0.8rem; color: var(--text-muted); }

/* === Cards === */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    margin-bottom: 1.5rem;
}

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h2 { font-size: 1.1rem; font-weight: 600; color: var(--text); }
.card-body { padding: 1.5rem; }

/* === Tables === */
.table-wrapper { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

thead th {
    background: var(--bg);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 2px solid var(--border);
}

tbody td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

tbody tr:hover { background: var(--surface-hover); }
tbody tr:last-child td { border-bottom: none; }

/* === Status Badges === */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.badge-pending { background: var(--warning-bg); color: #92400e; }
.badge-success, .badge-paid { background: var(--success-bg); color: #065f46; }
.badge-danger, .badge-failed { background: var(--danger-bg); color: #b91c1c; }
.badge-info { background: var(--primary-bg); color: var(--primary-dark); }
.badge-vacant { background: #f1f5f9; color: #64748b; }
.badge-occupied { background: #dbeafe; color: #1d4ed8; }

/* === Modal === */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active { display: flex; }

.modal {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    width: 90%;
    max-width: 520px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 2rem;
    animation: modalSlideIn 0.25s ease;
}

@keyframes modalSlideIn {
    from { opacity: 0; transform: translateY(-20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.modal-header h2 { font-size: 1.25rem; font-weight: 700; }
.modal-close { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--text-muted); padding: 0.25rem; }
.modal-close:hover { color: var(--text); }

/* === Registration Wizard === */
.wizard-steps { display: flex; align-items: center; justify-content: center; margin-bottom: 2.5rem; gap: 0; }

.wizard-step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
}

.wizard-step.active { color: var(--primary); font-weight: 700; }
.wizard-step.completed { color: var(--success); }

.wizard-step .step-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    background: var(--border);
    color: var(--text-muted);
}

.wizard-step.active .step-number { background: var(--primary); color: white; }
.wizard-step.completed .step-number { background: var(--success); color: white; }

.wizard-connector { width: 40px; height: 2px; background: var(--border); }
.wizard-connector.completed { background: var(--success); }

.wizard-panel { display: none; }
.wizard-panel.active { display: block; animation: fadeIn 0.3s ease; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* === Search Box === */
.search-box {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.search-box input {
    flex: 1;
    max-width: 300px;
}

/* === Helper Cards === */
.helper-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1.25rem; }

.helper-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: var(--transition);
}

.helper-card:hover { box-shadow: var(--shadow); }
.helper-card h3 { font-size: 1.1rem; font-weight: 600; color: var(--primary); margin-bottom: 0.25rem; }
.helper-card .helper-role { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 0.75rem; }
.helper-card .helper-detail { font-size: 0.85rem; color: var(--text); margin-bottom: 0.35rem; }

.apt-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.75rem 0; }

.apt-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: var(--primary-bg);
    color: var(--primary);
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* === Mobile Sidebar Toggle & Overlay === */
.sidebar-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 200;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, #0f766e, #2563eb);
    color: white;
    font-size: 1.4rem;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.sidebar-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 24px rgba(15, 118, 110, 0.35);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 99;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* === Responsive === */
@media (max-width: 768px) {
    /* --- Auth Pages --- */
    .auth-left { display: none; }
    .auth-right { padding: 1rem; width: 100%; }
    .auth-card { padding: 1.75rem; max-width: 100%; }

    /* --- App Layout with Slide-out Sidebar --- */
    .app-layout { flex-direction: column; }

    .sidebar {
        position: fixed;
        width: 260px;
        height: 100vh;
        top: 0;
        left: 0;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
        z-index: 150;
        box-shadow: 18px 0 55px rgba(15, 23, 42, 0.3);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-toggle {
        display: flex;
    }

    .sidebar-nav a {
        margin-inline: 0.75rem;
    }

    /* --- Main Content Full Width --- */
    .main-content {
        margin-left: 0 !important;
        padding: 1.25rem;
        padding-top: 4.5rem;
        width: 100%;
    }

    .main-content::before {
        inset: 0 0 auto 0;
    }

    /* --- Page Header Stacked --- */
    .page-header {
        display: block;
    }

    .page-header .btn {
        margin-top: 0.75rem;
    }

    /* --- Stats Grid --- */
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 0.75rem; }

    /* --- Forms --- */
    .form-row { grid-template-columns: 1fr; }

    /* --- Landing --- */
    .landing-content h1 { font-size: 2rem; }

    /* --- Wizard --- */
    .wizard-steps { flex-wrap: wrap; gap: 0.5rem; justify-content: center; }
    .wizard-connector { width: 20px; }
    .wizard-step { padding: 0.4rem 0.6rem; font-size: 0.8rem; }

    /* --- Helper Grid --- */
    .helper-grid { grid-template-columns: 1fr; }

    /* --- Type Selector --- */
    .type-selector { grid-template-columns: 1fr; }

    /* --- Tables Scrollable --- */
    .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table {
        font-size: 0.82rem;
        min-width: 480px;
    }

    /* --- Cards --- */
    .card-body { padding: 1rem; }
    .card-header { padding: 1rem; flex-wrap: wrap; gap: 0.5rem; }
    .card-header h2 { font-size: 1rem; }

    /* --- Modal --- */
    .modal {
        width: 95%;
        padding: 1.5rem;
        max-height: 90vh;
    }

    /* --- Search Box --- */
    .search-box {
        flex-direction: column;
    }

    .search-box input {
        max-width: 100%;
    }
}

@media (max-width: 980px) {
    .landing-stage {
        grid-template-columns: 1fr;
        align-items: start;
        gap: 1.5rem;
        padding-top: 1rem;
    }

    .landing-copy {
        max-width: 720px;
    }

    .landing-command-panel {
        max-width: 640px;
    }

    .landing-feature-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .landing-nav,
    .landing-stage,
    .landing-feature-strip {
        width: min(100% - 28px, 1180px);
    }

    .landing-nav {
        height: 68px;
    }

    .landing-brand {
        font-size: 0.95rem;
    }

    .brand-mark {
        width: 34px;
        height: 34px;
    }

    .landing-nav-actions {
        gap: 0.5rem;
    }

    .landing-nav-actions .btn {
        padding: 0.48rem 0.72rem;
        font-size: 0.82rem;
    }

    .landing-copy h1 {
        font-size: clamp(2.5rem, 14vw, 4.8rem);
    }

    .landing-lede {
        font-size: 0.95rem;
        line-height: 1.65;
    }

    .landing-hero-3d .landing-actions {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
    }

    .landing-hero-3d .landing-actions .btn {
        justify-content: center;
        width: 100%;
    }

    .landing-metrics {
        grid-template-columns: 1fr;
    }

    .landing-metrics div {
        min-height: 80px;
        padding: 0.75rem;
    }

    .landing-command-panel {
        padding: 0.8rem;
    }

    .mini-map {
        height: 170px;
        gap: 0.45rem;
        padding: 0.6rem;
    }

    .tower {
        padding: 0.42rem;
        gap: 0.28rem;
    }

    .tower span {
        height: 11px;
    }

    .landing-feature-strip {
        grid-template-columns: 1fr;
        margin-bottom: 0.9rem;
    }

    .society-scene {
        opacity: 0.56;
    }

    /* Auth card tighter on phones */
    .auth-card {
        padding: 1.25rem;
    }

    .auth-card h2 {
        font-size: 1.4rem;
    }

    /* Workflow list compact */
    .workflow-list div {
        min-height: 58px;
        gap: 0.6rem;
        padding: 0.6rem;
    }

    .workflow-icon {
        width: 36px;
        height: 36px;
        font-size: 0.72rem;
    }

    .workflow-list strong {
        font-size: 0.88rem;
    }

    /* Buttons full width */
    .btn-lg {
        padding: 0.85rem 1.5rem;
        font-size: 1rem;
    }
}

/* === Animated App-Wide 3D Refresh === */
.ui-enhanced body:not(.landing-body) {
    min-height: 100vh;
    background:
        radial-gradient(circle at 12% 12%, rgba(6, 182, 212, 0.15), transparent 28rem),
        radial-gradient(circle at 88% 8%, rgba(34, 197, 94, 0.12), transparent 24rem),
        linear-gradient(145deg, #f8fafc 0%, #eef7f7 48%, #f9fafb 100%);
    position: relative;
    overflow-x: hidden;
}

/* --- Enhanced Ambient Shell with Orbs --- */
.ambient-shell {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: -1;
}

.ambient-shell span {
    position: absolute;
    display: block;
    width: clamp(90px, 12vw, 170px);
    aspect-ratio: 1;
    border: 1px solid rgba(14, 165, 233, 0.18);
    border-radius: 12px;
    background: linear-gradient(145deg, rgba(255,255,255,0.34), rgba(125,211,252,0.08));
    box-shadow: 0 32px 90px rgba(15, 23, 42, 0.09);
    transform: rotateX(58deg) rotateZ(45deg);
    animation: ambient-drift 18s ease-in-out infinite, ambient-pulse 6s ease-in-out infinite;
}

.ambient-shell span:nth-child(1) { top: 12%; left: 8%; }
.ambient-shell span:nth-child(2) { top: 18%; right: 7%; animation-delay: -6s; }
.ambient-shell span:nth-child(3) { bottom: 7%; left: 28%; animation-delay: -11s; }
.ambient-shell span:nth-child(4) { bottom: 16%; right: 18%; animation-delay: -3s; }

@keyframes ambient-drift {
    0%, 100% { transform: translate3d(0, 0, 0) rotateX(58deg) rotateZ(45deg); }
    50% { transform: translate3d(0, -22px, 0) rotateX(64deg) rotateZ(54deg); }
}

@keyframes ambient-pulse {
    0%, 100% { opacity: 1; border-color: rgba(14, 165, 233, 0.18); }
    33% { opacity: 0.7; border-color: rgba(34, 197, 94, 0.22); }
    66% { opacity: 0.85; border-color: rgba(167, 139, 250, 0.2); }
}

.app-layout {
    background:
        linear-gradient(115deg, rgba(255,255,255,0.2), transparent 38%),
        transparent;
}

/* --- Enhanced Sidebar with Glow Effects --- */
.sidebar {
    background:
        linear-gradient(180deg, rgba(4, 18, 32, 0.98), rgba(13, 63, 63, 0.96) 58%, rgba(20, 83, 45, 0.94)),
        #07111f;
    box-shadow: 18px 0 55px rgba(15, 23, 42, 0.22);
    border-right: 1px solid rgba(255,255,255,0.1);
}

.sidebar::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(rgba(125, 211, 252, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(125, 211, 252, 0.06) 1px, transparent 1px);
    background-size: 34px 34px;
    mask-image: linear-gradient(to bottom, black, transparent 88%);
    pointer-events: none;
    animation: grid-shift 30s linear infinite;
}

@keyframes grid-shift {
    0% { background-position: 0 0, 0 0; }
    100% { background-position: 0 34px, 34px 0; }
}

.sidebar-logo,
.sidebar-society,
.sidebar-nav,
.sidebar-footer {
    position: relative;
}

.sidebar-logo {
    letter-spacing: 0;
    text-shadow: 0 12px 36px rgba(125, 211, 252, 0.22);
}

.sidebar-logo::before {
    content: 'SE';
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    margin-right: 0.75rem;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.18);
    background: rgba(255,255,255,0.1);
    color: #a7f3d0;
    font-size: 0.75rem;
    vertical-align: middle;
    animation: logo-glow 4s ease-in-out infinite;
}

@keyframes logo-glow {
    0%, 100% { box-shadow: 0 0 12px rgba(167, 243, 208, 0.15); }
    50% { box-shadow: 0 0 24px rgba(167, 243, 208, 0.35), 0 0 48px rgba(125, 211, 252, 0.15); }
}

.sidebar-nav a {
    position: relative;
    margin: 0.18rem 0.75rem;
    padding: 0.82rem 0.9rem;
    border-radius: 8px;
    overflow: hidden;
    transform: translateZ(0);
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.sidebar-nav a::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at var(--spot-x, 20%) var(--spot-y, 50%), rgba(125, 211, 252, 0.24), transparent 44%);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.sidebar-nav a:hover::before,
.sidebar-nav a.active::before {
    opacity: 1;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    border-left: 0;
    background: rgba(255,255,255,0.12);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 12px 28px rgba(0,0,0,0.18);
    transform: translateX(5px) scale(1.02);
}

.sidebar-nav a.active {
    border-left: 3px solid #7dd3fc;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 12px 28px rgba(0,0,0,0.18), -3px 0 16px rgba(125, 211, 252, 0.2);
}

/* --- Main Content --- */
.main-content {
    position: relative;
}

.main-content::before {
    content: '';
    position: fixed;
    inset: 0 0 auto 260px;
    height: 210px;
    background:
        linear-gradient(135deg, rgba(8, 145, 178, 0.13), rgba(34, 197, 94, 0.08)),
        linear-gradient(90deg, rgba(255,255,255,0.74), rgba(255,255,255,0));
    pointer-events: none;
    z-index: -1;
}

/* --- Page Header with Gradient Shimmer --- */
.page-header {
    padding: 1.2rem 1.35rem;
    border: 1px solid rgba(255,255,255,0.8);
    border-radius: 8px;
    background: rgba(255,255,255,0.7);
    backdrop-filter: blur(18px);
    box-shadow: 0 20px 50px rgba(15,23,42,0.08);
    animation: header-entrance 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes header-entrance {
    from { opacity: 0; transform: translateY(-20px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.page-header h1 {
    background: linear-gradient(90deg, #0f766e, #2563eb, #16a34a);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: gradient-shift 6s ease-in-out infinite;
}

@keyframes gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* --- Enhanced Cards with Holographic Shimmer --- */
.card,
.stat-card,
.helper-card,
.auth-card,
.modal {
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.82);
    background:
        linear-gradient(145deg, rgba(255,255,255,0.94), rgba(248,250,252,0.78)),
        var(--surface);
    backdrop-filter: blur(18px);
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.1);
}

.card,
.stat-card,
.helper-card,
.auth-card {
    position: relative;
    overflow: hidden;
}

/* Holographic rainbow shimmer on hover */
.card::before,
.stat-card::before,
.helper-card::before,
.auth-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        105deg,
        transparent 0%,
        rgba(255,255,255,0.3) 20%,
        rgba(56,189,248,0.12) 35%,
        rgba(167,139,250,0.12) 45%,
        rgba(167,243,208,0.12) 55%,
        rgba(253,230,138,0.12) 65%,
        rgba(255,255,255,0.3) 80%,
        transparent 100%
    );
    transform: translateX(-120%);
    transition: transform 0.85s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
    z-index: 1;
}

.card:hover::before,
.stat-card:hover::before,
.helper-card:hover::before,
.auth-card:hover::before {
    transform: translateX(120%);
}

/* --- Enhanced 3D Tilt Surface --- */
.tilt-surface {
    transform: perspective(800px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
    transform-style: preserve-3d;
    transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
}

.tilt-surface:hover {
    box-shadow:
        0 26px 70px rgba(15, 23, 42, 0.16),
        0 0 0 1px rgba(125, 211, 252, 0.08);
}

/* --- Stat Cards with Enhanced Hover --- */
.stat-card .stat-value {
    text-shadow: 0 12px 32px rgba(79, 70, 229, 0.18);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.stat-card:hover .stat-value {
    transform: scale(1.08);
}

.stat-card:hover,
.helper-card:hover,
.card:hover {
    transform: translateY(-6px);
    box-shadow: 0 28px 60px rgba(15, 23, 42, 0.14);
}

.card-header {
    background:
        linear-gradient(90deg, rgba(14, 165, 233, 0.08), rgba(34, 197, 94, 0.08)),
        rgba(255,255,255,0.38);
}

/* --- Enhanced Form Inputs with Neon Glow --- */
.form-control {
    background: rgba(255,255,255,0.86);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.8), 0 10px 22px rgba(15,23,42,0.04);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.form-control:hover {
    border-color: rgba(14, 165, 233, 0.45);
    transform: translateY(-1px);
}

.form-control:focus {
    outline: none;
    border-color: #38bdf8;
    box-shadow:
        0 0 0 3px rgba(56, 189, 248, 0.15),
        0 0 20px rgba(56, 189, 248, 0.1),
        inset 0 1px 0 rgba(255,255,255,0.8);
    transform: translateY(-2px);
}

/* --- Magnetic Buttons with Ripple --- */
.btn {
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 24px rgba(15,23,42,0.08);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform: translate(var(--mag-x, 0px), var(--mag-y, 0px));
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, transparent, rgba(255,255,255,0.34), transparent);
    transform: translateX(-120%);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn:hover {
    transform: translate(var(--mag-x, 0px), var(--mag-y, 0px)) translateY(-3px) scale(1.03);
    box-shadow: 0 16px 36px rgba(15,23,42,0.12);
}

.btn:hover::after {
    transform: translateX(120%);
}

.btn:active {
    transform: translate(var(--mag-x, 0px), var(--mag-y, 0px)) translateY(0) scale(0.97);
    transition-duration: 0.1s;
}

/* Click ripple effect */
.btn-ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,0.45);
    transform: scale(0);
    animation: ripple-expand 0.6s ease-out forwards;
    pointer-events: none;
    z-index: 2;
}

@keyframes ripple-expand {
    to { transform: scale(4); opacity: 0; }
}

.btn-primary,
.btn-success {
    background: linear-gradient(135deg, #0f766e, #2563eb);
    background-size: 200% 200%;
    animation: btn-gradient-idle 5s ease infinite;
}

@keyframes btn-gradient-idle {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.btn-primary:hover,
.btn-success:hover {
    background: linear-gradient(135deg, #115e59, #1d4ed8);
    background-size: 200% 200%;
}

/* --- Enhanced Tables with 3D Row Lift --- */
table {
    overflow: hidden;
    border-radius: 8px;
}

thead th {
    background: linear-gradient(90deg, rgba(15, 118, 110, 0.1), rgba(37, 99, 235, 0.09));
}

tbody tr {
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

tbody tr:hover {
    transform: scale(1.008) translateY(-2px);
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.1);
    background: linear-gradient(90deg, rgba(56, 189, 248, 0.04), rgba(167, 243, 208, 0.04));
    position: relative;
    z-index: 1;
}

/* --- Enhanced Badges --- */
.badge {
    border-radius: 8px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.45);
    transition: all 0.2s ease;
}

.badge:hover {
    transform: scale(1.05);
}

/* --- Auth Pages with Particle Constellation --- */
.auth-page {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at 18% 18%, rgba(125, 211, 252, 0.24), transparent 28rem),
        radial-gradient(circle at 80% 75%, rgba(34, 197, 94, 0.18), transparent 26rem),
        #07111f;
}

/* Particle constellation dots */
.auth-page::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(1.5px 1.5px at 10% 20%, rgba(125,211,252,0.5) 50%, transparent 50%),
        radial-gradient(1px 1px at 30% 65%, rgba(167,243,208,0.4) 50%, transparent 50%),
        radial-gradient(1.5px 1.5px at 55% 15%, rgba(253,230,138,0.4) 50%, transparent 50%),
        radial-gradient(1px 1px at 75% 50%, rgba(125,211,252,0.35) 50%, transparent 50%),
        radial-gradient(2px 2px at 85% 80%, rgba(167,139,250,0.4) 50%, transparent 50%),
        radial-gradient(1px 1px at 20% 85%, rgba(253,230,138,0.3) 50%, transparent 50%),
        radial-gradient(1.5px 1.5px at 45% 40%, rgba(167,243,208,0.3) 50%, transparent 50%),
        radial-gradient(1px 1px at 65% 70%, rgba(125,211,252,0.35) 50%, transparent 50%),
        radial-gradient(1.5px 1.5px at 90% 25%, rgba(167,139,250,0.3) 50%, transparent 50%),
        radial-gradient(1px 1px at 5% 50%, rgba(253,230,138,0.4) 50%, transparent 50%);
    animation: constellation-drift 40s linear infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes constellation-drift {
    0% { transform: translateY(0); }
    100% { transform: translateY(-30px); }
}

.auth-left {
    position: relative;
    background:
        linear-gradient(145deg, rgba(7,17,31,0.98), rgba(13,63,63,0.92)),
        #07111f;
    overflow: hidden;
}

.auth-left::before {
    content: '';
    position: absolute;
    width: 420px;
    height: 420px;
    border: 1px solid rgba(125,211,252,0.18);
    border-radius: 18px;
    transform: rotateX(58deg) rotateZ(45deg);
    background:
        linear-gradient(rgba(125, 211, 252, 0.12) 1px, transparent 1px),
        linear-gradient(90deg, rgba(125, 211, 252, 0.12) 1px, transparent 1px);
    background-size: 34px 34px;
    bottom: -110px;
    left: -70px;
    animation: ambient-drift 14s ease-in-out infinite;
}

.auth-left::after {
    content: '';
    position: absolute;
    width: 150px;
    height: 210px;
    right: 13%;
    bottom: 20%;
    border-radius: 8px 8px 3px 3px;
    background:
        linear-gradient(90deg, transparent 18%, rgba(125,211,252,0.45) 18% 31%, transparent 31% 48%, rgba(167,243,208,0.55) 48% 61%, transparent 61% 78%, rgba(253,230,138,0.55) 78%),
        linear-gradient(180deg, #e2e8f0, #94a3b8);
    box-shadow: 30px 24px 0 rgba(15,23,42,0.26), 0 -12px 0 #22c55e;
    transform: perspective(600px) rotateY(-18deg);
    animation: building-sway 8s ease-in-out infinite;
}

@keyframes building-sway {
    0%, 100% { transform: perspective(600px) rotateY(-18deg); }
    50% { transform: perspective(600px) rotateY(-14deg) translateY(-4px); }
}

.auth-left > div {
    position: relative;
    z-index: 1;
}

/* --- Enhanced Auth Card Float with Subtle Rotation --- */
.auth-card {
    animation: float-card-3d 7s ease-in-out infinite;
    z-index: 1;
}

@keyframes float-card-3d {
    0%, 100% { transform: translateY(0) rotateX(0deg) rotateY(0deg); }
    25% { transform: translateY(-5px) rotateX(0.5deg) rotateY(-0.5deg); }
    50% { transform: translateY(-10px) rotateX(-0.3deg) rotateY(0.3deg); }
    75% { transform: translateY(-5px) rotateX(0.3deg) rotateY(0.5deg); }
}

/* --- Wizard Step Enhancements --- */
.wizard-step .step-number {
    box-shadow: 0 10px 22px rgba(79, 70, 229, 0.16);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.wizard-step.active .step-number {
    background: linear-gradient(135deg, #0f766e, #2563eb);
    animation: step-pulse 2s ease-in-out infinite;
}

@keyframes step-pulse {
    0%, 100% { box-shadow: 0 10px 22px rgba(79, 70, 229, 0.16); }
    50% { box-shadow: 0 10px 30px rgba(15, 118, 110, 0.35), 0 0 12px rgba(56, 189, 248, 0.2); }
}

.wizard-step.completed .step-number {
    animation: step-complete 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes step-complete {
    0% { transform: scale(1); }
    50% { transform: scale(1.3) rotateY(180deg); }
    100% { transform: scale(1) rotateY(360deg); }
}

.wizard-connector {
    transition: all 0.5s ease;
}

.wizard-connector.completed {
    background: linear-gradient(90deg, var(--success), #38bdf8);
    height: 3px;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.3);
}

/* --- 3D Wizard Panel Transitions --- */
.wizard-panel {
    display: none;
}

.wizard-panel.active {
    display: block;
    animation: panel-flip-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes panel-flip-in {
    from {
        opacity: 0;
        transform: perspective(600px) rotateY(8deg) translateX(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: perspective(600px) rotateY(0deg) translateX(0) scale(1);
    }
}

/* --- Enhanced Modal --- */
.modal-overlay.active .modal {
    animation: modal-3d-entrance 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes modal-3d-entrance {
    from {
        opacity: 0;
        transform: perspective(600px) rotateX(-8deg) translateY(-40px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: perspective(600px) rotateX(0deg) translateY(0) scale(1);
    }
}

/* --- Spring Entrance Reveal --- */
.reveal-surface {
    opacity: 0;
    transform: translateY(28px) scale(0.96);
}

.reveal-surface.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    transition:
        opacity 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) var(--reveal-delay, 0ms),
        transform 0.65s cubic-bezier(0.34, 1.56, 0.64, 1) var(--reveal-delay, 0ms);
}

/* --- Form Group Stagger Animation --- */
.auth-card .form-group {
    animation: form-stagger 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.auth-card .form-group:nth-child(1) { animation-delay: 0.1s; }
.auth-card .form-group:nth-child(2) { animation-delay: 0.18s; }
.auth-card .form-group:nth-child(3) { animation-delay: 0.26s; }
.auth-card .form-group:nth-child(4) { animation-delay: 0.34s; }
.auth-card .form-group:nth-child(5) { animation-delay: 0.42s; }

@keyframes form-stagger {
    from { opacity: 0; transform: translateY(16px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* --- Alert Slide-in --- */
.alert {
    animation: alert-slide 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes alert-slide {
    from { opacity: 0; transform: translateX(-20px) scale(0.95); }
    to { opacity: 1; transform: translateX(0) scale(1); }
}

/* === Society Type Selector Cards === */
.type-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.type-card {
    position: relative;
    padding: 1.4rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform: perspective(600px) rotateX(0deg) rotateY(0deg);
    transform-style: preserve-3d;
    overflow: hidden;
    text-align: center;
}

.type-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        transparent,
        rgba(56,189,248,0.06) 30%,
        rgba(167,243,208,0.06) 60%,
        transparent
    );
    opacity: 0;
    transition: opacity 0.3s ease;
}

.type-card:hover {
    transform: perspective(600px) translateY(-6px) scale(1.03);
    box-shadow: 0 20px 50px rgba(15,23,42,0.12);
    border-color: rgba(56,189,248,0.3);
}

.type-card:hover::before {
    opacity: 1;
}

.type-card.selected {
    border-color: var(--primary);
    background: var(--primary-bg);
    box-shadow: 0 0 0 3px rgba(79,70,229,0.15), 0 20px 50px rgba(15,23,42,0.1);
    transform: perspective(600px) translateY(-4px) scale(1.02);
}

.type-card .type-icon {
    font-size: 2.2rem;
    margin-bottom: 0.6rem;
    display: block;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.1));
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.type-card:hover .type-icon {
    transform: scale(1.15) translateY(-3px);
}

.type-card .type-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    display: block;
    margin-bottom: 0.3rem;
}

.type-card .type-desc {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* --- Dynamic Form Section Toggle --- */
.config-section {
    animation: config-morph 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes config-morph {
    from { opacity: 0; transform: translateY(14px) scale(0.97); max-height: 0; }
    to { opacity: 1; transform: translateY(0) scale(1); max-height: 800px; }
}

/* --- Toggle Switch for blocks --- */
.toggle-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    padding: 0.75rem 1rem;
    background: var(--primary-bg);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(79,70,229,0.1);
}

.toggle-group label {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text);
    margin: 0;
    cursor: pointer;
}

.toggle-switch {
    position: relative;
    width: 48px;
    height: 26px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--border);
    border-radius: 13px;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    flex-shrink: 0;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.toggle-switch:checked {
    background: linear-gradient(135deg, #0f766e, #2563eb);
}

.toggle-switch:checked::after {
    left: 25px;
}

/* --- Landing Page Enhancements --- */
.landing-kicker {
    animation: kicker-entrance 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s both;
}

@keyframes kicker-entrance {
    from { opacity: 0; transform: translateY(12px) scale(0.9); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.landing-copy h1 {
    animation: title-cascade 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 0.4s both;
}

@keyframes title-cascade {
    from { opacity: 0; transform: translateY(30px); filter: blur(8px); }
    to { opacity: 1; transform: translateY(0); filter: blur(0); }
}

.landing-lede {
    animation: lede-entrance 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 0.6s both;
}

@keyframes lede-entrance {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.landing-hero-3d .landing-actions {
    animation: actions-entrance 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 0.8s both;
}

@keyframes actions-entrance {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Breathing glow on metrics */
.landing-metrics div {
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    animation: metrics-entrance 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.landing-metrics div:nth-child(1) { animation-delay: 1s; }
.landing-metrics div:nth-child(2) { animation-delay: 1.15s; }
.landing-metrics div:nth-child(3) { animation-delay: 1.3s; }

@keyframes metrics-entrance {
    from { opacity: 0; transform: translateY(16px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.landing-metrics div:hover {
    transform: translateY(-4px) scale(1.03);
    border-color: rgba(253, 230, 138, 0.4);
    box-shadow: 0 12px 30px rgba(0,0,0,0.2), inset 0 0 20px rgba(253, 230, 138, 0.05);
}

/* Feature strip slide-in */
.landing-feature-strip article {
    animation: feature-slide 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
    transition: all 0.3s ease;
}

.landing-feature-strip article:nth-child(1) { animation-delay: 1.2s; }
.landing-feature-strip article:nth-child(2) { animation-delay: 1.35s; }
.landing-feature-strip article:nth-child(3) { animation-delay: 1.5s; }
.landing-feature-strip article:nth-child(4) { animation-delay: 1.65s; }

@keyframes feature-slide {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.landing-feature-strip article:hover {
    background: rgba(7, 17, 31, 0.75);
    transform: translateY(-2px);
}

/* Command panel entrance */
.landing-command-panel {
    animation: panel-entrance 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 0.9s both;
}

@keyframes panel-entrance {
    from { opacity: 0; transform: translateX(30px) scale(0.95); }
    to { opacity: 1; transform: translateX(0) scale(1); }
}

/* Workflow item hover */
.workflow-list div {
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.workflow-list div:hover {
    transform: translateX(4px) scale(1.02);
    background: rgba(255,255,255,0.1);
}

/* Tower window blink */
.tower span {
    animation: window-blink 4s ease-in-out infinite;
}

.tower span:nth-child(odd) { animation-delay: -2s; }
.tower span:nth-child(3) { animation-delay: -1s; }
.tower span:nth-child(4) { animation-delay: -3s; }

@keyframes window-blink {
    0%, 85%, 100% { opacity: 1; }
    90% { opacity: 0.3; }
}

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

/* === Small Phones (480px and below) === */
@media (max-width: 480px) {
    /* Stats single column */
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-card .stat-value {
        font-size: 1.6rem;
    }

    /* Landing nav compact */
    .landing-nav {
        height: 58px;
    }

    .nav-link {
        display: none;
    }

    .landing-copy h1 {
        font-size: clamp(2rem, 12vw, 3.5rem);
    }

    .landing-lede {
        font-size: 0.88rem;
    }

    .landing-kicker {
        font-size: 0.68rem;
        padding: 0 0.6rem;
    }

    /* Auth */
    .auth-card {
        padding: 1rem;
        border-radius: var(--radius-sm);
    }

    .auth-card h2 {
        font-size: 1.25rem;
    }

    .auth-card .subtitle {
        font-size: 0.82rem;
        margin-bottom: 1.25rem;
    }

    /* Wizard very compact */
    .wizard-steps {
        gap: 0.25rem;
    }

    .wizard-step {
        font-size: 0.72rem;
        padding: 0.3rem 0.4rem;
    }

    .wizard-step .step-number {
        width: 24px;
        height: 24px;
        font-size: 0.7rem;
    }

    .wizard-connector {
        width: 14px;
    }

    /* Form tighter */
    .form-group {
        margin-bottom: 1rem;
    }

    .form-group label {
        font-size: 0.8rem;
    }

    .form-control {
        padding: 0.65rem 0.85rem;
        font-size: 0.88rem;
    }

    /* Toggle group */
    .toggle-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        padding: 0.65rem 0.85rem;
    }

    /* Buttons */
    .btn {
        font-size: 0.88rem;
    }

    .btn-lg {
        padding: 0.75rem 1.25rem;
        font-size: 0.92rem;
    }

    /* Modal */
    .modal {
        width: 96%;
        padding: 1.25rem;
    }

    /* Page header */
    .page-header h1 {
        font-size: 1.35rem;
    }

    /* Cards */
    .card-body {
        padding: 0.85rem;
    }

    .card-header {
        padding: 0.85rem;
    }

    .card-header h2 {
        font-size: 0.92rem;
    }

    /* Type card */
    .type-card {
        padding: 1rem;
    }

    .type-card .type-icon {
        font-size: 1.8rem;
    }

    .type-card .type-name {
        font-size: 0.9rem;
    }
}
