/* ==========================================================================
   Bilingual Legal Automation Platform Style System
   Theme: Premium Legal SaaS (Poppins UI & Light-Blue Gradient Header)
   Optimized for Courts, Lawyers, and Judicial Workflows
   ========================================================================== */

/* Design Tokens & Theme Variables */
:root {
    /* Authoritative legal blues */
    --primary-blue: #0ea5e9;
    --primary-blue-hover: #0284c7;
    --accent-blue-light: #f0f9ff;
    --accent-blue-border: #e0f2fe;
    
    /* Modern gradients */
    --navbar-gradient: linear-gradient(135deg, #38bdf8 0%, #0284c7 100%);
    --primary-gradient: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    --secondary-gradient: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    --accent-gradient: linear-gradient(135deg, #7dd3fc 0%, #0ea5e9 100%);
    --success-gradient: linear-gradient(135deg, #34d399 0%, #059669 100%);
    --danger-gradient: linear-gradient(135deg, #f87171 0%, #dc2626 100%);
    
    /* Color palette */
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    
    --text-primary: #0f172a;
    --text-muted: #64748b;
    --text-light: #f8fafc;
    
    --border-color: #f1f5f9;
    --accent-color: #0ea5e9;
    --accent-glow: rgba(14, 165, 233, 0.08);
    
    /* Elegant SaaS shadows */
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px -1px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.04), 0 4px 6px -4px rgba(15, 23, 42, 0.02);
    --shadow-premium: 0 20px 25px -5px rgba(15, 23, 42, 0.06), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
    
    /* Animation timings */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Global Resets & Layout */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body, input, select, textarea, button, table, tr, td, th, h1, h2, h3, h4, h5, h6 {
    font-family: 'Poppins', sans-serif;
}

/* Keep document text styles isolated from UI font overrides */
.document-page, .document-page *, .pdf-container, .pdf-container * {
    font-family: inherit; /* Preserves Times / Noto Sans Gujarati */
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

/* Page Containers */
.app-container {
    width: 100%;
    min-height: calc(100vh - 72px);
    display: flex;
    flex-direction: column;
}

.container-limit {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Horizontal Top Navbar - Judicial Light-Blue Gradient */
.app-navbar {
    background: var(--navbar-gradient);
    height: 72px;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-md);
}

.navbar-limit {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
}

.brand-logo-icon {
    font-size: 1.8rem;
    background: rgba(255, 255, 255, 0.2);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
}

.brand-text {
    font-size: 1.35rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.5px;
    display: block;
    line-height: 1.2;
}

.brand-subtext {
    font-size: 0.65rem;
    font-weight: 600;
    color: #e0f2fe;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    display: block;
    margin-top: 1px;
}

.navbar-menu {
    display: flex;
    gap: 1.25rem;
    align-items: center;
}

.navbar-item {
    color: #f0f9ff;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    transition: var(--transition-normal);
    position: relative;
    white-space: nowrap;
}

.navbar-item:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.1);
}

.navbar-item.active {
    color: #ffffff;
    font-weight: 600;
    background-color: rgba(255, 255, 255, 0.15);
}

.navbar-item.active::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 15%;
    width: 70%;
    height: 3px;
    background-color: #ffffff;
    border-top-left-radius: 2px;
    border-top-right-radius: 2px;
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.user-avatar {
    width: 38px;
    height: 38px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    font-weight: 600;
    font-size: 0.85rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
}

.user-details {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.user-name {
    font-weight: 600;
    font-size: 0.85rem;
    color: #ffffff;
    line-height: 1.2;
}

.user-role {
    font-size: 0.65rem;
    color: #e0f2fe;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 1px;
}

.navbar-logout-btn {
    padding: 0.4rem 0.8rem;
    background-color: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.8rem;
    transition: var(--transition-normal);
    white-space: nowrap;
}

.navbar-logout-btn:hover {
    background-color: #ef4444;
    border-color: #ef4444;
}

/* Mobile Hamburger Toggle */
.navbar-hamburger {
    display: none;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-normal);
    padding: 0;
}

.navbar-hamburger:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Mobile Drawer Overlay */
.navbar-mobile-drawer {
    position: fixed;
    top: 72px;
    left: 0;
    width: 100%;
    height: calc(100vh - 72px);
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    flex-direction: column;
    padding: 1.5rem 1.25rem;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    overflow-y: auto;
}

.navbar-mobile-drawer.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.mobile-drawer-header {
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.user-info-mobile {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    cursor: pointer;
}

.user-avatar-mobile {
    width: 44px;
    height: 44px;
    background: var(--navbar-gradient);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    font-weight: 700;
    font-size: 1rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-user-name {
    font-size: 1rem;
    font-weight: 700;
    color: #ffffff;
}

.mobile-user-role {
    font-size: 0.75rem;
    color: #bae6fd;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mobile-menu-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem 1rem;
    color: #f1f5f9;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.2s ease;
}

.mobile-nav-link:hover, .mobile-nav-link.active {
    background: rgba(255, 255, 255, 0.22);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateX(4px);
}

.mobile-nav-icon {
    font-size: 1.25rem;
}

.mobile-drawer-footer {
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    margin-top: 1rem;
}

/* App Main Content Area */
.app-content {
    flex-grow: 1;
    padding: 1.25rem 0;
}

.app-content.full-width {
    padding: 0;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 0.75rem;
}

.header-title {
    display: flex;
    align-items: center;
    min-width: 0;
}

.header-title h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

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

.content-header h1 {
    font-size: 1.75rem;
    font-weight: 600;
    color: #0f172a;
    letter-spacing: -0.5px;
}

/* Animations */
.animate-fade-in {
    animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

/* Professional Page Loaders */
.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.loader-overlay.hide {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

.loader-spinner {
    width: 44px;
    height: 44px;
    border: 3px solid var(--accent-blue-border);
    border-left-color: var(--primary-blue-hover);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loader-text {
    margin-top: 1rem;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Modern SaaS Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background-color: var(--bg-card);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 1.25rem;
    transition: var(--transition-normal);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent-blue-border);
}

.stat-icon {
    font-size: 1.5rem;
    width: 56px;
    height: 56px;
    background-color: var(--accent-blue-light);
    color: var(--primary-blue-hover);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--accent-blue-border);
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.1;
    margin-bottom: 2px;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Dashboard Cards & Layout Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1.3fr 0.7fr;
    }
}

.card {
    background-color: var(--bg-card);
    border-radius: 14px;
    padding: 1.25rem 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    margin-bottom: 1rem;
}

.card-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Table Design - High Contrast & Spacious */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    padding: 0.85rem 1.25rem;
    font-weight: 600;
    font-size: 0.78rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border-color);
    background-color: #f8fafc;
}

td {
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
    color: var(--text-primary);
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background-color: #f8fafc;
}

/* Badges */
.badge {
    display: inline-flex;
    padding: 0.2rem 0.55rem;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 9999px;
    text-transform: uppercase;
}

.badge-draft {
    background: #fef3c7;
    color: #b45309;
}

.badge-final {
    background: #e0f2fe;
    color: #0369a1;
}

.text-link {
    color: var(--primary-blue-hover);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition-fast);
}

.text-link:hover {
    text-decoration: underline;
}

/* Buttons - Premium Gradient Sizes */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: none;
    border: none;
    transition: var(--transition-normal);
}

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

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.25);
}

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

.btn-secondary:hover {
    background-color: #f8fafc;
    border-color: #cbd5e1;
    transform: translateY(-1px);
}

.btn-danger {
    background: var(--danger-gradient);
    color: white;
}

.btn-danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.15);
}

.btn-sm {
    padding: 0.45rem 1rem;
    font-size: 0.8rem;
    border-radius: 6px;
}

/* Alerts */
.alert {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.25rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-weight: 500;
    font-size: 0.85rem;
    box-shadow: var(--shadow-sm);
}

.alert-success {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
}

.alert-danger {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #991b1b;
}

/* ==========================================================================
   Modern SaaS Authentication Design System (Split-Screen & Live Metrics)
   ========================================================================== */
.app-content.full-width {
    padding: 0;
}

.app-content.full-width .container-limit {
    max-width: 100%;
    padding: 0;
}

.auth-page {
    min-height: 100vh;
    background: radial-gradient(circle at 10% 20%, rgba(224, 242, 254, 0.4) 0%, rgba(248, 250, 252, 1) 60%, rgba(240, 249, 255, 0.5) 100%);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
}

/* Guest Navigation Top Bar */
.auth-navbar {
    padding: 1.25rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1360px;
    width: 100%;
    margin: 0 auto;
    z-index: 10;
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

.auth-brand-icon {
    font-size: 1.6rem;
    background: var(--navbar-gradient);
    color: #ffffff;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(14, 165, 233, 0.3);
}

.auth-brand-text {
    font-size: 1.35rem;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.auth-brand-subtext {
    font-size: 0.68rem;
    font-weight: 600;
    color: #0284c7;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    display: block;
}

.auth-nav-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: #059669;
    font-weight: 600;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    padding: 0.35rem 0.85rem;
    border-radius: 9999px;
}

.auth-status-dot {
    width: 8px;
    height: 8px;
    background-color: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 8px #10b981;
    animation: pulse 2s infinite;
}

/* Split Main Container */
.auth-main-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 2rem 3rem;
    max-width: 1360px;
    width: 100%;
    margin: 0 auto;
    z-index: 1;
}

.auth-grid {
    display: grid;
    grid-template-columns: 1.18fr 0.82fr;
    gap: 3.5rem;
    align-items: center;
    width: 100%;
}

/* Left Showcase Area */
.auth-showcase {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}

.auth-hero-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #e0f2fe;
    border: 1px solid #bae6fd;
    color: #0369a1;
    padding: 0.4rem 1rem;
    border-radius: 9999px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    width: fit-content;
}

.auth-hero-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.2;
    letter-spacing: -1px;
}

.auth-hero-title span {
    background: linear-gradient(135deg, #0284c7 0%, #38bdf8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.auth-hero-desc {
    font-size: 1.05rem;
    color: #475569;
    line-height: 1.6;
    max-width: 580px;
}

/* Metric Counter Cards */
.auth-metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.metric-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 14px;
    padding: 1.15rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.25s ease;
}

.metric-card:hover {
    transform: translateY(-3px);
    border-color: #bae6fd;
    box-shadow: var(--shadow-md);
    background: #ffffff;
}

.metric-icon-box {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.metric-icon-blue {
    background: #f0f9ff;
    color: #0284c7;
    border: 1px solid #e0f2fe;
}

.metric-icon-emerald {
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #d1fae5;
}

.metric-icon-amber {
    background: #fffbeb;
    color: #d97706;
    border: 1px solid #fef3c7;
}

.metric-icon-violet {
    background: #f5f3ff;
    color: #7c3aed;
    border: 1px solid #ede9fe;
}

.metric-value {
    font-size: 1.45rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.1;
}

.metric-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #64748b;
    margin-top: 2px;
}

.metric-sub {
    font-size: 0.7rem;
    color: #94a3b8;
}

/* Document Live Preview Floating Card */
.auth-preview-mockup {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 1.25rem 1.5rem;
    box-shadow: var(--shadow-premium);
    position: relative;
    overflow: hidden;
}

.auth-preview-mockup::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--navbar-gradient);
}

.mockup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #f1f5f9;
}

.mockup-tag {
    font-size: 0.75rem;
    font-weight: 700;
    color: #0284c7;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.mockup-badge {
    background: #ecfdf5;
    color: #059669;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 9999px;
}

.mockup-content {
    font-size: 0.85rem;
    color: #334155;
    line-height: 1.5;
}

.mockup-gujarati {
    font-family: 'Noto Sans Gujarati', sans-serif;
    color: #0f172a;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.mockup-english {
    font-family: 'Times New Roman', serif;
    color: #475569;
    font-size: 0.85rem;
}

.auth-feature-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.feature-tag {
    font-size: 0.75rem;
    font-weight: 600;
    color: #475569;
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid #e2e8f0;
    padding: 0.35rem 0.75rem;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

/* Right Authentication Card */
.auth-form-container {
    display: flex;
    justify-content: center;
}

.auth-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    width: 100%;
    max-width: 460px;
    padding: 2.5rem 2.25rem;
    box-shadow: 0 20px 40px -15px rgba(15, 23, 42, 0.08), 0 0 0 1px rgba(226, 232, 240, 0.6);
    position: relative;
    animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-header {
    text-align: left;
    margin-bottom: 1.75rem;
}

.auth-header-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: #f0f9ff;
    color: #0284c7;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.65rem;
    border-radius: 6px;
    margin-bottom: 0.6rem;
    border: 1px solid #e0f2fe;
}

.auth-header h2 {
    font-size: 1.65rem;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.5px;
    margin-bottom: 0.25rem;
}

.auth-header p {
    color: #64748b;
    font-size: 0.88rem;
}

/* Demo Autofill Helper */
.demo-helper-box {
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 10px;
    padding: 0.65rem 0.85rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.35rem;
    font-size: 0.78rem;
    color: #475569;
}

.demo-fill-btn {
    background: #e0f2fe;
    border: 1px solid #bae6fd;
    color: #0284c7;
    font-weight: 600;
    font-size: 0.75rem;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.demo-fill-btn:hover {
    background: #0284c7;
    color: #ffffff;
}

/* Input Fields with Icons */
.form-group {
    margin-bottom: 1.25rem;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 0.45rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: #334155;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.input-icon-prefix {
    position: absolute;
    left: 14px;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.65rem;
    border-radius: 10px;
    border: 1.5px solid #e2e8f0;
    background: #ffffff;
    color: var(--text-primary);
    font-size: 0.92rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-input:focus {
    outline: none;
    border-color: #0284c7;
    box-shadow: 0 0 0 3.5px rgba(14, 165, 233, 0.12);
}

.input-toggle-suffix {
    position: absolute;
    right: 12px;
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 4px;
    transition: color 0.15s ease;
}

.input-toggle-suffix:hover {
    color: #0f172a;
}

.auth-action-btn {
    width: 100%;
    margin-top: 1.25rem;
    padding: 0.85rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 10px;
    background: var(--primary-gradient);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(14, 165, 233, 0.3);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.25s ease;
}

.auth-action-btn:hover {
    box-shadow: 0 6px 20px rgba(14, 165, 233, 0.4);
    transform: translateY(-1px);
}

.auth-action-btn:active {
    transform: scale(0.98);
}

.auth-footer {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.auth-footer a {
    color: var(--primary-blue-hover);
    text-decoration: none;
    font-weight: 600;
}

.auth-footer a:hover {
    text-decoration: underline;
}

.auth-security-badge {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font-size: 0.72rem;
    color: #94a3b8;
}

/* Responsive Breakpoints & Mobile Optimization */
@media (max-width: 1024px) {
    .auth-main-wrapper {
        padding: 1.25rem 1.25rem 3rem;
    }

    .auth-grid {
        grid-template-columns: 1fr;
        gap: 2.25rem;
    }
    
    /* Prioritize login form on mobile so user sees it right away */
    .auth-form-container {
        order: 1;
        width: 100%;
    }

    .auth-showcase {
        order: 2;
        text-align: center;
        align-items: center;
        gap: 1.5rem;
    }

    .auth-hero-pill {
        margin: 0 auto;
    }
    
    .auth-hero-desc {
        margin: 0 auto;
        font-size: 0.95rem;
    }

    .auth-hero-title {
        font-size: 1.95rem;
    }

    .auth-feature-tags {
        justify-content: center;
    }

    .auth-preview-mockup {
        display: none;
    }
}

@media (max-width: 640px) {
    .auth-navbar {
        padding: 0.85rem 1rem;
    }

    .auth-brand-icon {
        width: 36px;
        height: 36px;
        font-size: 1.3rem;
        border-radius: 10px;
    }

    .auth-brand-text {
        font-size: 1.15rem;
    }

    .auth-brand-subtext {
        font-size: 0.58rem;
        letter-spacing: 0.8px;
    }

    .auth-nav-status {
        font-size: 0.72rem;
        padding: 0.25rem 0.6rem;
    }

    .auth-main-wrapper {
        padding: 0.75rem 1rem 2.5rem;
    }

    .auth-card {
        padding: 1.75rem 1.25rem;
        border-radius: 16px;
        box-shadow: var(--shadow-md);
    }

    .auth-header h2 {
        font-size: 1.45rem;
    }

    .form-input {
        font-size: 16px; /* Prevents auto-zoom on mobile Safari */
        padding: 0.75rem 0.85rem 0.75rem 2.65rem;
    }

    .auth-hero-title {
        font-size: 1.5rem;
        line-height: 1.25;
    }

    .auth-metrics-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.65rem;
        width: 100%;
    }

    .metric-card {
        padding: 0.75rem 0.75rem;
        gap: 0.65rem;
        border-radius: 10px;
    }

    .metric-icon-box {
        width: 34px;
        height: 34px;
        font-size: 1rem;
        border-radius: 8px;
    }

    .metric-value {
        font-size: 1.15rem;
    }

    .metric-label {
        font-size: 0.7rem;
    }

    .metric-sub {
        font-size: 0.62rem;
        display: none;
    }

    .feature-tag {
        font-size: 0.7rem;
        padding: 0.3rem 0.6rem;
    }
}

@media (max-width: 380px) {
    .auth-metrics-grid {
        grid-template-columns: 1fr;
    }

    .metric-sub {
        display: block;
    }

    .auth-nav-status span:last-child {
        display: none;
    }
}

/* Editor Workspace */
.editor-workspace {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    height: calc(100vh - 160px);
}

@media (min-width: 1200px) {
    .editor-workspace {
        grid-template-columns: 3.1fr 0.9fr;
    }
}

.editor-main {
    display: flex;
    flex-direction: column;
    background-color: #e2e8f0;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.editor-toolbar {
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    padding: 0.6rem 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
}

.toolbar-group {
    display: flex;
    align-items: center;
    gap: 2px;
    border-right: 1px solid var(--border-color);
    padding-right: 0.5rem;
    margin-right: 0.25rem;
}

.toolbar-group:last-child {
    border-right: none;
}

.toolbar-btn {
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    min-width: 30px;
    height: 30px;
    padding: 0 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-primary);
    transition: var(--transition-fast);
    white-space: nowrap;
}

.toolbar-btn:hover {
    background-color: #f1f5f9;
    border-color: #cbd5e1;
}

.toolbar-btn.active {
    background-color: #e0f2fe;
    color: var(--primary-blue);
    border-color: #7dd3fc;
}

.toolbar-select {
    height: 30px;
    padding: 2px 6px;
    font-size: 0.82rem;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: var(--text-primary);
    outline: none;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
}

.toolbar-select:focus {
    border-color: var(--primary-blue);
}

.toolbar-color-picker {
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    cursor: pointer;
    background: transparent;
}

/* Virtual A4 Canvas Page */
.editor-canvas {
    flex-grow: 1;
    overflow-y: auto;
    padding: 2.5rem 1.5rem;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.document-page {
    background-color: #ffffff;
    box-shadow: var(--shadow-premium);
    border-radius: 2px;
    position: relative;
    /* Standard A4 Portrait size */
    width: 210mm;
    min-height: 297mm;
    /* Default margins configured by Javascript dynamically */
    padding-top: 20mm;
    padding-bottom: 20mm;
    padding-left: 40mm;
    padding-right: 40mm;
    box-sizing: border-box;
    outline: none;
    margin: 0 auto;
    /* Strict font rendering for court files */
    font-size: 13pt;
    line-height: 1.6;
    color: #000000;
}

.document-page span.lang-gu {
    font-family: 'Noto Sans Gujarati', sans-serif;
    font-size: 13pt;
}

.document-page span.lang-en {
    font-family: 'Times New Roman', serif;
    font-size: 13pt;
}

/* Editor Sidebar Elements */
.editor-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.sidebar-box {
    background-color: var(--bg-card);
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.sidebar-box-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 0.75rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--border-color);
}

.version-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    max-height: 220px;
    overflow-y: auto;
}

.version-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.8rem;
    background-color: #f8fafc;
}

.version-info {
    display: flex;
    flex-direction: column;
}

/* Upload Dropzone styles */
.upload-dropzone {
    border: 2px dashed #cbd5e1;
    background-color: #f8fafc;
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition-normal);
    margin-bottom: 1.5rem;
}

.upload-dropzone:hover {
    border-color: var(--primary-blue);
    background-color: var(--accent-blue-light);
}

/* Dynamic form rows */
.field-row {
    display: grid;
    grid-template-columns: 1.5fr 1.5fr 1fr 1fr auto;
    gap: 0.75rem;
    align-items: end;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

/* Modals */
.editor-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.3);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-normal);
}

.editor-modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: var(--bg-card);
    border-radius: 12px;
    padding: 2rem;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-premium);
    transform: scale(0.95);
    transition: var(--transition-normal);
}

.editor-modal.show .modal-content {
    transform: scale(1);
}

/* ==========================================================================
   Toast Notifications
   ========================================================================== */
#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 9999;
}

.toast {
    background: #ffffff;
    border-left: 4px solid var(--primary-blue);
    color: var(--text-primary);
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(15, 23, 42, 0.1), 0 4px 6px -4px rgba(15, 23, 42, 0.05);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.88rem;
    font-weight: 500;
    min-width: 280px;
    max-width: 400px;
    opacity: 0;
    transform: translateY(20px);
    animation: toast-fade-in 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transition: all 0.3s ease;
}

@keyframes toast-fade-in {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.toast.success {
    border-left-color: #10b981;
}

.toast.error {
    border-left-color: #ef4444;
}

.toast.info {
    border-left-color: #0ea5e9;
}

.toast.warning {
    border-left-color: #f59e0b;
}

.toast-icon {
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-message {
    line-height: 1.4;
}

/* ==========================================================================
   Table Icon Action Buttons
   ========================================================================== */
.action-btn-group {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    background: transparent;
    padding: 0;
    line-height: 1;
}

.action-btn svg {
    width: 15px;
    height: 15px;
    stroke-width: 2;
    transition: transform 0.15s ease;
}

.action-btn:hover svg {
    transform: scale(1.15);
}

/* Edit - Light Blue */
.action-btn-edit {
    background: #f0f9ff;
    border-color: #bae6fd;
    color: #0284c7;
}
.action-btn-edit:hover {
    background: #0284c7;
    border-color: #0284c7;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(2, 132, 199, 0.25);
}

/* PDF - Red/Coral */
.action-btn-pdf {
    background: #fef2f2;
    border-color: #fecaca;
    color: #dc2626;
}
.action-btn-pdf:hover {
    background: #dc2626;
    border-color: #dc2626;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.25);
}

/* DOCX - Blue */
.action-btn-docx {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #2563eb;
}
.action-btn-docx:hover {
    background: #2563eb;
    border-color: #2563eb;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

/* Delete - Rose */
.action-btn-delete {
    background: #fff1f2;
    border-color: #fecdd3;
    color: #e11d48;
}
.action-btn-delete:hover {
    background: #e11d48;
    border-color: #e11d48;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(225, 29, 72, 0.25);
}

/* Fill / Quick Generate - Emerald */
.action-btn-fill {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #059669;
}
.action-btn-fill:hover {
    background: #059669;
    border-color: #059669;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(5, 150, 105, 0.25);
}

/* ==========================================================================
   Global Floating Pitch-Black Tooltips
   ========================================================================== */
#app-tooltip {
    position: fixed;
    background-color: #0f172a;
    color: #ffffff;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.3;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -4px rgba(0, 0, 0, 0.25);
    z-index: 999999;
    font-family: 'Poppins', sans-serif;
    letter-spacing: 0.2px;
}

#app-tooltip.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#app-tooltip::after {
    content: '';
    position: absolute;
    border-width: 5px;
    border-style: solid;
    pointer-events: none;
}

#app-tooltip.tooltip-top::after {
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-color: #0f172a transparent transparent transparent;
}

#app-tooltip.tooltip-bottom::after {
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-color: transparent transparent #0f172a transparent;
}

.dataTables_wrapper {
    overflow: visible;
}

.table-container {
    overflow-x: auto;
    overflow-y: visible;
    padding-top: 6px;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}

/* Responsive Grid Form Helpers */
.form-row-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.template-builder-header-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

/* Global Responsive Breakpoints for Admin / Application */
@media (max-width: 1200px) {
    .editor-workspace {
        grid-template-columns: 1fr;
        height: auto;
        min-height: calc(100vh - 160px);
    }

    .editor-sidebar {
        order: 2;
    }
}

@media (max-width: 900px) {
    .navbar-menu {
        display: none !important;
    }
    
    .navbar-hamburger {
        display: inline-flex !important;
    }
    
    .navbar-user .user-details {
        display: none !important;
    }
    
    .navbar-user .navbar-logout-btn {
        display: none !important;
    }

    .template-builder-header-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
}

@media (max-width: 768px) {
    .form-row-2col {
        grid-template-columns: 1fr;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    /* Template Field Row Responsive Wrap */
    .field-row {
        grid-template-columns: 1fr 1fr !important;
        background: #f8fafc;
        padding: 1rem;
        border-radius: 10px;
        border: 1px solid #e2e8f0;
        margin-bottom: 1rem;
    }

    .field-row > div:nth-child(1),
    .field-row > div:nth-child(2) {
        grid-column: span 2;
    }
    
    .field-row > div:last-child {
        grid-column: span 2;
        display: flex;
        justify-content: flex-end;
        padding-bottom: 0 !important;
    }

    /* DataTables Mobile Layout */
    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter {
        float: none !important;
        text-align: left !important;
        display: block;
        margin-bottom: 0.75rem;
    }

    .dataTables_wrapper .dataTables_filter input {
        width: 100% !important;
        margin-left: 0 !important;
        margin-top: 4px;
        box-sizing: border-box;
    }

    .dataTables_wrapper .dataTables_info,
    .dataTables_wrapper .dataTables_paginate {
        float: none !important;
        text-align: center !important;
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        margin-top: 0.75rem;
    }

    .dataTables_wrapper .dataTables_paginate .paginate_button {
        padding: 0.25rem 0.55rem !important;
        margin-left: 2px !important;
        font-size: 0.75rem !important;
    }

    /* Editor Toolbar & Canvas */
    .editor-toolbar {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;
        padding: 0.5rem;
    }

    .editor-canvas {
        padding: 1rem 0.25rem;
        justify-content: flex-start;
    }

    .document-page {
        min-height: auto;
        font-size: 11pt;
        padding-left: 15mm;
        padding-right: 15mm;
    }
}

@media (max-width: 640px) {
    .app-navbar {
        height: 62px;
    }

    .navbar-mobile-drawer {
        top: 62px;
        height: calc(100vh - 62px);
    }

    .brand-text {
        font-size: 1.15rem;
    }

    .brand-subtext {
        font-size: 0.58rem;
        letter-spacing: 0.8px;
    }

    .brand-logo-icon {
        width: 36px;
        height: 36px;
        font-size: 1.3rem;
    }

    .container-limit {
        padding: 0 1rem;
    }

    .content-header {
        margin-bottom: 1rem;
        padding-bottom: 0.5rem;
    }

    .content-header h1 {
        font-size: 1.35rem;
    }

    .header-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .header-actions .btn {
        flex: 1;
        text-align: center;
        font-size: 0.8rem;
        padding: 0.5rem 0.75rem;
    }

    .card {
        padding: 1.25rem 1rem;
        border-radius: 12px;
    }

    .card-title {
        font-size: 1.05rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.35rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 0.85rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-icon {
        width: 46px;
        height: 46px;
        font-size: 1.25rem;
    }

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

    .upload-dropzone {
        padding: 2rem 1rem;
    }

    .modal-content {
        max-width: 92vw;
        padding: 1.5rem 1.25rem;
        margin: 1rem;
    }

    .field-row {
        grid-template-columns: 1fr !important;
    }

    .field-row > div {
        grid-column: span 1 !important;
    }
}

