:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --bg: #f8fafc;
    --surface: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --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: 16px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg);
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem;
    min-height: 100vh;
}

.calculator-container {
    background-color: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 2.5rem;
    width: 100%;
    max-width: 900px;
}

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

header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--primary);
}

header p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.calculator-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
}

/* Input Section */
.input-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.row-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper .currency {
    position: absolute;
    left: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.input-wrapper .suffix {
    position: absolute;
    right: 12px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

input {
    width: 100%;
    padding: 0.75rem 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.2s;
    outline: none;
}

input[id="harga-rumah"], input[id="uang-muka"] {
    padding-left: 2.5rem;
    font-weight: 600;
}

input[id="suku-bunga"] {
    padding-right: 3rem;
}

input[id="tenor"] {
    padding-right: 4rem;
}

input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Hide native number spinners */
input[type=number]::-webkit-inner-spin-button, 
input[type=number]::-webkit-outer-spin-button { 
  -webkit-appearance: none; 
  margin: 0; 
}
input[type=number] {
    -moz-appearance: textfield;
}

.dp-percentage {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: right;
}

/* Result Section */
.result-card {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: white;
    padding: 2rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.result-card h3 {
    font-size: 1rem;
    font-weight: 500;
    opacity: 0.9;
    margin-bottom: 0.5rem;
}

.cicilan-amount {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
    letter-spacing: -0.5px;
}

.result-details {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: rgba(255,255,255,0.1);
    padding: 1.5rem;
    border-radius: var(--radius-md);
}

.detail-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    opacity: 0.9;
}

.detail-row.total {
    margin-top: 0.5rem;
    padding-top: 1rem;
    border-top: 1px dashed rgba(255,255,255,0.3);
    font-weight: 700;
    opacity: 1;
}

.disclaimer {
    margin-top: 1.5rem;
    font-size: 0.75rem;
    opacity: 0.7;
    text-align: center;
    line-height: 1.4;
}

.btn-share {
    margin-top: 1.5rem;
    background-color: #25D366; /* WhatsApp Green */
    color: white;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: background-color 0.2s, transform 0.1s;
    width: 100%;
}

.btn-share:hover {
    background-color: #128C7E;
}

.btn-share:active {
    transform: scale(0.98);
}

/* Responsive */
@media (max-width: 768px) {
    .calculator-layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .row-inputs {
        grid-template-columns: 1fr !important;
    }

    body {
        padding: 1rem;
    }
    
    .calculator-container {
        padding: 1.25rem;
    }

    .cicilan-amount {
        font-size: 1.8rem !important;
    }
    
    header h1 {
        font-size: 1.5rem;
    }

    .seo-article {
        padding: 1.25rem;
        margin: 1rem auto;
    }
}

/* SEO Article & Footer */
.seo-article {
    max-width: 900px;
    margin: 3rem auto;
    padding: 2rem;
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    color: var(--text-main);
    line-height: 1.6;
}

.seo-article h2 {
    color: var(--primary);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.seo-article h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-size: 1.2rem;
    color: #1e293b;
}

.seo-article h4 {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    font-size: 1.05rem;
    color: var(--primary);
}

.seo-article p {
    margin-bottom: 1rem;
    color: var(--text-muted);
}

.site-footer {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 0;
    text-align: center;
    border-top: 1px solid var(--border);
}

.footer-links {
    margin-bottom: 1rem;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s;
}

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

.site-footer p {
    font-size: 0.8rem;
    color: #94a3b8;
}
