:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f5;
    --bg-tertiary: #e0e0e0;
    --text-primary: #333333;
    --text-secondary: #666666;
    --accent: #666666;
    --accent-hover: #555555;
    --border: #cccccc;
    --shadow: rgba(0, 0, 0, 0.1);
    --success: #777777;
    --warning: #888888;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --bg-primary: #2a2a2a;
    --bg-secondary: #3a3a3a;
    --bg-tertiary: #4a4a4a;
    --text-primary: #e0e0e0;
    --text-secondary: #b0b0b0;
    --accent: #888888;
    --accent-hover: #999999;
    --border: #555555;
    --shadow: rgba(0, 0, 0, 0.3);
    --success: #aaaaaa;
    --warning: #bbbbbb;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    color: var(--text-primary);
    min-height: 100vh;
    padding: 20px;
    line-height: 1.6;
    transition: var(--transition);
    overflow-x: hidden;
}

#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.container {
    background: var(--bg-primary);
    border-radius: 16px;
    padding: 40px;
    max-width: 900px;
    margin: 0 auto;
    box-shadow: 0 20px 40px var(--shadow);
    border: 1px solid var(--border);
    animation: slideIn 0.6s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

h1 {
    text-align: center;
    margin-bottom: 40px;
    color: var(--text-primary);
    font-size: 2.5em;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: fadeInUp 0.8s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.settings {
    display: flex;
    gap: 20px;
    margin-bottom: 40px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.settings .form-group label {
    display: none;
}

.theme-btn {
    background: var(--bg-tertiary);
    border: 2px solid var(--border);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    font-size: 20px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 25px var(--shadow);
}

.form-group {
    margin-bottom: 24px;
    animation: fadeInUp 0.6s ease-out;
    animation-fill-mode: both;
}

.form-group:nth-child(1) { animation-delay: 0.1s; }
.form-group:nth-child(2) { animation-delay: 0.2s; }
.form-group:nth-child(3) { animation-delay: 0.3s; }
.form-group:nth-child(4) { animation-delay: 0.4s; }
.form-group:nth-child(5) { animation-delay: 0.5s; }

label {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 14px;
    gap: 8px;
}

.optional {
    color: var(--text-secondary);
    font-weight: 400;
    font-size: 12px;
}

.help-btn {
    background: #ffc107 !important;
    color: #000 !important;
    border: 2px solid #ffc107 !important;
    border-radius: 50%;
    width: 28px !important;
    height: 28px !important;
    cursor: pointer;
    font-size: 16px !important;
    font-weight: bold !important;
    transition: var(--transition);
    display: flex !important;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.help-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.4);
    background: #fff3cd;
}

input, select {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-primary);
    border: 2px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 16px;
    transition: var(--transition);
    font-family: inherit;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
    transform: translateY(-1px);
}

input:invalid {
    border-color: #dc3545;
}

.technical-requirements {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    margin: 32px 0;
    animation: slideIn 0.6s ease-out 0.6s both;
}

.technical-requirements h3 {
    color: var(--text-primary);
    margin-bottom: 20px;
    text-align: center;
    font-size: 1.3em;
    font-weight: 600;
}

.checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    margin-bottom: 0;
    cursor: pointer;
    padding: 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: var(--transition);
    font-weight: 500;
}

.checkbox-group label:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow);
}

.checkbox-group input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-radius: 4px;
    background: var(--bg-primary);
    cursor: pointer;
    position: relative;
    transition: var(--transition);
    margin-right: 12px;
}

.checkbox-group input[type="checkbox"]:checked {
    background: var(--accent);
    border-color: var(--accent);
}

.checkbox-group input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.checkbox-group input[type="checkbox"]:hover {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(102, 102, 102, 0.1);
}

.timeline-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    font-weight: 500;
    cursor: pointer;
    gap: 8px;
}

.checkbox-label input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-radius: 4px;
    background: var(--bg-primary);
    cursor: pointer;
    position: relative;
    transition: var(--transition);
    margin: 0;
}

.checkbox-label input[type="checkbox"]:checked {
    background: var(--accent);
    border-color: var(--accent);
}

.checkbox-label input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.checkbox-label input[type="checkbox"]:hover {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(102, 102, 102, 0.1);
}

#timeline:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

button[type="submit"] {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    color: white;
    border: 2px solid var(--accent);
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 32px;
    font-family: inherit;
    box-shadow: 0 4px 16px rgba(0, 123, 255, 0.3);
    position: relative;
    z-index: 1;
}

button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 123, 255, 0.4);
}

button[type="submit"]:active {
    transform: translateY(0);
}

.result {
    margin-top: 40px;
    padding: 32px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    animation: slideIn 0.6s ease-out;
    box-shadow: 0 8px 24px var(--shadow);
}

.result h2 {
    color: var(--text-primary);
    margin-bottom: 20px;
    text-align: center;
    font-size: 1.5em;
    font-weight: 600;
}

.result p {
    margin-bottom: 12px;
    color: var(--text-primary);
    font-size: 16px;
}

.hidden {
    display: none;
}

#price-result {
    font-size: 2em;
    font-weight: 700;
    color: var(--success);
    text-align: center;
    margin: 20px 0;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.installment-option {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    padding: 12px 16px;
    margin: 8px 0;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
}

.installment-option:hover {
    border-color: var(--accent);
    transform: translateX(4px);
    box-shadow: 0 4px 12px var(--shadow);
}

.installment-option.selected {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

/* Modal Styles */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease-out;
}

.modal-content {
    background: var(--bg-primary);
    margin: 15% auto;
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 40px var(--shadow);
    animation: slideIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.close {
    color: var(--text-secondary);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
}

.close:hover {
    color: var(--text-primary);
    transform: scale(1.2);
}

#help-title {
    margin-bottom: 16px;
    color: var(--text-primary);
    font-size: 1.3em;
    font-weight: 600;
}

#help-content {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 20px;
        margin: 10px;
    }

    h1 {
        font-size: 2em;
    }

    .settings {
        flex-direction: column;
        gap: 16px;
    }

    .checkbox-group {
        grid-template-columns: 1fr;
    }

    .modal-content {
        margin: 20% auto;
        width: 95%;
    }
}
