/* =====================================================================
   Manthan AI — consolidated stylesheet
   Sources: shared/styles.css (forms/animations/stars), index.html keyframes
   (routing, code panel, model grid, scroll reveal), register.html wizard CSS.
   ===================================================================== */

:root {
    --accent-red: #ef233c;
    --accent-red-glow: rgba(239, 35, 60, 0.5);
}

/* ---------- Custom Animations ---------- */
@keyframes fade-in-up {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes border-spin {
    from { --gradient-angle: 0deg; }
    to   { --gradient-angle: 360deg; }
}

@keyframes shimmer {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to   { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes animStar {
    from { transform: translateY(0px); }
    to   { transform: translateY(-2000px); }
}

@keyframes pulse-ring {
    0%   { box-shadow: 0 0 0 0 rgba(239,35,60,0.45); }
    70%  { box-shadow: 0 0 0 14px rgba(239,35,60,0); }
    100% { box-shadow: 0 0 0 0 rgba(239,35,60,0); }
}

@keyframes jitter {
    0%,100% { transform: translate(0,0) rotate(0); }
    25% { transform: translate(1px,-1px) rotate(0.3deg); }
    50% { transform: translate(-1px,1px) rotate(-0.3deg); }
    75% { transform: translate(1px,1px) rotate(0.2deg); }
}

@keyframes dash-flow {
    to { stroke-dashoffset: -24; }
}

@keyframes blink { 50% { opacity: 0; } }

@property --gradient-angle {
    syntax: "<angle>";
    initial-value: 0deg;
    inherits: false;
}

.animate-fade-up {
    animation: fade-in-up 0.8s ease-out forwards;
}

.font-manrope { font-family: 'Manrope', sans-serif; }
.font-inter   { font-family: 'Inter', sans-serif; }

/* ---------- Scroll reveal ---------- */
.reveal {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1);
}
.reveal.in-view { opacity: 1; transform: none; }

/* ---------- Shiny CTA Button ---------- */
.shiny-cta {
    --gradient-angle: 0deg;
    position: relative;
    overflow: hidden;
    border-radius: 9999px;
    padding: 1rem 2.5rem;
    background: linear-gradient(#000000, #000000) padding-box,
    conic-gradient(from var(--gradient-angle), transparent 0%, #ef233c 5%, #ef233c 15%, #ef233c 30%, transparent 40%, transparent 100%) border-box;
    border: 2px solid transparent;
    cursor: pointer;
    isolation: isolate;
    animation: border-spin 2.5s linear infinite;
    color: #fff;
}
.shiny-cta::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 50%, white 0.5px, transparent 0);
    background-size: 4px 4px;
    opacity: 0.1;
    z-index: 0;
}

/* ---------- Parallax Stars ---------- */
.stars-1 { box-shadow:
    234px 124px #fff, 654px 345px #fff, 876px 12px #fff, 1200px 800px #fff, 400px 1500px #fff, 1800px 200px #fff, 100px 1000px #fff, 900px 1900px #fff, 500px 600px #fff, 1400px 100px #fff, 300px 400px #fff, 1600px 1200px #fff,
    150px 800px #fff, 2000px 500px #fff, 800px 1800px #fff, 1100px 200px #fff, 1700px 1400px #fff, 300px 1600px #fff, 1900px 300px #fff, 600px 900px #fff, 2200px 1100px #fff, 400px 400px #fff, 1300px 1700px #fff, 700px 1300px #fff,
    2400px 800px #fff, 900px 400px #fff, 1600px 200px #fff, 200px 1900px #fff, 1400px 600px #fff, 500px 1100px #fff, 1800px 1500px #fff, 100px 500px #fff, 2100px 1700px #fff, 750px 750px #fff, 1250px 1250px #fff, 350px 1450px #fff,
    2600px 300px #fff, 850px 1650px #fff, 1950px 750px #fff, 450px 1350px #fff, 2300px 1800px #fff, 150px 150px #fff, 1750px 550px #fff, 950px 1150px #fff, 2100px 950px #fff, 650px 250px #fff, 1350px 2050px #fff, 100px 2100px #fff,
    2550px 1200px #fff, 550px 1750px #fff, 1450px 350px #fff, 2050px 1450px #fff, 700px 850px #fff, 2250px 50px #fff, 1150px 1250px #fff, 300px 1850px #fff, 1850px 950px #fff, 400px 1950px #fff; }
.stars-2 { box-shadow:
    123px 456px #fff, 789px 234px #fff, 456px 890px #fff, 1100px 300px #fff, 200px 1200px #fff, 1500px 500px #fff, 600px 1700px #fff, 1300px 900px #fff,
    300px 600px #fff, 1800px 400px #fff, 900px 1500px #fff, 2000px 800px #fff, 500px 200px #fff, 1600px 1100px #fff, 800px 700px #fff, 1400px 1800px #fff,
    2200px 100px #fff, 400px 1600px #fff, 1900px 1300px #fff, 600px 300px #fff, 1100px 1900px #fff, 1700px 600px #fff, 350px 950px #fff, 2400px 1400px #fff, 750px 1750px #fff,
    2500px 250px #fff, 550px 1450px #fff, 1650px 1650px #fff, 850px 1050px #fff, 2350px 1750px #fff, 150px 850px #fff, 1250px 450px #fff, 1950px 250px #fff, 350px 1850px #fff, 2150px 1150px #fff,
    2650px 650px #fff, 750px 1550px #fff, 1450px 850px #fff, 2050px 1950px #fff, 450px 550px #fff, 1750px 350px #fff, 1050px 1350px #fff, 2250px 850px #fff, 650px 1750px #fff; }

.gradient-blur {
    position: fixed;
    z-index: 40;
    inset: 0 0 auto 0;
    height: 120px;
    pointer-events: none;
    background: linear-gradient(to bottom, rgba(0,0,0,0.8), transparent);
    backdrop-filter: blur(8px);
    mask-image: linear-gradient(to bottom, black, transparent);
}

.selection-red::selection { background: #ef233c; color: white; }

.text-stroke {
    -webkit-text-stroke: 1px rgba(255, 255, 255, 0.1);
    color: transparent;
}

/* ---------- Form Styles (shared/login/register) ---------- */
.form-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
    color: white;
    font-size: 1rem;
    transition: all 0.2s ease;
}
.form-input:focus {
    outline: none;
    border-color: #ef233c;
    box-shadow: 0 0 0 3px rgba(239, 35, 60, 0.2);
}
.form-input::placeholder { color: rgba(161, 161, 170, 0.6); }

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #d4d4d8;
    margin-bottom: 0.5rem;
}

.form-error {
    color: #ef233c;
    font-size: 0.875rem;
    margin-top: 0.375rem;
    display: none;
}
.form-error.visible { display: block; }

/* Social Auth Buttons */
.social-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.75rem;
    color: #e4e4e7;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}
.social-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Card Hover Effects */
.feature-card { transition: all 0.3s ease; }
.feature-card:hover { border-color: rgba(255, 255, 255, 0.2); }
.feature-card::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}
.feature-card:hover::before { opacity: 0.1; }

/* Active Nav Link */
.nav-link.active { color: white !important; }

/* ---------- Routing diagram ---------- */
.task-chip { transition: all .25s ease; border: 1px solid rgba(255,255,255,0.12); }
.task-chip:hover { border-color: rgba(255,255,255,0.3); }
.task-chip.active {
    background: rgba(239,35,60,0.14);
    border-color: #ef233c;
    color: #fff;
    box-shadow: 0 0 22px rgba(239,35,60,0.25);
}
.rt-node circle, .rt-node text { transition: all .4s ease; }
.rt-node.active circle { fill: #ef233c; stroke: #ef233c; filter: drop-shadow(0 0 10px rgba(239,35,60,0.7)); }
.rt-node.active text { fill: #fff; font-weight: 600; }
.rt-node.dim { opacity: 0.35; }
.rt-hub circle { filter: drop-shadow(0 0 16px rgba(239,35,60,0.45)); }
.rt-connector { stroke: rgba(255,255,255,0.12); stroke-width: 2; fill: none; transition: stroke .3s ease; }
.rt-connector.active { stroke: #ef233c; stroke-dasharray: 6 6; animation: dash-flow .8s linear infinite; }
.rt-packet { fill: #ef233c; filter: drop-shadow(0 0 8px rgba(239,35,60,0.9)); }
.jitter { animation: jitter 2.4s ease-in-out infinite; }

/* ---------- Filter chips / model grid ---------- */
.filter-chip { transition: all .2s ease; border: 1px solid rgba(255,255,255,0.12); }
.filter-chip:hover { border-color: rgba(255,255,255,0.3); }
.filter-chip.active { background: #ef233c; border-color: #ef233c; color: #fff; }
.model-card { transition: all .3s ease; }
.model-card.hide { display: none; }
.model-card:hover { border-color: rgba(255,255,255,0.3); transform: translateY(-4px); }

/* ---------- Code panel ---------- */
.code-tab { transition: all .2s ease; border-bottom: 2px solid transparent; }
.code-tab.active { color: #fff; border-bottom-color: #ef233c; }
.code-pre { font-family: 'SF Mono', ui-monospace, 'Cascadia Code', Menlo, monospace; font-size: 13px; line-height: 1.7; }
.code-cursor { display: inline-block; width: 8px; height: 15px; background: #ef233c; vertical-align: text-bottom; animation: blink 1s step-end infinite; }
.caret::after { content: '▌'; color: #ef233c; animation: blink 1s step-end infinite; }

/* ---------- Dashboard ---------- */
.stat-num { font-variant-numeric: tabular-nums; }
.bar-track { background: rgba(255,255,255,0.06); }
.bar-fill { background: linear-gradient(90deg, #ef233c, #ff5c72); transition: width 1s cubic-bezier(.2,.7,.2,1); }

/* ---------- Auth card (login/register) ---------- */
.auth-card {
    background: linear-gradient(145deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
    border: 1px solid rgba(255,255,255,0.08);
    backdrop-filter: blur(20px);
    position: relative;
}
.auth-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 0%, rgba(239,35,60,0.08), transparent 60%);
    pointer-events: none;
}
.divider-line { position: relative; }
.divider-line::before {
    content: '';
    position: absolute;
    top: 50%; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
}
.divider-line span {
    position: relative;
    background: transparent;
    padding: 0 1rem;
    color: #71717a;
    font-size: 0.875rem;
}

/* ---------- Progress Steps (register wizard) ---------- */
.step-indicator { position: relative; }
.step-indicator::before {
    content: '';
    position: absolute;
    top: 12px; left: 50%; right: 0;
    height: 2px;
    background: rgba(255,255,255,0.1);
    z-index: 0;
}
.step-indicator:last-child::before { display: none; }
.step-circle {
    width: 24px; height: 24px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.2);
    background: transparent;
    display: flex; align-items: center; justify-content: center;
    position: relative; z-index: 1;
    transition: all 0.3s ease;
}
.step-circle.active { border-color: #ef233c; background: #ef233c; }
.step-circle.completed { border-color: #22c55e; background: #22c55e; }
.step-circle.completed::after {
    content: '';
    width: 8px; height: 8px;
    border: 2px solid white;
    border-top: none; border-right: none;
    transform: rotate(-45deg) translateY(1px);
}
.step-label {
    font-size: 0.7rem; font-weight: 500;
    text-transform: uppercase; letter-spacing: 0.05em;
    color: #71717a; margin-top: 0.5rem;
    transition: color 0.3s ease;
}
.step.active .step-label { color: #ef233c; }
.step.completed .step-label { color: #22c55e; }

/* ---------- Form transitions ---------- */
.form-step { display: none; animation: fade-in-up 0.4s ease-out forwards; }
.form-step.active { display: block; }

/* ---------- Password strength meter ---------- */
.strength-bar {
    height: 4px; border-radius: 2px;
    background: rgba(255,255,255,0.1);
    overflow: hidden; margin-top: 0.5rem;
}
.strength-fill {
    height: 100%; width: 0%;
    border-radius: 2px; transition: all 0.3s ease;
}
.strength-fill.weak   { width: 25%;  background: #ef4444; }
.strength-fill.fair   { width: 50%;  background: #fbbf24; }
.strength-fill.good   { width: 75%;  background: #22c55e; }
.strength-fill.strong { width: 100%; background: #22c55e; }

/* ---------- Checkbox styles ---------- */
.checkbox-custom {
    position: relative; padding-left: 2rem;
    cursor: pointer; display: flex; align-items: flex-start; gap: 0.75rem;
}
.checkbox-custom input {
    position: absolute; opacity: 0; cursor: pointer; height: 0; width: 0;
}
.checkmark {
    position: absolute; left: 0; top: 0;
    height: 1.125rem; width: 1.125rem;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 0.375rem;
    transition: all 0.2s ease;
}
.checkbox-custom:hover .checkmark { border-color: #ef233c; }
.checkbox-custom input:checked ~ .checkmark { background: #ef233c; border-color: #ef233c; }
.checkmark::after {
    content: '';
    position: absolute; display: none;
    left: 4px; top: 1px;
    width: 4px; height: 7px;
    border: solid white; border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.checkbox-custom input:checked ~ .checkmark::after { display: block; }

/* ---------- Flash messages ---------- */
.flash {
    border-radius: 0.75rem;
    padding: 0.875rem 1.25rem;
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
}
.flash-error   { background: rgba(239,35,60,0.12); border: 1px solid rgba(239,35,60,0.4); color: #ffb3bd; }
.flash-success { background: rgba(34,197,94,0.12);  border: 1px solid rgba(34,197,94,0.4);  color: #bbf7d0; }
.flash-info    { background: rgba(59,130,246,0.12);  border: 1px solid rgba(59,130,246,0.4);  color: #bfdbfe; }

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #000; }
::-webkit-scrollbar-thumb { background: #27272a; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #3f3f46; }

/* ---------- Console sidebar (app/*.php) ---------- */
.sidebar {
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.5);
}
.sidebar::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 0% 0%, rgba(239, 35, 60, 0.06), transparent 55%);
    pointer-events: none;
}
.sidebar-link {
    color: #a1a1aa;
    position: relative;
}
.sidebar-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}
.sidebar-link.active {
    color: #fff;
    background: rgba(239, 35, 60, 0.15);
    border: 1px solid rgba(239, 35, 60, 0.4);
}
.sidebar-link.active::before {
    content: '';
    position: absolute;
    left: -0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    border-radius: 0 3px 3px 0;
    background: #ef233c;
}
.sidebar-logout:hover {
    color: #fff;
}
/* Offset the main content area to the right of the fixed sidebar.
   Uses margin-left (not padding) with a higher-specificity selector so the
   Tailwind CDN's px-6 / mx-auto utilities cannot override it. */
main.with-sidebar { margin-left: 16rem; }
@media (max-width: 1023px) {
    main.with-sidebar { margin-left: 0; }
}

/* =====================================================================
   CRM DESIGN SYSTEM UTILITIES
   ===================================================================== */
.crm-card {
    background: rgba(18, 18, 22, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1rem;
    backdrop-filter: blur(16px);
    box-shadow: 0 4px 24px -1px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}
.crm-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
}
.crm-card-hover {
    transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.crm-card-hover:hover {
    border-color: rgba(239, 35, 60, 0.35);
    transform: translateY(-2px);
    box-shadow: 0 12px 32px -4px rgba(239, 35, 60, 0.12);
}

/* CRM Table */
.crm-table-container {
    width: 100%;
    overflow-x: auto;
    border-radius: 0.875rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(15, 15, 18, 0.6);
}
.crm-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.875rem;
}
.crm-table th {
    background: rgba(255, 255, 255, 0.03);
    color: #71717a;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.crm-table td {
    padding: 1rem 1.25rem;
    color: #e4e4e7;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.15s ease;
}
.crm-table tbody tr:last-child td {
    border-bottom: none;
}
.crm-table tbody tr:hover td {
    background: rgba(255, 255, 255, 0.03);
}

/* CRM Badges */
.crm-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1;
    border: 1px solid transparent;
}
.crm-badge-success {
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(34, 197, 94, 0.3);
    color: #4ade80;
}
.crm-badge-warning {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.3);
    color: #fbbf24;
}
.crm-badge-danger {
    background: rgba(239, 35, 60, 0.12);
    border-color: rgba(239, 35, 60, 0.35);
    color: #ff8593;
}
.crm-badge-info {
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.3);
    color: #60a5fa;
}
.crm-badge-neutral {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    color: #a1a1aa;
}

/* CRM Form Controls */
.crm-input, .crm-select, .crm-textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.625rem;
    padding: 0.625rem 0.875rem;
    color: #f4f4f5;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}
.crm-input:focus, .crm-select:focus, .crm-textarea:focus {
    outline: none;
    border-color: #ef233c;
    background: rgba(255, 255, 255, 0.07);
    box-shadow: 0 0 0 3px rgba(239, 35, 60, 0.2);
}
.crm-input::placeholder, .crm-textarea::placeholder {
    color: rgba(161, 161, 170, 0.5);
}
.crm-select option {
    background: #18181b;
    color: #fff;
}

/* CRM Buttons */
.crm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: 0.625rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}
.crm-btn-primary {
    background: #ef233c;
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(239, 35, 60, 0.35);
}
.crm-btn-primary:hover {
    background: #d90429;
    box-shadow: 0 6px 20px rgba(239, 35, 60, 0.5);
    transform: translateY(-1px);
}
.crm-btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.12);
    color: #e4e4e7;
}
.crm-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}
.crm-btn-danger {
    background: rgba(239, 35, 60, 0.15);
    border-color: rgba(239, 35, 60, 0.3);
    color: #ef233c;
}
.crm-btn-danger:hover {
    background: rgba(239, 35, 60, 0.25);
    border-color: rgba(239, 35, 60, 0.5);
    color: #ffffff;
}

/* CRM Stat Card */
.crm-stat-tile {
    background: rgba(18, 18, 22, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1rem;
    padding: 1.25rem 1.5rem;
    position: relative;
    overflow: hidden;
}
.crm-stat-icon {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(239, 35, 60, 0.12);
    border: 1px solid rgba(239, 35, 60, 0.25);
    color: #ef233c;
}

/* ---------- Global ---------- */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
    .reveal { opacity: 1 !important; transform: none !important; }
}

@media (max-width: 640px) {
    .auth-card { padding: 2rem 1.5rem !important; }
    .step-circle { width: 20px; height: 20px; }
    .step-label { font-size: 0.65rem; }
}

