:root {
    --primary-blue: #3b82f6;
    --primary-blue-hover: #2563eb;
    --light-blue: #eff6ff;
    --primary-green: #bef264;
    --primary-green-hover: #a3e635;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.02), 0 4px 12px rgba(0, 0, 0, 0.04);
}

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

body {
    font-family: 'Vazirmatn', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
}

/* Header */
header {
    background: var(--card-bg);
    padding: 18px 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 35px;
}
.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo-area img { height: 40px; }
.support-btn {
    background-color: #dcfce7;
    color: #166534;
    padding: 8px 16px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    transition: background-color 0.2s;
}
.support-btn:hover { background-color: #bbf7d0; }

/* Main Layout Grid - Fixed Desktop Alignment */
.main-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px 20px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px; /* Precise column control */
    gap: 30px;
    align-items: start;
}

.col-main, .col-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}

/* Page Title */
.page-title { margin-bottom: 10px; }
.page-title h1 {
    font-size: 1.8rem;
    font-weight: 900;
    margin-bottom: 6px;
}
.page-title p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Sidebar Image & Features */
.sidebar-img { display: flex; flex-direction: column; }
.course-banner {
    width: 100%;
    border-radius: 16px;
    object-fit: cover;
    margin-bottom: 15px;
}
.features-list {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-muted);
    padding: 10px 5px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 5px;
}
.features-list div { display: flex; align-items: center; gap: 6px; font-weight: 500;}
.features-list svg { color: var(--primary-blue); }

/* Cards */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
}
.card-title {
    font-size: 1.1rem;
    font-weight: 800;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-main);
}
.title-icon {
    width: 32px;
    height: 32px;
    background: var(--light-blue);
    color: var(--primary-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}
.title-icon svg { width: 18px; height: 18px; }

/* Forms - Fixed squishing/overflowing */
.form-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    width: 100%;
}
label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: #475569;
}
input[type="text"], input[type="tel"], input[type="email"] {
    width: 100%;
    max-width: 100%; /* Prevents horizontal overflow */
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    background-color: #fff;
    box-sizing: border-box;
}
input:focus { 
    outline: none; 
    border-color: var(--primary-blue); 
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Gateways */
.gateway-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}
.gateway-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: #fff;
}
.gateway-item:hover { border-color: #cbd5e1; }
.gateway-item.selected {
    border-color: var(--primary-blue);
    background-color: var(--light-blue);
}
.gateway-info {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}
.gateway-radio {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    margin-top: 2px;
    flex-shrink: 0;
}
.gateway-item.selected .gateway-radio { border-color: var(--primary-blue); }
.gateway-item.selected .gateway-radio::after {
    content: '';
    width: 10px;
    height: 10px;
    background: var(--primary-blue);
    border-radius: 50%;
}
.gateway-text { display: flex; flex-direction: column; gap: 4px; }
.gateway-text span:first-child { font-weight: 800; font-size: 0.95rem; color: var(--text-main); }
.gateway-subtitle { font-size: 0.75rem; color: var(--text-muted); line-height: 1.4; }
.gateway-logo { height: 35px; object-fit: contain; margin-right: 10px;}
.snapp-logo { font-weight: 900; color: #10b981; font-size: 1.1rem; padding-left: 5px; line-height: 1.1; text-align: center;}

/* Order Summary */
.summary-course {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 15px;
    margin-bottom: 15px;
    border-bottom: 1px dashed var(--border-color);
}
.summary-course img {
    width: 100px;
    border-radius: 8px;
    object-fit: cover;
}
.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 0.95rem;
    font-weight: 600;
}
.summary-item .muted { color: var(--text-muted); font-weight: 500; }
.summary-divider {
    height: 1px;
    background: var(--border-color);
    margin: 15px 0;
}
.summary-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.15rem;
    font-weight: 900;
}
.total-price { color: var(--primary-blue); }

/* Discount Box */
.discount-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 25px 0;
    gap: 15px;
}
.discount-label { font-size: 0.9rem; font-weight: 700; color: #475569; white-space: nowrap;}
.discount-input-group {
    display: flex;
    flex: 1;
    gap: 10px;
}
.discount-btn {
    background: var(--primary-green);
    color: #3f6212;
    border: none;
    padding: 0 20px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.2s;
}
.discount-btn:hover { background: var(--primary-green-hover); }

/* Submit Button */
.btn-submit {
    width: 100%;
    background: var(--primary-blue);
    color: white;
    border: none;
    padding: 16px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    transition: background-color 0.2s ease;
}
.btn-submit:hover { background: var(--primary-blue-hover); }
.btn-text-group { display: flex; flex-direction: column; align-items: flex-start; }
.btn-main-text { font-size: 1.1rem; font-weight: 800; }
.btn-sub-text { font-size: 0.75rem; font-weight: 400; opacity: 0.9; margin-top: 2px;}
.terms-text { text-align: center; font-size: 0.8rem; color: var(--text-muted); margin-top: 15px; }
.terms-text a { color: var(--primary-blue); text-decoration: none; font-weight: 600; }

/* Check List */
.check-list { list-style: none; }
.check-list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #334155;
}
.check-list li::before {
    content: '✓';
    color: var(--primary-blue);
    background: var(--light-blue);
    width: 20px;
    height: 20px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    flex-shrink: 0;
    margin-top: 3px;
    font-weight: bold;
}

/* Accordions */
.accordion {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    margin-bottom: 10px;
    overflow: hidden;
}
.accordion-header {
    padding: 14px;
    background: #f8fafc;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.85rem;
    color: #334155;
}
.module-info { display: flex; align-items: center; gap: 10px; }
.module-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}
.module-meta {
    font-size: 0.75rem;
    color: #475569;
    background: #e2e8f0;
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 600;
}
.accordion-content {
    padding: 15px;
    background: white;
    border-top: 1px solid var(--border-color);
    display: none;
}
.accordion.open .accordion-content { display: block; }
.module-duration {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 12px;
}
.lesson-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: #475569;
    padding: 10px 0;
    border-bottom: 1px dashed var(--border-color);
}
.lesson-item:last-child { border-bottom: none; padding-bottom: 0; }

/* Footer Wrapper */
.footer-wrapper { max-width: 1200px; margin: 0 auto; padding: 0 20px 20px; }
.footer-features {
    display: flex;
    justify-content: space-between;
    background: var(--light-blue);
    padding: 20px 25px;
    border-radius: 16px;
    margin-bottom: 20px;
}
.footer-feature {
    display: flex;
    align-items: center;
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--primary-blue);
    gap: 8px;
}
.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
    padding-top: 15px;
}

/* Mobile Responsiveness (Fixed order and constraints) */
@media (max-width: 992px) {
    .main-wrapper {
        display: flex;
        flex-direction: column;
        gap: 0; 
    }
    
    /* Magic trick to release cards from desktop columns for reordering */
    .col-main, .col-sidebar { 
        display: contents; 
    }
    
    /* Card order exactly matching mobile UI mockup */
    .page-title { order: 1; margin-bottom: 20px; text-align: center; }
    .sidebar-img { order: 2; margin-bottom: 20px;}
    .card-buyer { order: 3; margin-bottom: 20px; }
    .card-gateway { order: 4; margin-bottom: 20px; }
    .card-summary { order: 5; margin-bottom: 20px; }
    .card-who { order: 6; margin-bottom: 20px; }
    .card-syllabus { order: 7; margin-bottom: 20px; }
    .card-faq { order: 8; margin-bottom: 20px; }

    /* Force forms to stack 1 by 1 on mobile */
    .form-grid { 
        grid-template-columns: 1fr; 
    }
    
    .gateway-options { 
        grid-template-columns: 1fr; 
    }
    
    .discount-box { 
        flex-direction: column; 
        align-items: stretch; 
    }
    .discount-label { margin-bottom: 10px; }
    
    .footer-features {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
        padding: 20px;
    }
    .footer-bottom {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    .features-list { flex-wrap: wrap; gap: 10px; }
    .features-list div { width: 45%; }
}

.acc-arrow, .accordion-header > svg:last-child {
    transition: transform 0.3s ease;
}

.accordion.open .acc-arrow, 
.accordion.open .accordion-header > svg:last-child {
    transform: rotate(180deg);
}