/* ===========================
   RESET & BASE
   =========================== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: #0d6efd;
    text-decoration: none;
}

a:hover {
    color: #0a58ca;
    text-decoration: underline;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
}

/* ===========================
   LAYOUT
   =========================== */
.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

.main-content {
    flex: 1;
}

/* ===========================
   HEADER
   =========================== */
.site-header {
    background: #fff;
    border-bottom: 2px solid #e9ecef;
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.logo {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1a5f2a;
    text-decoration: none;
}

.logo:hover {
    color: #c1272d;
    text-decoration: none;
}

.main-nav ul {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.main-nav a {
    display: block;
    padding: 6px 14px;
    border-radius: 6px;
    color: #495057;
    font-size: 0.95rem;
    font-weight: 500;
    transition: background 0.2s, color 0.2s;
}

.main-nav a:hover {
    background: #e9ecef;
    color: #1a5f2a;
    text-decoration: none;
}

/* ===========================
   HERO SECTION
   =========================== */
.hero {
    background: linear-gradient(135deg, #1a5f2a 0%, #2d8f45 50%, #c1272d 100%);
    color: #fff;
    padding: 60px 0 50px;
    text-align: center;
}

.hero h1 {
    font-size: 2.2rem;
    margin-bottom: 15px;
    line-height: 1.3;
}

.hero-subtitle {
    font-size: 1.15rem;
    opacity: 0.92;
    max-width: 650px;
    margin: 0 auto;
}

/* ===========================
   CARDS GRID
   =========================== */
.calculators-section {
    padding: 50px 0;
}

.calculators-section h2 {
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 30px;
    color: #1a5f2a;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

.card {
    display: block;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 30px 25px;
    text-decoration: none;
    color: #333;
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    text-decoration: none;
}

.card-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.card h3 {
    font-size: 1.25rem;
    margin-bottom: 10px;
    color: #1a5f2a;
}

.card p {
    font-size: 0.95rem;
    color: #6c757d;
    margin-bottom: 15px;
}

.card-link {
    display: inline-block;
    color: #0d6efd;
    font-weight: 600;
    font-size: 0.95rem;
}

/* ===========================
   PAGE SECTIONS
   =========================== */
.page-section {
    padding: 40px 0 60px;
}

.page-section h1 {
    font-size: 2rem;
    color: #1a5f2a;
    margin-bottom: 15px;
}

.page-intro {
    font-size: 1.1rem;
    color: #6c757d;
    margin-bottom: 30px;
    max-width: 700px;
}

/* ===========================
   CALCULATOR BOX
   =========================== */
.calculator-box,
.form-box {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 35px 30px;
    margin-bottom: 40px;
    max-width: 600px;
}

/* ===========================
   FORMS
   =========================== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: #333;
    font-size: 0.95rem;
}

.form-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ced4da;
    border-radius: 8px;
    font-size: 1rem;
    color: #333;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: #1a5f2a;
    box-shadow: 0 0 0 3px rgba(26, 95, 42, 0.15);
}

textarea.form-input {
    resize: vertical;
    min-height: 120px;
}

.field-help {
    display: block;
    margin-top: 4px;
    color: #6c757d;
    font-size: 0.82rem;
    line-height: 1.4;
}

.field-errors {
    margin-top: 5px;
}

.field-errors .error {
    display: block;
    color: #c1272d;
    font-size: 0.875rem;
}

.result-step {
    font-size: 1rem;
    font-weight: 700;
    color: #1a5f2a;
    margin: 22px 0 4px;
    padding-bottom: 4px;
    border-bottom: 1px solid #e9ecef;
}

.result-step-desc {
    color: #6c757d;
    font-size: 0.85rem;
    margin-bottom: 8px;
}

/* ===========================
   BUTTONS
   =========================== */
.btn {
    display: inline-block;
    padding: 12px 30px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: #1a5f2a;
    color: #fff;
}

.btn-primary:hover {
    background: #155023;
}

/* ===========================
   RESULT BOX
   =========================== */
.result-box {
    margin-top: 30px;
    padding: 25px;
    background: #f0faf3;
    border: 2px solid #1a5f2a;
    border-radius: 10px;
}

.result-box h2 {
    font-size: 1.3rem;
    color: #1a5f2a;
    margin-bottom: 15px;
}

.result-table {
    width: 100%;
    border-collapse: collapse;
}

.result-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #d4edda;
    font-size: 0.95rem;
}

.result-table tr:last-child td {
    border-bottom: none;
}

.result-value {
    text-align: right;
    font-weight: 600;
    white-space: nowrap;
}

.result-negative {
    color: #c1272d;
}

.result-highlight {
    background: #d4edda;
}

.result-highlight td {
    font-size: 1.05rem;
    padding: 14px 12px;
}

/* ===========================
   MESSAGES (Django messages)
   =========================== */
.messages-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 15px 20px 0;
}

.alert {
    padding: 14px 20px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 0.95rem;
    font-weight: 500;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* ===========================
   SEO & CONTENT BLOCKS
   =========================== */
.seo-section {
    padding: 50px 0;
    background: #fff;
}

.seo-section h2 {
    font-size: 1.5rem;
    color: #1a5f2a;
    margin-bottom: 15px;
}

.seo-section p {
    margin-bottom: 12px;
    color: #555;
    line-height: 1.7;
}

.seo-block {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #e9ecef;
}

.seo-block h2 {
    font-size: 1.4rem;
    color: #1a5f2a;
    margin-bottom: 12px;
}

.seo-block p {
    margin-bottom: 12px;
    color: #555;
    line-height: 1.7;
}

.seo-block ul {
    list-style: disc;
    padding-left: 25px;
    margin-bottom: 15px;
}

.seo-block li {
    margin-bottom: 6px;
    color: #555;
    line-height: 1.6;
}

.content-block {
    margin-bottom: 30px;
}

.content-block h2 {
    font-size: 1.4rem;
    color: #1a5f2a;
    margin-bottom: 10px;
}

.content-block p {
    margin-bottom: 10px;
    color: #555;
    line-height: 1.7;
}

.content-block ul {
    list-style: disc;
    padding-left: 25px;
    margin-bottom: 15px;
}

.content-block li {
    margin-bottom: 6px;
    color: #555;
    line-height: 1.6;
}

/* ===========================
   AD BANNERS (placeholder)
   =========================== */
.ad-banner {
    text-align: center;
    padding: 20px;
    margin: 20px auto;
    max-width: 728px;
    background: #f0f0f0;
    border: 1px dashed #ccc;
    border-radius: 8px;
    color: #999;
    font-size: 0.875rem;
}

/* ===========================
   FOOTER
   =========================== */
.site-footer {
    background: #1a1a2e;
    color: #ccc;
    padding: 40px 0 20px;
    margin-top: auto;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-section h3 {
    color: #fff;
    font-size: 1.1rem;
    margin-bottom: 12px;
}

.footer-section p {
    font-size: 0.9rem;
    line-height: 1.6;
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: 6px;
}

.footer-section a {
    color: #adb5bd;
    font-size: 0.9rem;
}

.footer-section a:hover {
    color: #fff;
}

.footer-bottom {
    border-top: 1px solid #2a2a4a;
    padding-top: 20px;
    text-align: center;
    font-size: 0.85rem;
    color: #888;
}

/* ===========================
   RESPONSIVE
   =========================== */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 1.6rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .header-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .main-nav ul {
        gap: 4px;
    }

    .main-nav a {
        padding: 5px 10px;
        font-size: 0.875rem;
    }

    .calculator-box,
    .form-box {
        padding: 20px 15px;
    }

    .cards-grid {
        grid-template-columns: 1fr;
    }

    .result-table td {
        font-size: 0.875rem;
        padding: 8px 6px;
    }

    .page-section h1 {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 40px 0 30px;
    }

    .hero h1 {
        font-size: 1.3rem;
    }

    .btn {
        width: 100%;
        text-align: center;
    }
}
