/* ============================================================
   PAK DOODH WALA - COMPLETE STYLESHEET
   Modern, responsive, role-based design
   ============================================================ */

:root {
    --primary: #166534;
    --primary-dark: #14532d;
    --primary-light: #dcfce7;
    --secondary: #f59e0b;
    --secondary-dark: #d97706;
    --accent: #0ea5e9;
    --danger: #dc2626;
    --warning: #f59e0b;
    --success: #16a34a;
    --info: #2563eb;
    --dark: #0f172a;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    --white: #ffffff;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-sans);
    background: var(--white);
    color: var(--gray-800);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 14px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}
.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-gold {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: var(--white);
    border: none;
}
.btn-gold:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(245,158,11,0.4);
}

.btn-outline {
    background: transparent;
    color: var(--white);
    border-color: rgba(255,255,255,0.3);
}
.btn-outline:hover {
    background: rgba(255,255,255,0.1);
    border-color: var(--white);
}

.btn-lg { padding: 14px 28px; font-size: 16px; border-radius: var(--radius-lg); }
.btn-block { width: 100%; }

/* Navigation */
.navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    padding: 16px 0;
    transition: var(--transition);
}
.navbar.scrolled {
    background: rgba(22, 101, 52, 0.95);
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-md);
    padding: 12px 0;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--white);
    font-weight: 700;
    font-size: 20px;
}
.nav-logo svg { stroke: var(--secondary); }

.nav-menu {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link {
    color: rgba(255,255,255,0.8);
    padding: 8px 16px;
    border-radius: var(--radius);
    font-weight: 500;
    font-size: 14px;
    transition: var(--transition);
}
.nav-link:hover { color: var(--white); background: rgba(255,255,255,0.1); }

.nav-login { border: 1px solid rgba(255,255,255,0.3); }
.nav-login:hover { background: rgba(255,255,255,0.15); }

.nav-cta { margin-left: 8px; }

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}
.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--white);
    border-radius: 2px;
    transition: var(--transition);
}

/* Hero Section */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 120px 0 80px;
    overflow: hidden;
    background: linear-gradient(135deg, #14532d 0%, #166534 40%, #15803d 100%);
}

.hero-bg {
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(ellipse at 20% 50%, rgba(245,158,11,0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(14,165,233,0.1) 0%, transparent 50%);
}

.hero-content {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    padding: 8px 16px;
    border-radius: 100px;
    color: var(--secondary);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 24px;
    border: 1px solid rgba(255,255,255,0.1);
}
.badge-dot {
    width: 8px; height: 8px;
    background: var(--secondary);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

.hero-title {
    font-size: 56px;
    font-weight: 800;
    color: var(--white);
    line-height: 1.1;
    margin-bottom: 20px;
    letter-spacing: -0.02em;
}
.gradient-text {
    background: linear-gradient(135deg, #fbbf24, #f59e0b, #fbbf24);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 18px;
    color: rgba(255,255,255,0.7);
    max-width: 480px;
    margin-bottom: 32px;
    line-height: 1.7;
}

.hero-buttons {
    display: flex;
    gap: 16px;
    margin-bottom: 48px;
    flex-wrap: wrap;
}

.hero-stats {
    display: flex;
    align-items: center;
    gap: 24px;
}
.stat { text-align: center; }
.stat-number {
    display: block;
    font-size: 28px;
    font-weight: 800;
    color: var(--white);
}
.stat-label {
    font-size: 13px;
    color: rgba(255,255,255,0.6);
    font-weight: 500;
}
.stat-divider {
    width: 1px;
    height: 40px;
    background: rgba(255,255,255,0.2);
}

.hero-image {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.hero-card {
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: var(--radius-xl);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    color: var(--white);
    box-shadow: var(--shadow-xl);
}
.hero-card-icon {
    width: 56px; height: 56px;
    background: linear-gradient(135deg, var(--secondary), var(--secondary-dark));
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}
.hero-card-text { display: flex; flex-direction: column; }
.hero-card-text strong { font-size: 18px; font-weight: 700; }
.hero-card-text span { font-size: 13px; color: rgba(255,255,255,0.7); }

.floating { animation: float 6s ease-in-out infinite; }
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

/* Section Headers */
.section-header {
    text-align: center;
    max-width: 600px;
    margin: 0 auto 48px;
}
.section-tag {
    display: inline-block;
    background: var(--primary-light);
    color: var(--primary);
    padding: 6px 16px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 16px;
}
.section-title {
    font-size: 40px;
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: 12px;
    letter-spacing: -0.02em;
}
.section-desc {
    font-size: 16px;
    color: var(--gray-500);
}

/* Portal Section */
.portal-section {
    padding: 100px 0;
    background: var(--gray-50);
}

.portal-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.portal-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 32px 24px;
    text-align: center;
    border: 2px solid transparent;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}
.portal-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    transition: var(--transition);
}
.portal-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.portal-sa::before { background: linear-gradient(90deg, #dc2626, #ef4444); }
.portal-sa:hover { border-color: #fecaca; }
.portal-sa .portal-icon { background: #fef2f2; color: #dc2626; }

.portal-fa::before { background: linear-gradient(90deg, #ea580c, #f97316); }
.portal-fa:hover { border-color: #fed7aa; }
.portal-fa .portal-icon { background: #fff7ed; color: #ea580c; }

.portal-cu::before { background: linear-gradient(90deg, #16a34a, #22c55e); }
.portal-cu:hover { border-color: #bbf7d0; }
.portal-cu .portal-icon { background: #f0fdf4; color: #16a34a; }

.portal-rd::before { background: linear-gradient(90deg, #2563eb, #3b82f6); }
.portal-rd:hover { border-color: #bfdbfe; }
.portal-rd .portal-icon { background: #eff6ff; color: #2563eb; }

.portal-icon {
    width: 64px; height: 64px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}
.portal-card h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 8px;
}
.portal-card p {
    font-size: 13px;
    color: var(--gray-500);
    line-height: 1.6;
    margin-bottom: 16px;
}
.portal-arrow {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    transition: var(--transition);
}
.portal-card:hover .portal-arrow { color: var(--primary-dark); }

/* Features Section */
.features-section {
    padding: 100px 0;
    background: var(--white);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.feature-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 32px;
    transition: var(--transition);
}
.feature-card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.feature-icon {
    width: 56px; height: 56px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin-bottom: 20px;
}
.feature-milk { background: #fef3c7; }
.feature-store { background: #dbeafe; }
.feature-sales { background: #dcfce7; }
.feature-inventory { background: #fce7f3; }
.feature-customer { background: #e0e7ff; }
.feature-reports { background: #ccfbf1; }

.feature-card h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 8px;
}
.feature-card p {
    font-size: 14px;
    color: var(--gray-500);
    line-height: 1.6;
}

/* Pricing Section */
.pricing-section {
    padding: 100px 0;
    background: var(--gray-50);
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    max-width: 900px;
    margin: 0 auto;
}

.pricing-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 40px 32px;
    border: 2px solid var(--gray-200);
    position: relative;
    transition: var(--transition);
}
.pricing-card:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-4px);
}

.pricing-popular {
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
    transform: scale(1.05);
}
.pricing-popular:hover { transform: scale(1.05) translateY(-4px); }

.popular-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--white);
    padding: 6px 20px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.pricing-header {
    text-align: center;
    margin-bottom: 32px;
}
.pricing-header h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 16px;
}
.pricing-price {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 4px;
}
.pricing-price .currency {
    font-size: 20px;
    font-weight: 600;
    color: var(--gray-600);
}
.pricing-price .amount {
    font-size: 48px;
    font-weight: 800;
    color: var(--gray-900);
    line-height: 1;
}
.pricing-price .period {
    font-size: 14px;
    color: var(--gray-500);
}

.pricing-features {
    list-style: none;
    margin-bottom: 32px;
}
.pricing-features li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    font-size: 14px;
    color: var(--gray-600);
    border-bottom: 1px solid var(--gray-100);
}
.pricing-features li:last-child { border-bottom: none; }

/* App Section */
.app-section {
    padding: 100px 0;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    overflow: hidden;
}

.app-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.app-text .section-tag {
    background: rgba(255,255,255,0.15);
    color: var(--secondary);
}
.app-text h2 {
    font-size: 40px;
    font-weight: 800;
    color: var(--white);
    margin: 16px 0;
}
.app-text p {
    font-size: 16px;
    color: rgba(255,255,255,0.7);
    margin-bottom: 32px;
    max-width: 400px;
}

.app-buttons {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.app-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: var(--white);
    color: var(--gray-900);
    padding: 12px 24px;
    border-radius: var(--radius);
    font-weight: 600;
    transition: var(--transition);
}
.app-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}
.app-btn span {
    display: block;
    font-size: 10px;
    color: var(--gray-500);
    font-weight: 500;
}
.app-btn strong {
    display: block;
    font-size: 16px;
    font-weight: 700;
}

/* Phone Mockup */
.phone-mockup {
    width: 280px;
    height: 560px;
    background: var(--gray-900);
    border-radius: 40px;
    padding: 12px;
    margin: 0 auto;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
}
.phone-screen {
    width: 100%;
    height: 100%;
    background: var(--white);
    border-radius: 32px;
    overflow: hidden;
    position: relative;
}
.phone-header {
    height: 40px;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.phone-notch {
    width: 80px;
    height: 20px;
    background: var(--gray-900);
    border-radius: 0 0 12px 12px;
}
.phone-content {
    padding: 20px;
    text-align: center;
}
.phone-logo {
    font-size: 48px;
    margin-bottom: 8px;
}
.phone-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--gray-900);
}
.phone-subtitle {
    font-size: 12px;
    color: var(--gray-500);
    margin-bottom: 20px;
}
.phone-orders {
    background: var(--gray-50);
    border-radius: var(--radius);
    padding: 12px;
    margin-bottom: 16px;
}
.phone-order-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 12px;
    border-bottom: 1px solid var(--gray-200);
}
.phone-order-item:last-child { border-bottom: none; }
.phone-total {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary);
}

/* Footer */
.footer {
    background: var(--gray-900);
    color: var(--white);
    padding: 80px 0 32px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 48px;
    margin-bottom: 48px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 18px;
    margin-bottom: 16px;
}
.footer-logo svg { stroke: var(--secondary); }

.footer-brand p {
    color: var(--gray-400);
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: 24px;
}

.footer-social {
    display: flex;
    gap: 12px;
}
.footer-social a {
    width: 40px; height: 40px;
    background: rgba(255,255,255,0.1);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-400);
    transition: var(--transition);
}
.footer-social a:hover {
    background: var(--primary);
    color: var(--white);
    transform: translateY(-2px);
}

.footer-links h4 {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--white);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.footer-links a {
    display: block;
    color: var(--gray-400);
    font-size: 14px;
    padding: 6px 0;
    transition: var(--transition);
}
.footer-links a:hover { color: var(--white); padding-left: 4px; }

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--gray-500);
}

/* ============================================================
   AUTH PAGES (Login & Register)
   ============================================================ */

.auth-page {
    min-height: 100vh;
    display: flex;
    background: linear-gradient(135deg, #14532d 0%, #166534 50%, #15803d 100%);
}

.auth-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    min-height: 100vh;
}

.auth-left {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 48px;
    color: var(--white);
}

.auth-left .logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 48px;
    font-size: 24px;
    font-weight: 700;
}

.auth-left h1 {
    font-size: 48px;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 20px;
}

.auth-left p {
    font-size: 18px;
    color: rgba(255,255,255,0.7);
    line-height: 1.7;
    margin-bottom: 32px;
}

.auth-features {
    list-style: none;
}
.auth-features li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    font-size: 16px;
    color: rgba(255,255,255,0.8);
}
.auth-features li svg {
    width: 24px; height: 24px;
    stroke: var(--secondary);
    flex-shrink: 0;
}

.auth-right {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px;
    background: var(--white);
}

.auth-box {
    width: 100%;
    max-width: 420px;
}

.auth-box h2 {
    font-size: 32px;
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: 8px;
}

.auth-box .subtitle {
    color: var(--gray-500);
    margin-bottom: 32px;
    font-size: 15px;
}

.auth-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    background: var(--gray-100);
    padding: 4px;
    border-radius: var(--radius);
}

.auth-tab {
    flex: 1;
    padding: 10px;
    text-align: center;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-500);
    cursor: pointer;
    border: none;
    background: none;
    transition: var(--transition);
}
.auth-tab.active {
    background: var(--white);
    color: var(--gray-900);
    box-shadow: var(--shadow-sm);
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: var(--font-sans);
    transition: var(--transition);
    background: var(--white);
}
.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(22,101,52,0.1);
}
.form-input::placeholder { color: var(--gray-400); }

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

.form-select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: var(--font-sans);
    background: var(--white);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
}
.form-check input {
    width: 18px; height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}
.form-check label {
    font-size: 13px;
    color: var(--gray-600);
    cursor: pointer;
}

.btn-submit {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-sans);
}
.btn-submit:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}
.btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 14px;
    color: var(--gray-500);
}
.auth-footer a {
    color: var(--primary);
    font-weight: 600;
}
.auth-footer a:hover { text-decoration: underline; }

.auth-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 24px 0;
    color: var(--gray-400);
    font-size: 13px;
}
.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--gray-200);
}

/* Role Selection Cards in Register */
.role-selection {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.role-card {
    padding: 16px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: var(--white);
}
.role-card:hover {
    border-color: var(--primary-light);
    background: var(--gray-50);
}
.role-card.selected {
    border-color: var(--primary);
    background: var(--primary-light);
}
.role-card input { display: none; }
.role-card .role-icon {
    font-size: 28px;
    margin-bottom: 8px;
}
.role-card .role-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
}

/* ============================================================
   DASHBOARD LAYOUT
   ============================================================ */

.dashboard {
    display: flex;
    min-height: 100vh;
    background: var(--gray-50);
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--white);
    border-right: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    transition: var(--transition);
}

.sidebar-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    gap: 12px;
}
.sidebar-header .logo-icon {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
}
.sidebar-header .logo-text {
    font-weight: 700;
    font-size: 16px;
    color: var(--gray-900);
}
.sidebar-header .logo-text span {
    display: block;
    font-size: 11px;
    font-weight: 500;
    color: var(--gray-500);
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 8px;
}
.nav-section-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--gray-400);
    padding: 8px 12px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--gray-600);
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    margin-bottom: 2px;
}
.nav-item:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}
.nav-item.active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}
.nav-item svg {
    width: 20px; height: 20px;
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--gray-100);
}

.user-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: var(--radius);
    background: var(--gray-50);
}
.user-avatar {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}
.user-info { flex: 1; min-width: 0; }
.user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-900);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.user-role {
    font-size: 11px;
    color: var(--gray-500);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Top Bar */
.top-bar {
    height: 64px;
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.breadcrumb {
    font-size: 14px;
    color: var(--gray-500);
}
.breadcrumb a { color: var(--primary); }

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.top-btn {
    width: 40px; height: 40px;
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-500);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}
.top-btn:hover {
    background: var(--gray-50);
    color: var(--gray-900);
}

.notification-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 18px;
    height: 18px;
    background: var(--danger);
    color: var(--white);
    font-size: 10px;
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--white);
}

/* Content Area */
.content-area {
    flex: 1;
    padding: 32px;
    overflow-y: auto;
}

.page-header {
    margin-bottom: 32px;
}
.page-header h1 {
    font-size: 28px;
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: 4px;
}
.page-header p {
    color: var(--gray-500);
    font-size: 14px;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid var(--gray-200);
    transition: var(--transition);
}
.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stat-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.stat-card-icon {
    width: 44px; height: 44px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}
.stat-card-trend {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 100px;
}
.trend-up { background: #dcfce7; color: #166534; }
.trend-down { background: #fee2e2; color: #dc2626; }

.stat-card-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: 4px;
}
.stat-card-label {
    font-size: 13px;
    color: var(--gray-500);
}

/* Cards */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    overflow: hidden;
}
.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.card-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--gray-900);
}
.card-body {
    padding: 24px;
}

/* Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
}
.data-table th {
    text-align: left;
    padding: 12px 16px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-500);
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
}
.data-table td {
    padding: 14px 16px;
    font-size: 14px;
    color: var(--gray-700);
    border-bottom: 1px solid var(--gray-100);
}
.data-table tr:hover td {
    background: var(--gray-50);
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
}
.badge-success { background: #dcfce7; color: #166534; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-info { background: #dbeafe; color: #1e40af; }
.badge-secondary { background: var(--gray-100); color: var(--gray-600); }

/* Status Colors */
.status-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
}
.status-active { background: var(--success); }
.status-pending { background: var(--warning); }
.status-inactive { background: var(--gray-400); }
.status-suspended { background: var(--danger); }

/* Grid Layouts */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

.dashboard-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

/* Flash Messages */
.flash-container {
    position: fixed;
    top: 80px;
    right: 24px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.flash {
    padding: 16px 20px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
    min-width: 300px;
}
@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
.flash-success { background: #dcfce7; color: #166534; border-left: 4px solid #16a34a; }
.flash-error { background: #fee2e2; color: #991b1b; border-left: 4px solid #dc2626; }
.flash-warning { background: #fef3c7; color: #92400e; border-left: 4px solid #f59e0b; }
.flash-info { background: #dbeafe; color: #1e40af; border-left: 4px solid #2563eb; }

/* Loading */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,0.8);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}
.spinner {
    width: 40px; height: 40px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   RESPONSIVE DESIGN
   ============================================================ */

@media (max-width: 1024px) {
    .hero-content { grid-template-columns: 1fr; text-align: center; }
    .hero-subtitle { margin: 0 auto 32px; }
    .hero-buttons { justify-content: center; }
    .hero-stats { justify-content: center; }
    .hero-image { display: none; }
    .portal-grid { grid-template-columns: repeat(2, 1fr); }
    .features-grid { grid-template-columns: repeat(2, 1fr); }
    .pricing-grid { grid-template-columns: 1fr; max-width: 400px; }
    .pricing-popular { transform: none; }
    .app-content { grid-template-columns: 1fr; text-align: center; }
    .app-text p { margin: 0 auto 32px; }
    .app-buttons { justify-content: center; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .dashboard-grid { grid-template-columns: 1fr; }
    .dashboard-grid-3 { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: repeat(2, 1fr); }
    .auth-container { grid-template-columns: 1fr; }
    .auth-left { display: none; }
}

@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        top: 0; right: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background: var(--primary-dark);
        flex-direction: column;
        padding: 80px 24px 24px;
        transition: var(--transition);
        z-index: 99;
    }
    .nav-menu.active { right: 0; }
    .nav-toggle { display: flex; z-index: 100; }
    .hero-title { font-size: 36px; }
    .portal-grid { grid-template-columns: 1fr; }
    .features-grid { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
    .sidebar { transform: translateX(-100%); }
    .sidebar.active { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .form-row { grid-template-columns: 1fr; }
    .role-selection { grid-template-columns: 1fr; }
    .top-bar { padding: 0 16px; }
    .content-area { padding: 16px; }
}

@media (max-width: 480px) {
    .hero-title { font-size: 28px; }
    .section-title { font-size: 28px; }
    .hero-buttons { flex-direction: column; }
    .hero-buttons .btn { width: 100%; }
}
