:root {
    --bg-color: #f1f3f6;
    --text-main: #111111;
    --text-muted: #6b7280;
    --card-radius: 32px;
    --pill-radius: 9999px;
    
    --card-blue: #e0f2fe;
    --card-green: #dcfce7;
    --card-yellow: #fef08a;
    --card-purple: #f3e8ff;
    --card-white: #ffffff;
    
    --shadow-sm: 0 4px 10px rgba(0,0,0,0.03);
    --shadow-md: 0 10px 30px rgba(0,0,0,0.08);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
}

.pwa-wrapper {
    width: 100%;
    max-width: 1200px;
    background-color: var(--bg-color);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    padding-bottom: 120px;
    margin: 0 auto;
}

/* Header */
.pwa-header {
    padding: 32px 24px 16px;
    max-width: 800px;
    margin: 0 auto;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.icon-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: var(--text-main); /* Like dark toggles in image */
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    box-shadow: var(--shadow-sm);
    position: relative;
    text-decoration: none;
}

.icon-btn.light {
    background-color: var(--card-white);
    color: var(--text-main);
}

.notification-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 8px;
    height: 8px;
    background-color: #ef4444;
    border-radius: 50%;
    border: 2px solid var(--card-white);
}

.main-title {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.04em;
    color: var(--text-main);
}

/* Grid */
.pwa-main {
    padding: 0 24px;
    max-width: 800px;
    margin: 0 auto;
}

.type-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

label.type-label {
    cursor: pointer;
    display: block;
}

label.type-label input[type="radio"] {
    display: none;
}

.pwa-card {
    border-radius: var(--card-radius);
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid transparent;
    height: 100%;
}

.card-icon {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.5);
}

.pwa-card span {
    font-weight: 700;
    font-size: 1.1rem;
    text-align: center;
}

/* Custom Selection State */
label.type-label:has(input[type="radio"]:checked) .pwa-card {
    border-color: var(--text-main);
    transform: scale(0.97);
}

.card-blue { background-color: var(--card-blue); }
.card-green { background-color: var(--card-green); }
.card-yellow { background-color: var(--card-yellow); }
.card-purple { background-color: var(--card-purple); }
.card-white { background-color: var(--card-white); box-shadow: var(--shadow-sm); }

/* Input Section */
.amount-container {
    margin-bottom: 32px;
}

.search-bar {
    display: flex;
    align-items: center;
    background: var(--card-white);
    border-radius: var(--pill-radius);
    padding: 8px 24px;
    height: 64px;
    box-shadow: var(--shadow-sm);
    border: 2px solid transparent;
    transition: border-color 0.2s;
}

.search-bar:focus-within {
    border-color: var(--text-main);
}

.search-bar svg {
    color: var(--text-main);
    margin-right: 12px;
}

.search-bar input {
    border: none;
    background: transparent;
    font-size: 1.25rem;
    font-weight: 700;
    width: 100%;
    outline: none;
    color: var(--text-main);
}

.search-bar input::placeholder {
    color: var(--text-muted);
    font-weight: 500;
}

/* Subtitle */
.sub-title {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 16px;
}

/* Results Grid */
.results-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 32px;
}

.result-card {
    background: var(--card-white);
    border-radius: 24px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.result-period {
    font-size: 0.85rem;
    color: var(--text-main);
    font-weight: 700;
    background: var(--bg-color);
    padding: 6px 12px;
    border-radius: var(--pill-radius);
    align-self: flex-start;
}

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

.result-card.highlight {
    background-color: var(--text-main);
}

.result-card.highlight .result-period {
    background-color: rgba(255,255,255,0.2);
    color: white;
}

.result-card.highlight .result-value {
    color: white;
}


/* IVA Card */
.iva-card {
    border-radius: var(--card-radius);
    padding: 24px;
    margin-bottom: 24px;
}

.iva-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.iva-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(255,255,255,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
}

.iva-card h3 {
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.iva-result-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    padding: 16px;
    background: rgba(255,255,255,0.6);
    border-radius: 20px;
}

.iva-result-display span {
    font-weight: 600;
    font-size: 0.95rem;
}

.iva-result-display strong {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-main);
}

/* Floating Nav */
.floating-nav {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 48px);
    max-width: 600px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
}

.nav-pill {
    background: #111111;
    border-radius: var(--pill-radius);
    height: 64px;
    display: flex;
    align-items: center;
    padding: 0 8px;
    box-shadow: var(--shadow-md);
    flex: 1;
    margin-right: 16px;
}

.nav-item {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    text-decoration: none;
    transition: all 0.2s;
}

.nav-item.active {
    background: rgba(255,255,255,0.1);
    color: white;
}

.nav-fab {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #111111;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    box-shadow: var(--shadow-md);
    cursor: pointer;
}

.nav-fab svg {
    width: 28px;
    height: 28px;
}
