* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Gray theme colors */
    --bg-primary: #2c2c2e;
    --bg-secondary: #3a3a3c;
    --text-primary: #f5f5f7;
    --text-secondary: #98989d;
    --text-accent: #0a84ff;
    --border-color: #48484a;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    --input-bg: #2c2c2e;
    --button-bg: #0a84ff;
    --button-hover: #0077ed;
    --accent-color: #30d158;
    --error-color: #ff453a;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    transition: background-color 0.3s ease;
}

.container {
    width: 100%;
    max-width: 400px;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.calculator-card {
    background: var(--bg-secondary);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Header */
.header {
    padding: 20px 20px 16px;
}

.header h1 {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
}

/* Result Display */
.result-display {
    padding: 28px 20px;
    text-align: center;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, rgba(10, 132, 255, 0.15) 0%, rgba(10, 132, 255, 0.05) 100%);
}

.result-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.result-value {
    font-size: 48px;
    font-weight: 300;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

.result-value.animate {
    animation: pulse 0.3s ease;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.result-details {
    font-size: 13px;
    color: var(--text-secondary);
    min-height: 20px;
}

.contract-option {
    font-size: 15px;
    color: var(--text-primary);
    margin-top: 10px;
    font-weight: 500;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.contract-option:first-child {
    margin-top: 0;
}

.contract-option.micro-suggestion {
    background: rgba(48, 209, 88, 0.1);
    border: 1px solid rgba(48, 209, 88, 0.3);
    color: var(--accent-color);
}

/* Input Section */
.input-section {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

/* Toggle Switch */
.toggle-container-wrapper {
    display: flex;
    justify-content: center;
    margin-top: -1px;
    margin-bottom: 17px;
}

.toggle-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.toggle-label {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
    transition: color 0.3s ease;
    cursor: pointer;
}

.toggle-label.active {
    color: var(--button-bg);
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-color);
    transition: 0.3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--button-bg);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

.input-group {
    margin-bottom: 16px;
}

.input-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 11px;
}

.input-wrapper {
    position: relative;
}

.input-prefix {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 500;
    pointer-events: none;
}

.input-wrapper input {
    padding-left: 30px;
}

input, select {
    width: 100%;
    padding: 12px 14px;
    font-size: 15px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    background: var(--input-bg);
    color: var(--text-primary);
    transition: all 0.2s ease;
    font-family: inherit;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--button-bg);
    background: var(--bg-secondary);
    box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.1);
}

/* Hide number input spinners */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
}

/* Better input hover state */
input:hover:not(:focus), select:hover:not(:focus) {
    border-color: var(--text-secondary);
}

select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%2398989d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

select optgroup {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 8px;
}


/* Calculate Button */
.calculate-btn {
    width: 100%;
    padding: 14px;
    font-size: 15px;
    font-weight: 600;
    color: white;
    background: var(--button-bg);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(10, 132, 255, 0.2);
}

.calculate-btn:hover {
    background: var(--button-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(10, 132, 255, 0.4);
}

.calculate-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(10, 132, 255, 0.2);
}

/* Info Card */
.info-card {
    background: var(--input-bg);
    border-radius: 10px;
    padding: 16px;
    margin: 20px;
    border: 1px solid var(--border-color);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

.info-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-content {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.6;
}

.contract-detail {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
}

.contract-detail:last-child {
    margin-bottom: 0;
}

.contract-detail-label {
    color: var(--text-secondary);
}

.contract-detail-value {
    font-weight: 600;
    color: var(--text-primary);
}

/* Responsive Design */
@media (max-width: 480px) {
    .result-value {
        font-size: 48px;
    }
    
    .header h1 {
        font-size: 18px;
    }
}

/* Error states */
.input-group.error input,
.input-group.error .input-wrapper input {
    border-color: var(--error-color);
    background: rgba(255, 59, 48, 0.05);
}

.input-group.error select {
    border-color: var(--error-color);
    background: var(--input-bg);
}

.input-group.error input:focus,
.input-group.error .input-wrapper input:focus {
    border-color: var(--error-color);
    box-shadow: 0 0 0 3px rgba(255, 59, 48, 0.1);
    background: var(--bg-secondary);
}

.input-group.error select:focus {
    border-color: var(--error-color);
    box-shadow: 0 0 0 3px rgba(255, 59, 48, 0.1);
    background: var(--input-bg);
}

.error-message {
    color: var(--error-color);
    font-size: 12px;
    margin-top: 6px;
    min-height: 18px;
    font-weight: 500;
    display: block;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.input-group.error .error-message {
    opacity: 1;
}

