@import url('https://fonts.googleapis.com/css2?family=Bungee&display=swap');

.hidden { display: none !important; }

.debt-neo-wrapper {
    --bg-yellow: #fdfd96;
    --bg-pink: #ffb3c6;
    --bg-blue: #c6e2ff;
    --bg-green: #baffc9;
    --bg-red: #ffadad;
    --border-dark: 3px solid #000;
    --shadow-solid: 6px 6px 0px #000;
    
    font-family: system-ui, -apple-system, sans-serif;
    max-width: 900px; margin: 30px auto; background: #fff;
    border: var(--border-dark); border-radius: 16px; box-shadow: 10px 10px 0px #000;
    padding: 30px; box-sizing: border-box; color: #000;
}
.debt-neo-wrapper * { box-sizing: border-box; }

.debt-header {
    background: var(--bg-yellow); padding: 20px; border-radius: 12px;
    border: var(--border-dark); box-shadow: var(--shadow-solid); margin-bottom: 30px; text-align: center;
}
.debt-header h2 { margin: 0 0 10px 0; font-size: 1.8rem; font-weight: 900; text-transform: uppercase; }
.debt-header p { margin: 0; font-weight: 700; font-size: 1rem; color: #222; }

/* BỐ CỤC 2 CỘT NHẬP LIỆU */
.debt-input-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 25px; margin-bottom: 25px; }
.debt-card { border: var(--border-dark); border-radius: 12px; padding: 20px; box-shadow: var(--shadow-solid); }
.bg-pink { background: var(--bg-pink); }
.bg-blue { background: var(--bg-blue); }

.card-title { margin: 0 0 20px 0; font-size: 1.3rem; font-weight: 900; border-bottom: 3px dashed #000; padding-bottom: 10px;}
.debt-group { margin-bottom: 15px; }
.debt-group:last-child { margin-bottom: 0; }
.debt-group label { display: block; font-weight: 900; margin-bottom: 8px; font-size: 1.05rem; }
.hint-text { display: block; font-weight: 600; font-size: 0.85rem; color: #444; margin-top: 5px; }

.debt-input {
    width: 100%; padding: 12px 15px; font-size: 1.2rem; font-weight: 900; font-family: 'Courier New', monospace;
    border: var(--border-dark); border-radius: 8px; outline: none; background: #fff;
    box-shadow: inset 3px 3px 0px rgba(0,0,0,0.05); transition: 0.1s;
}
.debt-input:focus { background: #fff; box-shadow: 3px 3px 0px #000; transform: translateY(-2px); }

/* NÚT BẤM */
.debt-btn-calc {
    width: 100%; padding: 18px; font-size: 1.4rem; font-weight: 900; text-transform: uppercase;
    background: #111; color: #fff; border: var(--border-dark); border-radius: 12px;
    box-shadow: var(--shadow-solid); cursor: pointer; transition: 0.1s; letter-spacing: 1px;
}
.debt-btn-calc:active { transform: translate(4px, 4px); box-shadow: 2px 2px 0px #000; }

/* BÁO LỖI (FAILSAFE) */
.debt-error-box {
    margin-top: 25px; background: var(--bg-red); color: #900000; border: var(--border-dark);
    padding: 15px 20px; border-radius: 8px; font-weight: 900; font-size: 1.1rem;
    box-shadow: var(--shadow-solid); text-align: center; animation: shake 0.4s ease-in-out;
}
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

/* KHU VỰC KẾT QUẢ */
.debt-result-section { margin-top: 35px; border-top: 4px dashed #000; padding-top: 30px; animation: fadeUp 0.5s ease-out forwards;}
.res-title { font-size: 1.5rem; font-weight: 900; text-align: center; margin: 0 0 20px 0; text-transform: uppercase;}

.debt-table-wrapper { overflow-x: auto; border: var(--border-dark); border-radius: 12px; box-shadow: var(--shadow-solid); margin-bottom: 25px;}
.debt-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 1.1rem; font-weight: 700; background: #fff;}
.debt-table th { background: #333; color: #fff; padding: 15px; border-bottom: var(--border-dark); border-right: 2px solid #555; text-transform: uppercase; font-weight: 900;}
.debt-table td { padding: 15px; border-bottom: 2px solid #ccc; border-right: 2px solid #ccc; }
.debt-table th:last-child, .debt-table td:last-child { border-right: none; }
.debt-table tr:last-child td { border-bottom: none; }
.col-old { background: rgba(255, 179, 198, 0.2); }
.col-new { background: rgba(198, 226, 255, 0.2); }
.font-bold { font-weight: 900; font-size: 1.2rem; }

/* HỘP KẾT LUẬN (MÀU XANH HOẶC ĐỎ) */
.debt-savings-box { border: var(--border-dark); border-radius: 12px; padding: 25px; text-align: center; box-shadow: var(--shadow-solid); transition: background 0.3s; }
.debt-savings-box h4 { margin: 0 0 10px 0; font-size: 1.3rem; font-weight: 900; text-transform: uppercase;}
.savings-amount { font-family: 'Bungee', cursive; font-size: 3rem; color: #111; line-height: 1.2; text-shadow: 2px 2px 0px rgba(255,255,255,0.5);}
.savings-desc { margin: 10px 0 0 0; font-weight: 800; font-size: 1.1rem; }

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

/* RESPONSIVE */
@media (max-width: 768px) {
    .debt-input-grid { grid-template-columns: 1fr; }
    .debt-table { font-size: 1rem; }
    .savings-amount { font-size: 2.2rem; }
}