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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

/* Login Modal Styles */
.login-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.login-content {
    background: white;
    padding: 3rem;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    width: 90%;
    max-width: 400px;
}

.login-content h2 {
    color: #2c3e50;
    margin-bottom: 2rem;
    text-align: center;
    font-size: 1.8rem;
}

.login-group {
    margin-bottom: 1.5rem;
}

.login-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #555;
    font-weight: 500;
}

.login-input {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.login-input:focus {
    outline: none;
    border-color: #667eea;
}

.login-error {
    color: #e74c3c;
    background: #fee;
    padding: 0.8rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    text-align: center;
    font-size: 0.9rem;
}

.login-btn {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.login-btn:active {
    transform: translateY(0);
}

header {
    background: white;
    padding: 2rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-content {
    display: flex;
    align-items: center;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.logo-container {
    display: flex;
    align-items: center;
}

img.logo {
    height: 120px !important;
    width: auto !important;
    max-width: 220px !important;
    object-fit: contain !important;
    display: block !important;
}

.header-text {
    text-align: center;
    flex: 1;
}

header h1 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-size: 2rem;
}

header p {
    color: #7f8c8d;
    font-size: 1.1rem;
}

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    overflow-x: hidden;
}

.calculator-section {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    overflow: hidden;
}

.calculator-section h2 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    border-bottom: 3px solid #3498db;
    padding-bottom: 0.5rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    position: relative;
    width: 100%;
    overflow: hidden;
}

.form-group label {
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-group label::before {
    content: '▸';
    color: #3498db;
    font-weight: 700;
    font-size: 1.1rem;
}

.form-input {
    padding: 1rem 1.25rem;
    border: 2px solid #ecf0f1;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f8f9fa;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.06);
    color: #2c3e50;
    width: 100%;
    box-sizing: border-box;
}

.form-input::placeholder {
    color: #95a5a6;
    font-style: italic;
}

.form-input:focus {
    outline: none;
    border-color: #3498db;
    background: white;
    box-shadow: 0 0 0 4px rgba(52, 152, 219, 0.15), inset 0 2px 4px rgba(0,0,0,0.06);
    transform: translateY(-1px);
    color: #2c3e50;
}

.income-category {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    font-size: 1.1rem;
    margin-top: 1rem;
}

.category-label {
    font-weight: 600;
}

.category-value {
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.results-section {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    overflow: hidden;
}

.results-section h2 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    border-bottom: 3px solid #27ae60;
    padding-bottom: 0.5rem;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.75rem;
    margin-bottom: 2rem;
}

.result-card {
    background: #f8f9fa;
    padding: 2rem 1.5rem;
    border-radius: 15px;
    text-align: center;
    border: 2px solid #ecf0f1;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.result-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #3498db, #2980b9);
    transition: height 0.3s ease;
}

.result-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.result-card:hover::before {
    height: 6px;
}

.result-card.highlight {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
    border-color: #27ae60;
    transform: scale(1.02);
}

.result-card.highlight::before {
    background: linear-gradient(90deg, #f39c12, #e67e22);
}

.result-card h3 {
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    color: #2c3e50;
}

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

.result-amount {
    font-size: 2.25rem;
    font-weight: 700;
    color: #3498db;
    margin: 0.5rem 0;
    line-height: 1.2;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.result-card.highlight .result-amount {
    color: white;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.calculation-details {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 12px;
    margin-top: 2rem;
    border-left: 5px solid #3498db;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.calculation-details h3 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.calculation-details h3::before {
    content: '📋';
    font-size: 1.2rem;
}

.calculation-details p {
    margin-bottom: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #ecf0f1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.calculation-details p:last-child {
    border-bottom: none;
}

.calculation-details p strong {
    color: #2c3e50;
    margin-right: 1rem;
}

footer {
    background: white;
    text-align: center;
    padding: 1.5rem;
    margin-top: 2rem;
    color: #7f8c8d;
    font-size: 0.9rem;
}

.mentions-btn {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.mentions-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
    background: linear-gradient(135deg, #2980b9, #21618c);
}

.mentions-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
}

.error, .warning, .info, .success {
    padding: 1.25rem 1.5rem;
    border-radius: 10px;
    margin: 1rem 0;
    text-align: center;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
}

.error {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
}

.warning {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
}

.info {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
}

.success {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
}

.error::before {
    content: '❌';
    font-size: 1.2rem;
}

.warning::before {
    content: '⚠️';
    font-size: 1.2rem;
}

.info::before {
    content: 'ℹ️';
    font-size: 1.2rem;
}

.success::before {
    content: '✅';
    font-size: 1.2rem;
}

@media (max-width: 768px) {
    main {
        padding: 0.75rem;
    }

    .calculator-section,
    .results-section {
        padding: 1rem;
    }

    .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    img.logo {
        height: 45px !important;
        max-width: 130px !important;
    }

    header h1 {
        font-size: 1.3rem;
    }

    header p {
        font-size: 0.9rem;
    }

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

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

    .form-group label {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }

    .form-input {
        padding: 0.75rem;
        font-size: 0.9rem;
        width: 100%;
        box-sizing: border-box;
    }

    .result-amount {
        font-size: 1.6rem;
    }

    .result-card {
        padding: 1.25rem;
    }

    .result-card h3 {
        font-size: 1rem;
    }

    .calculation-details {
        padding: 1rem;
        font-size: 0.9rem;
    }

    .calculation-details p {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
        font-size: 0.85rem;
    }

    .calculation-details h3 {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    main {
        padding: 0.5rem;
    }

    .calculator-section,
    .results-section {
        padding: 0.75rem;
    }

    .header-content {
        padding: 0 0.75rem;
    }

    img.logo {
        height: 40px !important;
        max-width: 120px !important;
    }

    header h1 {
        font-size: 1.2rem;
    }

    header p {
        font-size: 0.85rem;
    }

    .form-input {
        padding: 0.6rem;
        font-size: 0.85rem;
        width: 100%;
        box-sizing: border-box;
    }

    .form-group label {
        font-size: 0.85rem;
    }

    .result-card {
        padding: 1rem;
    }

    .result-amount {
        font-size: 1.4rem;
    }

    .calculation-details {
        padding: 0.75rem;
    }

    .calculation-details p {
        font-size: 0.8rem;
        padding: 0.3rem 0;
    }

    /* Modal mobile responsive */
    .modal-content {
        width: 95%;
        max-height: 90vh;
    }

    .modal-header {
        padding: 1rem;
    }

    .modal-header h2 {
        font-size: 1.3rem;
    }

    .modal-close {
        width: 35px;
        height: 35px;
        font-size: 1.5rem;
    }

    .modal-body {
        padding: 1.5rem;
        max-height: calc(90vh - 80px);
    }

    .modal-body p {
        font-size: 0.9rem;
    }

    .modal-body h3 {
        font-size: 1.1rem;
    }
}

.form-input.error {
    border-color: #e74c3c;
    background: #fdf2f2;
    box-shadow: inset 0 2px 4px rgba(231, 76, 60, 0.1), 0 0 0 3px rgba(231, 76, 60, 0.1);
    color: #2c3e50;
}

.form-input.success {
    border-color: #27ae60;
    background: #f2fdf5;
    box-shadow: inset 0 2px 4px rgba(39, 174, 96, 0.1), 0 0 0 3px rgba(39, 174, 96, 0.1);
    color: #2c3e50;
}

.form-input.error::placeholder {
    color: #e74c3c;
    opacity: 0.7;
}

.form-input.success::placeholder {
    color: #27ae60;
    opacity: 0.7;
}

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

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 15px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
}

.modal-header {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: white;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: rotate(90deg);
}

.modal-body {
    padding: 2rem;
    overflow-y: auto;
    max-height: calc(80vh - 100px);
}

.modal-body p {
    margin-bottom: 1rem;
    line-height: 1.6;
    color: #2c3e50;
}

.modal-body h3 {
    color: #2c3e50;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-size: 1.2rem;
}

.modal-body ul {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.modal-body li {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

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

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