:root {
    --bg-gradient: linear-gradient(135deg, #c2e9fb 0%, #a1c4fd 40%, #fbc2eb 100%);
    --text: #1a1a2e;
    --text-dim: #6b7280;
    --glass-bg: rgba(255, 255, 255, 0.45);
    --glass-border: rgba(255, 255, 255, 0.6);
    --glass-shadow: rgba(31, 38, 135, 0.15);
    --glass-input: rgba(255, 255, 255, 0.35);
    --glass-input-focus: rgba(255, 255, 255, 0.55);
    --glass-input-readonly: rgba(255, 255, 255, 0.2);
    --accent: #4a6cf7;
    --green: #10b981;
    --red: #ef4444;
    --purple: #8b5cf6;
    --cyan: #06b6d4;
    --toast-bg: rgba(255, 255, 255, 0.7);
    --slider-off: rgba(255, 255, 255, 0.3);
    --slider-border: rgba(255, 255, 255, 0.4);
}

[data-theme="dark"] {
    --bg-gradient: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
    --text: #e2e8f0;
    --text-dim: #94a3b8;
    --glass-bg: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.15);
    --glass-shadow: rgba(0, 0, 0, 0.4);
    --glass-input: rgba(255, 255, 255, 0.1);
    --glass-input-focus: rgba(255, 255, 255, 0.15);
    --glass-input-readonly: rgba(255, 255, 255, 0.05);
    --toast-bg: rgba(30, 30, 60, 0.7);
    --slider-off: rgba(255, 255, 255, 0.1);
    --slider-border: rgba(255, 255, 255, 0.15);
}

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

body {
    font-family: 'Geist', -apple-system, 'Segoe UI', sans-serif;
    min-height: 100vh;
    padding: 24px;
    display: flex;
    justify-content: center;
    background: var(--bg-gradient);
    background-attachment: fixed;
    color: var(--text);
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.06;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200' viewBox='0 0 200 200'%3E%3Cg fill='none' stroke='%23000' stroke-width='1.2'%3E%3Ccircle cx='40' cy='40' r='18'/%3E%3Ccircle cx='40' cy='40' r='10'/%3E%3Ccircle cx='40' cy='40' r='3' fill='%23000'/%3E%3Ccircle cx='140' cy='100' r='18'/%3E%3Ccircle cx='140' cy='100' r='10'/%3E%3Ccircle cx='140' cy='100' r='3' fill='%23000'/%3E%3Ccircle cx='90' cy='160' r='18'/%3E%3Ccircle cx='90' cy='160' r='10'/%3E%3Ccircle cx='90' cy='160' r='3' fill='%23000'/%3E%3Crect x='80' y='20' width='36' height='36' rx='4'/%3E%3Crect x='86' y='26' width='24' height='24' rx='2'/%3E%3Cpath d='M88 38 L93 33 L97 36 L104 28' stroke-width='1.5'/%3E%3Crect x='20' y='110' width='36' height='36' rx='4'/%3E%3Crect x='26' y='116' width='24' height='24' rx='2'/%3E%3Cpath d='M28 128 L33 123 L37 126 L44 118' stroke-width='1.5'/%3E%3Crect x='130' y='150' width='36' height='36' rx='4'/%3E%3Crect x='136' y='156' width='24' height='24' rx='2'/%3E%3Cpath d='M138 168 L143 163 L147 166 L154 158' stroke-width='1.5'/%3E%3Ctext x='30' y='180' font-size='14' font-family='sans-serif' fill='%23000'%3E$%3C/text%3E%3Ctext x='170' y='50' font-size='14' font-family='sans-serif' fill='%23000'%3E%E2%82%AC%3C/text%3E%3Ctext x='100' y='100' font-size='12' font-family='sans-serif' fill='%23000'%3ERp%3C/text%3E%3C/g%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 200px 200px;
    transform: rotate(-15deg);
}

.wrapper {
    width: 100%;
    max-width: 460px;
    position: relative;
    z-index: 1;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.logo {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: 2px;
    color: var(--text);
    display: inline-block;
    animation: logoPop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.logo span {
    color: var(--accent);
    animation: accentPulse 2.5s ease-in-out infinite;
    display: inline-block;
}
@keyframes logoPop {
    0% { opacity: 0; transform: translateY(-8px) scale(0.8); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes accentPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.12); }
}

.tagline {
    font-size: 9px;
    font-weight: 500;
    color: var(--text-dim);
    letter-spacing: 1px;
    margin-top: 1px;
    text-transform: uppercase;
    animation: taglineFade 0.8s ease-out 0.3s both;
}
@keyframes taglineFade {
    0% { opacity: 0; transform: translateY(-4px); }
    100% { opacity: 1; transform: translateY(0); }
}

.header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.share-btn {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 16px var(--glass-shadow);
    cursor: pointer;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    animation: shareWiggle 3s ease-in-out infinite;
}
.share-btn:hover {
    transform: scale(1.15) rotate(10deg);
    background: var(--accent);
    color: #fff;
    box-shadow: 0 6px 20px rgba(74,108,247,0.3);
    animation-play-state: paused;
}
.share-btn:active {
    transform: scale(0.9);
}
@keyframes shareWiggle {
    0%, 90%, 100% { transform: rotate(0deg); }
    93% { transform: rotate(-8deg); }
    96% { transform: rotate(8deg); }
}

.theme-toggle {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 16px var(--glass-shadow);
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    animation: sunBob 3.5s ease-in-out infinite;
}
.theme-toggle:hover {
    transform: scale(1.1) rotate(15deg);
    box-shadow: 0 6px 20px var(--glass-shadow);
    animation-play-state: paused;
}
.theme-toggle:active {
    transform: scale(0.9) rotate(-15deg);
}
@keyframes sunBob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

.card {
    background: var(--glass-bg);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 16px;
    box-shadow: 0 8px 32px var(--glass-shadow);
    margin-bottom: 12px;
}

.card-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-dim);
    margin-bottom: 10px;
}

.row {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
    gap: 8px;
}

.row label {
    flex: 1;
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-glass {
    width: 150px;
    padding: 7px 12px;
    border: 1px solid rgba(255,255,255,0.4);
    border-radius: 12px;
    background: var(--glass-input);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: var(--text);
    font-size: 13px;
    text-align: right;
    font-weight: 600;
    outline: none;
    transition: all 0.2s;
    font-family: inherit;
}
.input-glass:focus {
    background: var(--glass-input-focus);
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(74,108,247,0.15);
}
.input-glass.readonly {
    color: var(--text-dim);
    background: var(--glass-input-readonly);
}

.row-accent label, .row-accent .input-glass { color: var(--accent); }
.row-green label, .row-green .input-glass { color: var(--green); }
.row-red label, .row-red .input-glass { color: var(--red); }
.row-purple label, .row-purple .input-glass { color: var(--purple); }
.row-cyan label, .row-cyan .input-glass { color: var(--cyan); }

.switch {
    position: relative;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}
.switch input {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border: 1px solid var(--slider-border);
    border-radius: 6px;
    background: var(--glass-input);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    margin: 0;
    position: relative;
    animation: checkBreathe 4s ease-in-out infinite;
}
.switch input:hover {
    transform: scale(1.15);
    animation-play-state: paused;
}
.switch input:checked {
    background: var(--accent);
    border-color: var(--accent);
    transform: scale(1.1);
    animation: none;
}
.switch input:checked::after {
    content: "";
    position: absolute;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    animation: checkPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes checkPop {
    0% { opacity: 0; transform: rotate(45deg) scale(0); }
    100% { opacity: 1; transform: rotate(45deg) scale(1); }
}
@keyframes checkBreathe {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

.tarif {
    width: 48px;
    padding: 5px 6px;
    border: 1px solid var(--slider-border);
    border-radius: 8px;
    background: var(--glass-input);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    font-size: 12px;
    text-align: center;
    color: var(--text);
    font-weight: 600;
    outline: none;
    font-family: inherit;
    transition: all 0.2s;
}
.tarif:focus {
    background: var(--glass-input-focus);
    border-color: var(--accent);
}

.pct {
    font-size: 12px;
    color: var(--text-dim);
    width: 14px;
}

.copy-btn {
    width: 28px;
    height: 28px;
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    background: var(--glass-input);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    cursor: pointer;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-family: inherit;
    animation: copyPulse 4s ease-in-out infinite;
}
.copy-btn:hover {
    background: var(--accent);
    color: #fff;
    transform: scale(1.15) translateY(-2px);
    box-shadow: 0 4px 12px rgba(74,108,247,0.3);
    animation-play-state: paused;
}
.copy-btn:active {
    transform: scale(0.9);
}
.copy-btn svg {
    transition: transform 0.25s ease;
}
.copy-btn:hover svg {
    transform: scale(1.1);
}
@keyframes copyPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(74,108,247,0); }
    50% { box-shadow: 0 0 0 3px rgba(74,108,247,0.1); }
}

.divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--glass-border), transparent);
    margin: 8px 0;
}

.result-highlight {
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pajak-row.disabled {
    opacity: 0.4;
}
.pajak-row.disabled .hasil-pajak {
    color: var(--text-dim);
}

.toast {
    position: fixed;
    top: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    padding: 12px 24px;
    border-radius: 14px;
    background: var(--toast-bg);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px var(--glass-shadow);
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 999;
}
.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.footer {
    text-align: center;
    padding: 16px 0 4px;
    margin-top: 4px;
}
.footer a {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-dim);
    text-decoration: none;
    letter-spacing: 0.5px;
    transition: color 0.2s;
}
.footer a:hover {
    color: var(--accent);
}
.footer span {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-dim);
    letter-spacing: 0.5px;
    margin-left: 4px;
}

@media (max-width: 480px) {
    .row { flex-wrap: nowrap; }
    .input-glass { width: 100px; }
    .hasil-pajak { width: 80px !important; }
    .tarif { width: 40px; }
    .row label { font-size: 11px; }
}
