:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-light: #eef2ff;
    --secondary: #0d9488;
    --secondary-hover: #0f766e;
    --secondary-light: #f0fdfa;
    --accent: #f59e0b;
    --success: #059669;
    --success-bg: #ecfdf5;
    --danger: #dc2626;
    --danger-bg: #fef2f2;
    --background: #f8fafc;
    --card-bg: rgba(255, 255, 255, 0.85);
    --text-main: #0f172a;
    --text-muted: #475569;
    --border-color: rgba(226, 232, 240, 0.6);
    --shadow-soft: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    background-color: #f3f4f6;
    background-image: 
        radial-gradient(at 0% 0%, hsla(253,16%,7%,1) 0, transparent 50%), 
        radial-gradient(at 50% 0%, hsla(225,39%,30%,1) 0, transparent 50%), 
        radial-gradient(at 100% 0%, hsla(339,49%,30%,1) 0, transparent 50%);
    background-attachment: fixed;
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
    padding: 2rem 0;
}

/* Texture Overlay */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3column%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.03;
    pointer-events: none;
    z-index: 0;
}

.bg-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.blob {
    position: absolute;
    width: 1000px;
    height: 1000px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    filter: blur(80px);
}

.blob-1 { top: -400px; right: -200px; animation: move-1 20s infinite alternate; }
.blob-2 { bottom: -400px; left: -200px; background: radial-gradient(circle, rgba(20, 184, 166, 0.1) 0%, transparent 70%); animation: move-2 15s infinite alternate; }
.blob-3 { top: 30%; right: 40%; width: 600px; height: 600px; background: radial-gradient(circle, rgba(236, 72, 153, 0.08) 0%, transparent 70%); animation: move-3 25s infinite alternate; }

@keyframes move-1 { from { transform: translate(0, 0); } to { transform: translate(-100px, 100px); } }
@keyframes move-2 { from { transform: translate(0, 0); } to { transform: translate(150px, -50px); } }
@keyframes move-3 { from { transform: translate(0, 0); } to { transform: translate(-50px, -150px); } }

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    position: relative;
    z-index: 10;
}

header {
    margin-bottom: 3rem;
    text-align: center;
}

header h1 {
    font-size: 3.5rem;
    font-weight: 800;
    letter-spacing: -0.05em;
    color: white;
    margin-bottom: 0.5rem;
    text-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

header h1 span {
    background: linear-gradient(135deg, #a5b4fc, #99f6e4);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

header p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.25rem;
    font-weight: 500;
    max-width: 600px;
    margin: 0 auto;
}

.card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 1.5rem;
    padding: 2.5rem;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(255, 255, 255, 0.3);
    margin-bottom: 2rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.25);
    background: rgba(255, 255, 255, 0.9);
}

.card h2 {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-main);
    letter-spacing: -0.02em;
}

.grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

@media (min-width: 900px) {
    .grid-3 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .grid, .grid-3 {
        grid-template-columns: 1fr;
    }
    header h1 { font-size: 2.5rem; }
}

.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

input, select {
    width: 100%;
    padding: 1rem 1.25rem;
    background-color: rgba(248, 250, 252, 0.8);
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    font-size: 1rem;
    color: var(--text-main);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

input:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    background-color: #fff;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
    transform: translateY(-1px);
}

button {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: white;
    padding: 1.25rem 2.5rem;
    border: none;
    border-radius: 1.25rem;
    font-size: 1.125rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.3);
}

button:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 25px -5px rgba(79, 70, 229, 0.4);
}

#addLineBtn {
    background: white;
    color: var(--primary);
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    font-size: 0.95rem;
    padding: 0.75rem 1.5rem;
    border: 1px solid var(--border-color);
}

#addLineBtn:hover {
    background: var(--primary-light);
    color: var(--primary-hover);
}

#analyzeBtn {
    width: auto;
    min-width: 240px;
    padding: 1.1rem 2.5rem;
    font-size: 1.05rem;
    margin-top: 0;
}

.security-panel {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 2rem;
    border-radius: 2rem;
    margin-bottom: 3rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    color: white;
}

.security-icon {
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.results-section {
    display: none;
    border-top: none;
    animation: slideUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.report-card {
    padding: 1.75rem;
    background: white;
    border-radius: 1.25rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-soft);
}

.report-label {
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 0.5rem;
}

.report-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-main);
}

.prediction-badge {
    padding: 0.75rem 1.75rem;
    border-radius: 3rem;
    font-size: 1rem;
    font-weight: 800;
}

.badge-success { background: #d1fae5; color: #065f46; }
.badge-danger { background: #fee2e2; color: #991b1b; }

.insight-box {
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    padding: 2.5rem;
    border-radius: 1.5rem;
    border: 1px solid var(--border-color);
    margin-top: 2rem;
    box-shadow: inset 0 2px 4px 0 rgba(0,0,0,0.05);
}

.insight-box h3 {
    color: var(--primary);
    font-size: 1.25rem;
    font-weight: 800;
}

.service-line {
    background: rgba(248, 250, 252, 0.5);
    padding: 2rem;
    border: 2px solid #f1f5f9;
    border-radius: 1.5rem;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
}

.service-line:hover {
    border-color: var(--primary);
    background: white;
}

.total-display {
    background: white;
    padding: 2rem;
    border-radius: 1.5rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-soft);
}

.total-amount {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--primary);
}

::-webkit-scrollbar { width: 12px; }
::-webkit-scrollbar-track { background: rgba(0,0,0,0.1); }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 6px; border: 3px solid rgba(0,0,0,0.1); }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.3); }
