:root {
    /* Color Palette - Light Mode - Richer */
    --primary-color: #E05A10; /* Richer Deep Orange Red */
    --primary-hover: #C0392B; 
    --primary-light: #FBEFEA;
    --bg-main: #FAFBFC;
    --bg-card: #FFFFFF;
    --text-main: #1A202C;
    --text-muted: #718096;
    --border-color: #E2E8F0;
    --input-bg: #F7FAFC;
    
    /* Specific UI Colors based on reference */
    --btn-toggle-bg: #FFFFFF;
    --btn-toggle-text: #2D3748;
    --btn-toggle-active-bg: #E67E22;
    --btn-toggle-active-text: #FFFFFF;
    --info-box-bg: #FDF2E9;
    --info-box-text: #666666;

    /* Shadows & Radii */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;
    
    /* Typography */
    --font-heading: 'Playfair Display', "Inter", serif;
    --font-body: 'Noto Sans Devanagari', 'Inter', sans-serif;
}

[data-theme="dark"] {
    /* Color Palette - Dark Mode - Richer */
    --primary-color: #E05A10;
    --primary-hover: #FF7043;
    --primary-light: #3E2723;
    --bg-main: #1A202C;
    --bg-card: #2D3748;
    --text-main: #F7FAFC;
    --text-muted: #A0AEC0;
    --border-color: #4A5568;
    --input-bg: #1A202C;

    --btn-toggle-bg: #2D3748;
    --btn-toggle-text: #F7FAFC;
    --btn-toggle-active-bg: #E67E22;
    --btn-toggle-active-text: #FFFFFF;
    --info-box-bg: #353F50;
    --info-box-text: #CBD5E0;
}

/* === Global Resets & Base === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1, h2, h3, h4, h5, h6, .headline-font {
    font-family: var(--font-heading);
    color: var(--text-main);
    font-weight: 700;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s;
}

a:hover {
    color: var(--primary-color);
}

.text-primary { color: var(--primary-color) !important; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.85rem; }
.text-xs { font-size: 0.75rem; }
.text-center { text-align: center; }
.font-weight-bold { font-weight: 700; }
.code-font { font-family: 'Inter', monospace; }
.list-unstyled { list-style: none; padding: 0; margin: 0; }
.d-flex { display: flex; }
.align-items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.border-top { border-top: 1px solid var(--border-color); }

/* === Utilities === */
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 24px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 24px; }
.pt-2 { padding-top: 8px; }
.pt-4 { padding-top: 24px; }
.pb-2 { padding-bottom: 8px; }
.w-50 { width: 48%; }
.w-100 { width: 100%; }
.hidden { display: none !important; }

/* === App Banner (Mobile) === */
.app-banner {
    background-color: var(--primary-color);
    color: white;
    padding: 10px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
}
.banner-content { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; font-family: 'Noto Sans Devanagari', sans-serif;}
.banner-actions { display: flex; align-items: center; gap: 12px; }
.btn-download { background: white; color: var(--primary-color); padding: 4px 10px; border-radius: var(--radius-full); font-size: 0.75rem; font-weight: 600; }
.btn-close { background: none; border: none; color: white; font-size: 1.2rem; cursor: pointer; }

/* === New Header Design === */
.main-header {
    background-color: var(--bg-card);
    padding: 12px 24px;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 900;
}
.header-container {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}
.logo-icon-bg {
    background: var(--primary-light);
    color: var(--primary-color);
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
}
.logo-text {
    display: flex;
    flex-direction: column;
}
.logo-title {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.2;
}
.logo-subtitle {
    font-size: 0.65rem;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.top-nav {
    display: flex;
    gap: 24px;
    align-items: center;
}
.nav-link {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}
.nav-link:hover {
    color: var(--primary-color);
}
.theme-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.3rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    padding: 8px;
    border-radius: 50%;
}
.theme-btn:hover { background-color: var(--input-bg); color: var(--primary-color); }

/* === Main Layout === */
.main-content {
    flex: 1;
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 32px; /* Replaced default space with more breathing room */
}

/* === Hero Section === */
.hero-title { font-size: 2.5rem; margin-bottom: 8px; }
.hero-subtitle { max-width: 600px; margin: 0 auto; font-size: 1.05rem; }

.hero-cards {
    display: flex;
    gap: 24px;
    justify-content: center;
}

.hero-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 32px 24px;
    width: 320px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.hero-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
    background: linear-gradient(to bottom right, var(--bg-card), var(--primary-light));
}
.hero-card.active {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(230, 126, 34, 0.2);
}

.hero-card-icon {
    background: var(--primary-light);
    color: var(--primary-color);
    width: 64px;
    height: 64px;
    border-radius: var(--radius-lg);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2rem;
}

.hero-features {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
}
.feature-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--text-muted);
}
.feature-badge i { color: var(--primary-color); }

/* === Form Elements & Cards === */
.card {
    background-color: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 24px 32px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    scroll-margin-top: 100px;
}

/* Specific Dropdown Style */
.form-select-lg {
    font-size: 1.1rem;
    padding: 16px;
    font-weight: 600;
}

select, input[type="number"], input[type="text"] {
    width: 100%;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background-color: var(--input-bg);
    color: var(--text-main);
    font-size: 1rem;
    font-family: inherit;
    appearance: none; 
}
select {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="%23718096" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"></polyline></svg>');
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}
select:focus, input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(230, 126, 34, 0.2);
}
label, .step-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.step-title {
    margin-top: 24px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

/* Buttons */
.btn-primary, .btn-secondary, .btn-action {
    border-radius: var(--radius-full);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}
.btn-primary, .btn-secondary { padding: 14px 24px; }
.btn-action { padding: 10px 20px; border: 1px solid var(--border-color); background: var(--bg-card); color: var(--text-main); font-size: 0.95rem; box-shadow: var(--shadow-sm);}
.btn-action:hover { background-color: var(--input-bg); border-color: var(--primary-color); color: var(--primary-color); }
.btn-whatsapp { color: #25D366; border-color: #25D366; background: #fff;}
.btn-whatsapp:hover { background-color: #25D366; color: white!important; border-color: #25D366; }
[data-theme="dark"] .btn-whatsapp { background: var(--input-bg); }

.btn-primary { background: linear-gradient(135deg, var(--primary-color), var(--primary-hover)); color: white; border: none; box-shadow: var(--shadow-md); margin-top: 24px; display: block; }
.btn-primary:active { transform: scale(0.98); }

/* Toggles */
.toggle-group { display: flex; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.btn-toggle {
    flex: 1; min-width: 140px; padding: 12px; border: 1px solid var(--border-color);
    background-color: var(--btn-toggle-bg); color: var(--btn-toggle-text);
    border-radius: var(--radius-full); font-size: 0.95rem; font-weight: 500;
    cursor: pointer; text-align: center; display: flex; justify-content: center; align-items: center; gap: 8px;
}
.btn-toggle:hover { border-color: var(--primary-color); }
.btn-toggle.active { background-color: var(--btn-toggle-active-bg); color: var(--btn-toggle-active-text); border-color: var(--btn-toggle-active-bg); }

/* Result Areas */
.primary-result { font-size: 1.8rem; font-weight: 700; color: var(--primary-color); text-align: center; margin: 20px 0; padding: 16px; background: var(--input-bg); border-radius: var(--radius-md); border: 1px dashed var(--primary-color); }
.result-table { width: 100%; border-collapse: collapse; margin-top: 10px; }
.result-table th, .result-table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border-color); }
.result-table th { font-weight: 600; background-color: var(--input-bg); color: var(--text-muted); }

/* Row Group */
.row-group { display: flex; justify-content: space-between; gap: 15px; flex-wrap: wrap; margin-bottom: 20px;}
.input-wrapper { display: flex; flex-direction: column; }
.input-wrapper.w-50 { flex: 1 1 45%; }

/* Info Box */
.info-box { background-color: var(--info-box-bg); padding: 12px; border-radius: var(--radius-md); font-size: 0.85rem; color: var(--info-box-text); display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }

/* === Instructions Step Grid === */
.instruction-section, .constants-section { scroll-margin-top: 100px; }
.how-to-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    text-align: center;
}
.how-to-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}
.step-circle {
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 700;
    font-size: 1.2rem;
}
.step-title-text { font-family: var(--font-heading); font-size: 1.1rem; color: var(--text-main); line-height: 1.2;}
.step-desc-text { font-size: 0.85rem; color: var(--text-muted); line-height: 1.4;}

/* === Video === */
.video-container {
    background: var(--input-bg);
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-xl);
    height: 300px; /* Mock height */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* === Constants Grid === */
.constants-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}
.constant-card { padding: 24px; }
.constant-card li { margin-bottom: 6px; }

/* === Footer Multi-column === */
.main-footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    padding: 40px 24px 24px 24px;
}
.footer-grid {
    max-width: 1000px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.2fr;
    gap: 40px;
}
.footer-col ul li { margin-bottom: 12px; }

/* Legal Modal/Blocks Expansion Area */
.legal-content-area {
    max-width: 1000px;
    margin: 0 auto;
}
.legal-block {
    background: var(--input-bg);
    padding: 16px;
    border-radius: var(--radius-md);
}

.footer-bottom {
    max-width: 1000px;
    margin: 0 auto;
}

/* Responsive Overrides */
@media (max-width: 768px) {
    .top-nav { display: none; } /* Hide regular nav on mobile for simplicity, or just scale down */
    .hero-cards { flex-direction: row; flex-wrap: wrap; gap: 12px; }
    .hero-card { width: calc(50% - 6px); padding: 20px 12px; }
    .hero-card h2 { font-size: 1.25rem; }
    .hero-card p { font-size: 0.75rem; }
    .hero-card-icon { width: 48px; height: 48px; font-size: 1.5rem; }
    .how-to-grid { grid-template-columns: 1fr; }
    .constants-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; gap: 24px; }
    .hero-title { font-size: 2rem; }
    .input-wrapper.w-50 { flex: 1 1 100%; }
}
