/* ===================================================
   CastleErp.Web – Professional Design System
   =================================================== */

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

/* ---------- Design Tokens ---------- */
:root {
    --primary:        #4F46E5;
    --primary-dark:   #3730A3;
    --primary-light:  #818CF8;
    --accent:         #F59E0B;
    --accent-dark:    #D97706;
    --success:        #10B981;
    --danger:         #EF4444;
    --dark:           #0F172A;
    --body-color:     #1E293B;
    --muted:          #64748B;
    --border:         #E2E8F0;
    --bg-light:       #F8FAFC;
    --bg-white:       #FFFFFF;
    --radius-sm:      0.5rem;
    --radius-md:      0.875rem;
    --radius-lg:      1.25rem;
    --radius-xl:      1.75rem;
    --shadow-sm:      0 1px 3px rgba(0,0,0,.08);
    --shadow-md:      0 4px 16px rgba(0,0,0,.10);
    --shadow-lg:      0 12px 40px rgba(0,0,0,.14);
    --shadow-xl:      0 24px 64px rgba(0,0,0,.18);
    --transition:     all .3s cubic-bezier(.4,0,.2,1);
    --font-main:      var(--site-font, 'Cairo'), 'Cairo', ui-sans-serif, system-ui, sans-serif;
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-main);
    font-size: 15px;
    color: var(--body-color);
    background: var(--bg-white);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

button, input, select, textarea { font-family: var(--font-main) !important; }

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

h1,.h1,h2,.h2,h3,.h3,h4,.h4,h5,.h5,h6,.h6 {
    color: var(--dark);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0;
}

img { max-width: 100%; height: auto; }
p:last-child { margin-bottom: 0; }

/* ---------- Gradient Utilities ---------- */
.gradient-primary  { background: linear-gradient(135deg, var(--primary) 0%, #7C3AED 100%); }
.gradient-accent   { background: linear-gradient(135deg, var(--accent) 0%, #F97316 100%); }
.gradient-dark     { background: linear-gradient(135deg, #0F172A 0%, #1E1B4B 100%); }
.gradient-hero     { background: linear-gradient(135deg, #0F172A 0%, #1E1B4B 40%, #312E81 100%); }
.gradient-text {
    background: linear-gradient(135deg, var(--primary-light), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ---------- Section Helpers ---------- */
.section-py  { padding-top: 5rem; padding-bottom: 5rem; }
.section-label {
    display: inline-block;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--primary);
    background: rgba(79,70,229,.08);
    border: 1px solid rgba(79,70,229,.2);
    border-radius: 100px;
    padding: .3rem .85rem;
    margin-bottom: 1rem;
}
.section-label.accent {
    color: var(--accent-dark);
    background: rgba(245,158,11,.08);
    border-color: rgba(245,158,11,.25);
}
.section-title {
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    font-weight: 800;
    color: var(--dark);
    margin-bottom: .75rem;
}
.section-sub {
    font-size: 1.0625rem;
    color: var(--muted);
    max-width: 560px;
    margin: 0 auto;
    line-height: 1.7;
}

/* ---------- Buttons ---------- */
.btn-primary-custom {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    background: linear-gradient(135deg, var(--primary), #7C3AED);
    color: #fff;
    font-weight: 600;
    font-size: .9375rem;
    padding: .75rem 1.75rem;
    border-radius: 100px;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 20px rgba(79,70,229,.35);
}
.btn-primary-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(79,70,229,.45);
    color: #fff !important;
}

.btn-orange, .btn-accent {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    background: linear-gradient(135deg, var(--accent), #F97316);
    color: #fff !important;
    font-weight: 600;
    font-size: .9375rem;
    padding: .75rem 1.75rem;
    border-radius: 100px;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 20px rgba(245,158,11,.35);
}
.btn-orange:hover, .btn-accent:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(245,158,11,.45);
    color: #fff !important;
}

.btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    background: rgba(255,255,255,.12);
    backdrop-filter: blur(8px);
    color: #fff;
    font-weight: 600;
    padding: .75rem 1.75rem;
    border-radius: 100px;
    border: 1.5px solid rgba(255,255,255,.25);
    cursor: pointer;
    transition: var(--transition);
}
.btn-ghost:hover { background: rgba(255,255,255,.22); color: #fff !important; }

/* ---------- Cards ---------- */
.card-pro {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}
.card-pro:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(79,70,229,.2);
}
.card-pro::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(79,70,229,.04), transparent);
    opacity: 0;
    transition: var(--transition);
}
.card-pro:hover::before { opacity: 1; }

/* ---------- Navbar ---------- */
.navbar-pro {
    position: sticky;
    top: 0;
    z-index: 1040;
    background: rgba(255,255,255,.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(226,232,240,.6);
    transition: var(--transition);
}
.navbar-pro.scrolled {
    background: rgba(255,255,255,.97);
    box-shadow: var(--shadow-md);
}
.navbar-pro .nav-link {
    font-size: .9rem;
    font-weight: 500;
    color: var(--body-color) !important;
    padding: .5rem .875rem !important;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    position: relative;
}
.navbar-pro .nav-link:hover { color: var(--primary) !important; background: rgba(79,70,229,.06); }
.navbar-pro .nav-link.active { color: var(--primary) !important; font-weight: 600; background: rgba(79,70,229,.08); }
.navbar-pro .nav-link.active::after { display: none; }

/* ---------- Hero Section ---------- */
.hero-section {
    background: var(--gradient-hero, linear-gradient(135deg, #0F172A 0%, #1E1B4B 40%, #312E81 100%));
    min-height: 88vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    padding: 5rem 0 4rem;
}
.hero-section::before {
    content: '';
    position: absolute;
    width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(129,140,248,.2) 0%, transparent 70%);
    top: -150px; right: -100px;
    border-radius: 50%;
}
.hero-section::after {
    content: '';
    position: absolute;
    width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(245,158,11,.15) 0%, transparent 70%);
    bottom: -100px; left: -50px;
    border-radius: 50%;
}
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 100px;
    padding: .4rem 1rem;
    font-size: .8125rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 1.5rem;
    backdrop-filter: blur(8px);
}
.hero-badge .dot {
    width: 6px; height: 6px;
    background: var(--accent);
    border-radius: 50%;
    animation: pulse-dot 1.8s ease-in-out infinite;
}
@keyframes pulse-dot {
    0%,100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.5); opacity: .6; }
}
.hero-title {
    font-size: clamp(2.5rem, 5vw, 3.75rem);
    font-weight: 900;
    color: #fff !important;
    line-height: 1.1;
    margin-bottom: 1.25rem;
}
.hero-sub {
    font-size: 1.0625rem;
    color: rgba(255,255,255,.72) !important;
    line-height: 1.75;
    margin-bottom: 2rem;
    max-width: 520px;
}
.hero-badge { color: #fff !important; }
.hero-stat-card {
    background: rgba(255,255,255,.07);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    text-align: center;
    flex: 1;
    min-width: 120px;
}
.hero-stat-card .stat-num {
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
}
.hero-stat-card .stat-lbl { font-size: .78rem; color: rgba(255,255,255,.6); }

.hero-img-wrap {
    position: relative;
    z-index: 1;
}
.hero-img-wrap img {
    border-radius: var(--radius-xl);
    box-shadow: 0 32px 80px rgba(0,0,0,.5);
    width: 100%;
    max-width: 540px;
}
.hero-float-card {
    position: absolute;
    background: rgba(255,255,255,.95);
    backdrop-filter: blur(12px);
    border-radius: var(--radius-md);
    padding: .75rem 1rem;
    box-shadow: var(--shadow-xl);
    display: flex;
    align-items: center;
    gap: .625rem;
    font-size: .8125rem;
    font-weight: 600;
    color: var(--dark);
    animation: float-card 3s ease-in-out infinite;
    z-index: 2;
}
.hero-float-card.left  { top: 12%; left: -30px; animation-delay: 0s; }
.hero-float-card.right { bottom: 12%; right: -30px; animation-delay: 1.5s; }
@keyframes float-card {
    0%,100% { transform: translateY(0); }
    50%      { transform: translateY(-10px); }
}
.hero-float-card .icon-wrap {
    width: 36px; height: 36px;
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem;
}

/* ---------- Category Cards ---------- */
.cat-card {
    background: var(--bg-white);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.25rem .75rem;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
}
.cat-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-light);
    box-shadow: 0 8px 28px rgba(79,70,229,.14);
}
.cat-icon-wrap {
    width: 56px; height: 56px;
    border-radius: var(--radius-sm);
    margin: 0 auto .75rem;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem;
    transition: var(--transition);
}
.cat-card:hover .cat-icon-wrap { transform: scale(1.12); }
.cat-card .cat-name { font-size: .8375rem; font-weight: 600; color: var(--dark); }

/* ---------- Features ---------- */
.feature-icon-wrap {
    width: 52px; height: 52px;
    border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.375rem;
    margin-bottom: 1rem;
    transition: var(--transition);
}
.card-pro:hover .feature-icon-wrap { transform: scale(1.1) rotate(-3deg); }

/* ---------- About / Comparison ---------- */
.compare-col {
    background: var(--bg-white);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: var(--transition);
}
.compare-col.after-col {
    border-color: rgba(79,70,229,.3);
    box-shadow: 0 4px 24px rgba(79,70,229,.1);
}
.compare-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .625rem 0;
    border-bottom: 1px solid var(--border);
    font-size: .9rem;
    font-weight: 500;
    color: var(--body-color);
}
.compare-item:last-child { border-bottom: none; }
.compare-icon {
    width: 32px; height: 32px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: .875rem;
    flex-shrink: 0;
}

/* ---------- Testimonials ---------- */
.testi-card {
    background: var(--bg-white);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    height: 100%;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}
.testi-card:hover {
    transform: translateY(-4px);
    border-color: rgba(79,70,229,.2);
    box-shadow: var(--shadow-md);
}
.testi-quote { font-size: 2.5rem; color: rgba(79,70,229,.15); line-height: 1; margin-bottom: .25rem; }
.testi-stars { color: var(--accent); font-size: .9rem; margin-bottom: .75rem; }
.testi-text { color: var(--muted); font-size: .9rem; line-height: 1.65; flex-grow: 1; }

/* ---------- Pricing ---------- */
.price-card {
    background: var(--bg-white);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 2rem;
    position: relative;
    transition: var(--transition);
    height: 100%;
}
.price-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}
.price-card.popular {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(79,70,229,.1), var(--shadow-lg);
}
.price-badge {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--primary), #7C3AED);
    color: #fff;
    font-size: .75rem;
    font-weight: 700;
    padding: .3rem 1rem;
    border-radius: 100px;
    letter-spacing: .05em;
    text-transform: uppercase;
    white-space: nowrap;
}
.price-amount { font-size: 2.75rem; font-weight: 900; color: var(--dark); }
.price-period { font-size: .875rem; color: var(--muted); }
.price-feature {
    display: flex;
    align-items: center;
    gap: .625rem;
    font-size: .875rem;
    color: var(--body-color);
    padding: .4rem 0;
    border-bottom: 1px solid var(--border);
}
.price-feature:last-child { border-bottom: none; }

/* ---------- FAQ ---------- */
.faq-item {
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: .75rem;
    overflow: hidden;
    transition: var(--transition);
}
.faq-item[open] { border-color: rgba(79,70,229,.25); box-shadow: var(--shadow-sm); }
.faq-item summary {
    font-weight: 600;
    font-size: .9375rem;
    color: var(--dark);
    padding: 1.1rem 1.25rem;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; font-size: 1.25rem; color: var(--primary); font-weight: 400; }
.faq-item[open] summary::after { content: '−'; }
.faq-body { padding: 0 1.25rem 1.25rem; color: var(--muted); font-size: .9rem; line-height: 1.7; }

/* ---------- Contact ---------- */
.contact-form .form-control, .contact-form .form-select {
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: .75rem 1rem;
    font-size: .9rem;
    transition: var(--transition);
}
.contact-form .form-control:focus, .contact-form .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79,70,229,.12);
    outline: none;
}
.contact-info-card {
    background: rgba(79,70,229,.04);
    border: 1.5px solid rgba(79,70,229,.15);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}

/* ---------- Footer ---------- */
.footer-pro {
    background: var(--dark);
    color: rgba(255,255,255,.7);
}
.footer-pro .footer-title { color: #fff; font-weight: 700; margin-bottom: 1rem; }
.footer-pro a { color: rgba(255,255,255,.6); font-size: .9rem; }
.footer-pro a:hover { color: var(--accent) !important; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.08); }
.social-icon {
    width: 38px; height: 38px;
    border-radius: var(--radius-sm);
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,.07);
    color: rgba(255,255,255,.7);
    font-size: 1rem;
    transition: var(--transition);
}
.social-icon:hover { background: var(--primary); color: #fff !important; }

/* ---------- Misc Utilities ---------- */
.bg-primary-soft  { background: rgba(79,70,229,.08); }
.bg-accent-soft   { background: rgba(245,158,11,.08); }
.bg-success-soft  { background: rgba(16,185,129,.08); }
.bg-danger-soft   { background: rgba(239,68,68,.08); }
.text-primary-pro { color: var(--primary) !important; }
.text-accent-pro  { color: var(--accent-dark) !important; }
.text-muted-pro   { color: var(--muted) !important; }
.text-dark-pro    { color: var(--dark) !important; }
.fw-800 { font-weight: 800; }
.fw-900 { font-weight: 900; }
.rounded-pro { border-radius: var(--radius-lg) !important; }
.border-pro  { border: 1.5px solid var(--border) !important; }

/* Legacy compatibility */
.text-orange-600  { color: var(--accent-dark) !important; }
.bg-orange-100    { background: rgba(245,158,11,.1) !important; }
.text-gray-700    { color: #374151 !important; }
.text-gray-900    { color: #111827 !important; }
.text-gray-600    { color: #4b5563 !important; }
.text-gray-500    { color: #6b7280 !important; }
.border-gray-200  { border-color: #e5e7eb !important; }
.cursor-pointer   { cursor: pointer; }

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(79,70,229,.3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ---------- Animations ---------- */
@keyframes fade-up {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}
.animate-fade-up { animation: fade-up .6s ease both; }
.delay-1 { animation-delay: .1s; }
.delay-2 { animation-delay: .2s; }
.delay-3 { animation-delay: .3s; }
.delay-4 { animation-delay: .4s; }

/* ---------- Blazor / Validation ---------- */
.valid.modified:not([type=checkbox]) { outline: 1px solid var(--success); }
.invalid { outline: 1px solid var(--danger); }
.validation-message { color: var(--danger); font-size: .8125rem; }
.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB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jA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}
.blazor-error-boundary::after { content: "An error has occurred."; }
.components-reconnect-modal { display: none !important; }
#blazor-error-ui {
    background: #fee2e2;
    border-top: 1px solid #fca5a5;
    color: #991b1b;
    padding: .75rem 1rem;
    text-align: center;
    font-size: .875rem;
    display: none;
}
#blazor-error-ui.blazor-error-ui-show { display: block; }
