:root {
    /* Theme: Dark mode with Indonesian Red palette */
    --bg-body: #1A0A0A;
    --bg-card: #2A1111;
    --bg-input: #3A1818;
    --bg-hover: #4A1E1E;

    --primary: #E74C3C;
    --primary-hover: #C0392B;
    --secondary: #FD79A8;
    --accent: #FDCB6E;

    --text-main: #FDFEFE;
    --text-muted: #BDC3C7;
    --border: #4A1E1E;

    --radius: 12px;
    --font: 'Inter', -apple-system, sans-serif;
    --shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
    --transition: all 0.2s ease;
}

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

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    font-family: var(--font);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 2rem 1rem;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.text-primary {
    color: var(--primary);
}

.text-accent {
    color: var(--accent);
}

.app-container {
    width: 100%;
    max-width: 1000px;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Header */
.app-header {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--primary);
}

.logo h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.5px;
}

.subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Main Content & Cards */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1.5rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.card h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.grid-2-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.right-col-stack {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Input Section */
.input-section {
    text-align: center;
    padding: 2.5rem 1.5rem;
    background: linear-gradient(145deg, var(--bg-card) 0%, #200d0d 100%);
    border-top: 4px solid var(--primary);
}

.input-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.currency-prefix {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary);
}

.huge-input {
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 4rem;
    font-weight: 700;
    width: 100%;
    max-width: 600px;
    outline: none;
    font-family: var(--font);
    border-bottom: 2px solid transparent;
    transition: var(--transition);
}

.huge-input:focus {
    border-bottom-color: var(--primary);
}

.huge-input::placeholder {
    color: var(--bg-hover);
}

.input-tools {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.tool-btn {
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 0.5rem 1rem;
    border-radius: 99px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.tool-btn:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
    color: var(--primary);
}

.tool-btn.danger {
    color: var(--secondary);
    border-color: transparent;
}

.tool-btn.danger:hover {
    background: rgba(253, 121, 168, 0.1);
}

/* Results Formatting */
.result-row {
    margin-bottom: 1.25rem;
}

.result-row:last-child {
    margin-bottom: 0;
}

.result-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}

.result-value-group {
    display: flex;
    align-items: center;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.5rem;
    transition: var(--transition);
}

.result-value-group:hover {
    border-color: var(--bg-hover);
}

.result-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 1.1rem;
    font-weight: 600;
    font-family: 'Inter', monospace;
    padding: 0.5rem;
    outline: none;
}

.copy-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.copy-btn:hover {
    background: var(--bg-hover);
    color: var(--primary);
}

.terbilang-box {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    font-size: 1rem;
    color: var(--accent);
    line-height: 1.4;
    min-height: 60px;
    font-style: italic;
}

/* Tax Calculator */
.tax-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.tax-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.tax-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.tax-item.total {
    margin-top: 0.5rem;
    font-size: 1.2rem;
    font-weight: 700;
}

.tax-label {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.tax-val {
    font-weight: 600;
    font-family: 'Inter', monospace;
}

/* Salary Breakdown */
.salary-settings {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.salary-settings label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
}

.salary-settings input[type="radio"] {
    accent-color: var(--primary);
}

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

.salary-stat {
    background: var(--bg-input);
    padding: 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.stat-lbl {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.stat-lbl .hint {
    font-size: 0.7rem;
    opacity: 0.6;
}

.stat-val {
    font-size: 1.1rem;
    font-weight: 600;
    font-family: 'Inter', monospace;
}

/* Conversion */
.conversion-card {
    text-align: center;
}

.rates-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.rate-box {
    background: var(--bg-input);
    padding: 1.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.rate-box:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
}

.flag {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.curr-name {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 600;
}

.curr-val {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0.5rem 0;
    font-family: 'Inter', monospace;
}

.curr-rate {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.disclaimer {
    font-size: 0.75rem;
    color: var(--text-muted);
    opacity: 0.7;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--text-main);
    color: var(--bg-body);
    padding: 0.75rem 1.5rem;
    border-radius: 99px;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: var(--shadow);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 100;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

/* Responsive */
@media (max-width: 768px) {
    .huge-input {
        font-size: 2.5rem;
    }

    .currency-prefix {
        font-size: 2rem;
    }

    .grid-2-col {
        grid-template-columns: 1fr;
    }

    .rates-grid {
        grid-template-columns: 1fr;
    }
}