/* ============================================================
   Backtest Page Styles
   تم آبی/طلایی (هماهنگ با صفحات اصلی)
   ============================================================ */

   *, ::after, ::before {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* پالت اصلی - هماهنگ با index.css */
    --primary: #0a2b5c;
    --primary-light: #1a4a8a;
    --primary-dark: #061a3a;
    --secondary: #e8a838;
    --secondary-light: #f5c95a;
    
    /* رنگ‌های تاکیدی */
    --accent-green: #22a67e;
    --accent-red: #dc3545;
    --accent-blue: #2d7fc1;
    --accent-yellow: #e8b82a;
    
    /* متن و پس‌زمینه */
    --text-dark: #1a1a2e;
    --text-light: #f0f4f8;
    --text-muted: #7a8a9e;
    --bg-light: #eef2f7;
    --bg-card: #ffffff;
    
    /* سایه و گوشه */
    --shadow: 0 12px 40px rgba(10, 43, 92, 0.12);
    --shadow-hover: 0 20px 60px rgba(10, 43, 92, 0.20);
    --radius: 16px;
    --radius-sm: 10px;
    --transition: 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@font-face {
    font-family: Vazir;
    font-style: normal;
    font-weight: 400;
    src: url(../fonts/vazir.woff2) format('woff2');
    font-display: swap;
}

@font-face {
    font-family: Vazir;
    font-style: normal;
    font-weight: 700;
    src: url(../fonts/vazir-bold.woff) format('woff');
    font-display: swap;
}

@font-face {
    font-family: Yekan;
    font-style: normal;
    font-weight: 400;
    src: url(../fonts/yekan.woff) format('woff');
    font-display: swap;
}

@font-face {
    font-family: FontAwesome;
    font-style: normal;
    font-weight: 400;
    src: url(../fonts/fontawesome-webfont.woff2) format('woff2');
    font-display: swap;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: Vazir, Yekan, sans-serif;
    background: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.8;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    position: relative;
}

#neural-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
    opacity: 0.35;
    background: var(--bg-light);
}

.content-wrapper {
    position: relative;
    z-index: 1;
}

/* ============================================================
   FontAwesome Icons
   ============================================================ */
.fa {
    display: inline-block;
    font: normal normal normal 14px/1 FontAwesome;
    font-size: inherit;
    text-rendering: auto;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.fa-copy::before { content: "\f0c5"; }
.fa-paste::before { content: "\f0ea"; }
.fa-check-circle::before { content: "\f058"; }
.fa-chevron-left::before { content: "\f053"; }
.fa-chevron-circle-left::before { content: "\f137"; }
.fa-bar-chart::before { content: "\f080"; }
.fa-check::before { content: "\f00c"; }
.fa-eye::before { content: "\f06e"; }
.fa-clock-o::before { content: "\f017"; }
.fa-shield::before { content: "\f132"; }
.fa-refresh::before { content: "\f021"; }
.fa-times-circle::before { content: "\f057"; }
.fa-spinner::before { content: "\f110"; }
.fa-play::before { content: "\f04b"; }
.fa-save::before { content: "\f0c7"; }
.fa-flask::before { content: "\f0c3"; }
.fa-line-chart::before { content: "\f201"; }
.fa-history::before { content: "\f1da"; }
.fa-percent::before { content: "\f295"; }
.fa-arrow-up::before { content: "\f062"; }
.fa-arrow-down::before { content: "\f063"; }
.fa-question-circle::before { content: "\f059"; }

.fa-spin {
    animation: fa-spin 2s infinite linear;
}

@keyframes fa-spin {
    0% { transform: rotate(0); }
    100% { transform: rotate(359deg); }
}

/* ============================================================
   Links
   ============================================================ */
a {
    color: var(--secondary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
    display: inline-block;
}

a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    right: 0;
    width: 0;
    height: 2px;
    background: var(--secondary);
    transition: var(--transition);
    border-radius: 2px;
}

a:hover::after {
    width: 100%;
    right: 0;
}

a:hover {
    color: var(--secondary-light);
}

a.btn {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

a.btn::after {
    display: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 36px;
    border: none;
    border-radius: 50px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    letter-spacing: 0.3px;
}

.btn-primary {
    background: var(--secondary);
    color: var(--primary-dark);
    box-shadow: 0 6px 24px rgba(232, 168, 56, 0.35);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 36px rgba(232, 168, 56, 0.45);
}

.btn-outline {
    background: 0 0;
    color: var(--text-light);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--secondary);
}

/* ============================================================
   Header (کوچک - بدون Hero)
   ============================================================ */
.page-header {
    background: linear-gradient(135deg, var(--primary-dark) 0, var(--primary) 50%, var(--primary-light) 100%);
    padding: 60px 0 70px;
    position: relative;
    overflow: hidden;
    text-align: center;
}

.page-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 80%;
    height: 200%;
    background: radial-gradient(ellipse, rgba(232, 168, 56, 0.08) 0, transparent 70%);
    pointer-events: none;
}

.page-header::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 60%;
    height: 150%;
    background: radial-gradient(ellipse, rgba(45, 127, 193, 0.06) 0, transparent 70%);
    pointer-events: none;
}

.page-header .container {
    position: relative;
    z-index: 2;
}

.page-header h1 {
    font-family: Yekan, Vazir, sans-serif;
    font-size: 38px;
    font-weight: 700;
    color: #fff;
    line-height: 1.3;
    margin-bottom: 12px;
}

.page-header h1 span {
    color: var(--secondary);
}

.page-header .subtitle {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 8px;
    font-weight: 300;
}

.page-header .tagline {
    font-size: 18px;
    color: var(--secondary-light);
    font-weight: 700;
    margin-bottom: 16px;
    font-family: Yekan, Vazir, sans-serif;
}

.page-header p {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.7);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.9;
}

/* ============================================================
   Banner Bar
   ============================================================ */
.banner-bar {
    background: var(--bg-card);
    padding: 24px 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    margin-top: -30px;
    position: relative;
    z-index: 3;
    border-radius: var(--radius);
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
    border-top: 4px solid var(--secondary);
}

.banner-content {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 0 40px;
}

.banner-icon {
    font-size: 42px;
    flex-shrink: 0;
    filter: drop-shadow(0 4px 8px rgba(232, 168, 56, 0.3));
}

.banner-text h3 {
    font-family: Yekan, Vazir, sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 4px;
}

.banner-text h3 span {
    color: var(--secondary);
}

.banner-text p {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.8;
    margin: 0;
}

/* ============================================================
   Section Base
   ============================================================ */
.section {
    padding: 60px 0;
    position: relative;
}

.section-header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 40px;
}

.section-header h2 {
    font-family: Yekan, Vazir, sans-serif;
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 10px;
}

.section-header h2 span {
    color: var(--secondary);
}

.section-header p {
    font-size: 15px;
    color: var(--text-muted);
    line-height: 1.9;
}

.section-header .badge {
    display: inline-block;
    background: rgba(232, 168, 56, 0.15);
    color: var(--secondary);
    padding: 4px 16px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 12px;
    letter-spacing: 0.5px;
}

.bg-light {
    background: var(--bg-light);
}

/* ============================================================
   Steps Grid (مراحل کار)
   ============================================================ */
.steps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.step-card {
    background: var(--bg-card);
    padding: 32px 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: center;
    transition: var(--transition);
    border-top: 4px solid transparent;
    position: relative;
}

.step-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-hover);
}

.step-card.step-1 { border-top-color: var(--accent-blue); }
.step-card.step-2 { border-top-color: var(--secondary); }
.step-card.step-3 { border-top-color: var(--accent-green); }

.step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-family: Yekan, Vazir, sans-serif;
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 14px;
    box-shadow: 0 4px 12px rgba(10, 43, 92, 0.25);
}

.step-card.step-1 .step-num { background: var(--accent-blue); }
.step-card.step-2 .step-num { background: var(--secondary); }
.step-card.step-3 .step-num { background: var(--accent-green); }

.step-card h4 {
    font-family: Yekan, Vazir, sans-serif;
    font-size: 17px;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 8px;
}

.step-card p {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.8;
}

/* ============================================================
   IDE Editor (شبیه‌ساز)
   ============================================================ */
.ide-container {
    max-width: 1000px;
    margin: 0 auto;
}

.ide-box {
    background: #ffffff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    direction: ltr;
    transition: var(--transition);
}

.ide-box:hover {
    box-shadow: var(--shadow-hover);
}

/* ===== هدر IDE ===== */
.ide-header {
    background: #eef1f5;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #dfe3e8;
    user-select: none;
    gap: 12px;
    flex-wrap: wrap;
}

.ide-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.ide-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.ide-dot.red { background: #ff5f56; }
.ide-dot.yellow { background: #ffbd2e; }
.ide-dot.green { background: #27c93f; }

.ide-title {
    color: #555;
    font-size: 12px;
    margin-right: 10px;
    font-weight: 500;
    font-family: 'Consolas', monospace;
}

.ide-header-center {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    justify-content: right;
}

/* ===== Dropdown بازه زمانی ===== */
.period-select {
    background: #ffffff;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    padding: 6px 12px;
    font-family: Vazir, 'Consolas', monospace;
    font-size: 12px;
    color: #333;
    cursor: pointer;
    outline: none;
    transition: var(--transition);
    direction: rtl;
    min-width: 140px;
}

.period-select:hover {
    border-color: var(--primary-light);
    background: #f8fafc;
}

.period-select:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(26, 74, 138, 0.1);
}

/* ===== دکمه‌های هدر (Copy/Paste) ===== */
.ide-btn {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: #ffffff;
    border: 1px solid #d0d7de;
    color: #666;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    transition: all 0.25s ease;
    padding: 0;
    outline: none;
    font-family: inherit;
    flex-shrink: 0;
}

.ide-btn:hover {
    background: #f0f7ff;
    border-color: var(--primary-light);
    color: var(--primary-light);
    transform: translateY(-1px);
}

.ide-btn:active {
    transform: translateY(0);
}

.ide-btn.copied {
    background: #e8f5e9;
    border-color: var(--accent-green);
    color: var(--accent-green);
}

.ide-btn.pasted {
    background: #e3f2fd;
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

.ide-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.ide-lang-badge {
    color: #1a5c47;
    font-size: 11px;
    background: #ffffff;
    padding: 3px 10px;
    border-radius: 4px;
    border: 1px solid #d0d7de;
    font-family: 'Consolas', monospace;
    white-space: nowrap;
}

/* ===== بدنه IDE ===== */
.ide-body {
    display: flex;
    position: relative;
    background: #ffffff;
    min-height: 300px;
    max-height: 500px;
    overflow: hidden;
}

.ide-line-numbers {
    background: #f0f2f5;
    color: #9ca3af;
    padding: 15px 10px;
    text-align: right;
    font-size: 13px;
    line-height: 1.7;
    user-select: none;
    min-width: 42px;
    border-right: 1px solid #e2e6eb;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    white-space: pre;
    flex-shrink: 0;
    overflow: hidden;
}

.ide-textarea {
    flex: 1;
    background: #ffffff;
    border: none;
    color: #1e1e1e;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.7;
    padding: 15px 18px;
    resize: none;
    outline: none;
    direction: ltr;
    text-align: left;
    white-space: pre;
    overflow-wrap: normal;
    overflow-x: auto;
    overflow-y: auto;
    tab-size: 4;
    caret-color: var(--primary-light);
}

.ide-textarea::placeholder {
    color: #b0b8c0;
}

.ide-textarea::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.ide-textarea::-webkit-scrollbar-track {
    background: #f0f2f5;
}

.ide-textarea::-webkit-scrollbar-thumb {
    background: #c5cbd3;
    border-radius: 4px;
}

.ide-textarea::-webkit-scrollbar-thumb:hover {
    background: #a8b0ba;
}

/* ===== دکمه‌های شناور (Save / Run) ===== */
.ide-float-btn {
    position: absolute;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    z-index: 10;
    outline: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.ide-float-btn svg {
    width: 20px;
    height: 20px;
    fill: #fff;
}

.ide-save-btn {
    bottom: 20px;
    right: 90px;
    width: 42px;
    height: 42px;
    background: linear-gradient(145deg, #3498db, #2980b9);
}

.ide-save-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.6);
}

.ide-save-btn:active {
    transform: scale(0.95);
}

.ide-run-btn {
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    background: linear-gradient(145deg, #2ecc71, #27ae60);
}

.ide-run-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(46, 204, 113, 0.6);
}

.ide-run-btn:active {
    transform: scale(0.95);
}

.ide-run-btn svg {
    width: 24px;
    height: 24px;
    margin-left: 2px;
}

/* ===== فوتر IDE ===== */
.ide-footer {
    background: var(--primary);
    padding: 5px 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    color: #fff;
    font-family: Vazir, 'Segoe UI', Tahoma, sans-serif;
    direction: rtl;
}

.ide-footer-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.ide-footer-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.ide-status-icon {
    font-size: 12px;
    color: var(--accent-green);
}

/* ============================================================
   Result Panel (پنل نتیجه)
   ============================================================ */
.result-panel {
    max-width: 1000px;
    margin: 30px auto 0;
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
}

.result-panel-header {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #fff;
}

.result-panel-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.result-panel-icon {
    font-size: 18px;
}

.result-panel-title {
    font-family: Yekan, Vazir, sans-serif;
    font-size: 15px;
    font-weight: 700;
}

.result-panel-body {
    padding: 0;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fafbfc;
    position: relative;
}

.result-placeholder {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.result-placeholder-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 12px;
    opacity: 0.4;
}

.result-placeholder-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-dark);
}

.result-placeholder-text {
    font-size: 13px;
    color: var(--text-muted);
}

.result-content {
    width: 100%;
    padding: 24px;
    animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================================
   Benefits Grid
   ============================================================ */
.scenario-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}

.scenario-card {
    background: var(--bg-card);
    padding: 32px 28px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
    border-bottom: 4px solid transparent;
    text-align: center;
}

.scenario-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-hover);
}

.scenario-card .scenario-icon {
    font-size: 40px;
    display: block;
    margin-bottom: 8px;
}

.scenario-card h4 {
    font-family: Yekan, Vazir, sans-serif;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
}

.scenario-card p {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.9;
}

.scenario-card .scenario-tag {
    display: inline-block;
    padding: 2px 14px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 12px;
}

.scenario-card.conservative { border-bottom-color: var(--accent-green); }
.scenario-card.conservative .scenario-tag {
    background: rgba(34, 166, 126, 0.15);
    color: var(--accent-green);
}

.scenario-card.balanced { border-bottom-color: var(--secondary); }
.scenario-card.balanced .scenario-tag {
    background: rgba(232, 168, 56, 0.15);
    color: var(--secondary);
}

.scenario-card.active { border-bottom-color: var(--accent-blue); }
.scenario-card.active .scenario-tag {
    background: rgba(45, 127, 193, 0.15);
    color: var(--accent-blue);
}

/* ============================================================
   CTA Section
   ============================================================ */
.cta-section {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-light));
    padding: 70px 0;
    text-align: center;
    color: #fff;
}

.cta-section h2 {
    font-family: Yekan, Vazir, sans-serif;
    font-size: 34px;
    font-weight: 700;
    margin-bottom: 12px;
}

.cta-section h2 span {
    color: var(--secondary);
}

.cta-section p {
    font-size: 17px;
    color: rgba(255, 255, 255, 0.7);
    max-width: 600px;
    margin: 0 auto 32px;
}

.cta-section .btn-group {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ============================================================
   Footer
   ============================================================ */
.footer {
    background: var(--primary-dark);
    padding: 32px 0;
    text-align: center;
    color: rgba(255, 255, 255, 0.4);
    font-size: 13px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* ============================================================
   Modal (احراز هویت)
   ============================================================ */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.modal-overlay.active {
    display: flex;
}

.modal-box {
    background: #fff;
    max-width: 480px;
    width: 90%;
    padding: 32px 28px;
    border-radius: var(--radius);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
    position: relative;
    animation: slideUp 0.35s ease;
    max-height: 90vh;
    overflow-y: auto;
    direction: rtl;
}

.modal-box .modal-close {
    position: absolute;
    top: 12px;
    left: 18px;
    font-size: 28px;
    color: #aaa;
    cursor: pointer;
    transition: var(--transition);
    background: none;
    border: none;
    font-family: inherit;
}

.modal-box .modal-close:hover {
    color: var(--accent-red);
    transform: rotate(90deg);
}

.modal-box h3 {
    font-family: Yekan, Vazir, sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 6px;
    text-align: center;
}

.modal-box .modal-sub {
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 24px;
}

.modal-box .form-group {
    margin-bottom: 18px;
}

.modal-box .form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 5px;
}

.modal-box .form-group input {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #e2e8f0;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-family: inherit;
    transition: var(--transition);
    background: #fafbfc;
    text-align: right;
    direction: rtl;
}

.modal-box .form-group input:focus {
    outline: 0;
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(232, 168, 56, 0.15);
}

.modal-box .captcha-row {
    display: flex;
    gap: 12px;
    align-items: center;
}

.modal-box .captcha-row .captcha-img {
    flex-shrink: 0;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    width: 170px;
    height: 50px;
    background: silver;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-box .captcha-row .captcha-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.modal-box .captcha-row .captcha-refresh {
    background: none;
    border: none;
    color: var(--accent-blue);
    font-size: 20px;
    cursor: pointer;
    padding: 0 8px;
    transition: var(--transition);
}

.modal-box .captcha-row .captcha-refresh:hover {
    transform: rotate(60deg);
    color: var(--secondary);
}

.modal-box .captcha-row input {
    flex: 1;
}

.modal-box .btn-submit {
    width: 100%;
    padding: 14px;
    background: var(--secondary);
    color: var(--primary-dark);
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 6px 20px rgba(232, 168, 56, 0.3);
    margin-top: 8px;
}

.modal-box .btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(232, 168, 56, 0.4);
}

.modal-box .btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.modal-box .error-msg {
    color: var(--accent-red);
    font-size: 13px;
    margin-top: 6px;
    display: none;
}

.modal-box .error-msg.show {
    display: block;
}

.modal-box .form-note {
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
    margin-top: 16px;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1024px) {
    .steps-grid {
        grid-template-columns: 1fr 1fr;
    }
    .scenario-grid {
        grid-template-columns: 1fr 1fr;
    }
    .ide-header-center {
        order: 3;
        
        margin-top: 8px;
    }
}

@media (max-width: 640px) {
    .page-header {
        padding: 40px 0 50px;
    }
    .page-header h1 {
        font-size: 26px;
    }
    .page-header .tagline {
        font-size: 15px;
    }
    .page-header p {
        font-size: 13px;
    }
    .section {
        padding: 40px 0;
    }
    .section-header h2 {
        font-size: 24px;
    }
    .steps-grid {
        grid-template-columns: 1fr;
    }
    .scenario-grid {
        grid-template-columns: 1fr;
    }
    .banner-bar {
        margin-top: -20px;
        padding: 18px 0;
    }
    .banner-content {
        flex-direction: column;
        text-align: center;
        gap: 12px;
        padding: 0 20px;
    }
    .banner-icon {
        font-size: 32px;
    }
    .banner-text h3 {
        font-size: 16px;
    }
    .banner-text p {
        font-size: 12px;
    }
    .btn {
        padding: 12px 24px;
        font-size: 14px;
    }
    .container {
        padding: 0 16px;
    }

    /* IDE */
    .ide-header {
        padding: 8px 10px;
    }
    .ide-title {
        font-size: 11px;
        display: none;
    }
    .ide-body {
        min-height: 240px;
        max-height: 400px;
    }
    .ide-line-numbers {
        padding: 12px 6px;
        font-size: 12px;
        min-width: 32px;
    }
    .ide-textarea {
        padding: 12px 10px;
        font-size: 12px;
    }
    .ide-lang-badge {
        font-size: 10px;
        padding: 2px 6px;
    }
    .period-select {
        font-size: 11px;
        padding: 5px 8px;
        min-width: 110px;
    }
    .ide-btn {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
    .ide-float-btn {
        width: 40px;
        height: 40px;
    }
    .ide-save-btn {
        width: 36px;
        height: 36px;
        right: 70px;
        bottom: 15px;
    }
    .ide-run-btn {
        width: 48px;
        height: 48px;
        right: 15px;
        bottom: 15px;
    }
    .ide-run-btn svg {
        width: 20px;
        height: 20px;
    }
    .ide-save-btn svg {
        width: 16px;
        height: 16px;
    }

    .modal-box {
        padding: 24px 18px;
    }
    .modal-box .captcha-row {
        flex-wrap: wrap;
    }
    .modal-box .captcha-row .captcha-img {
        width: 100%;
        height: 52px;
    }
}

@media (max-width: 400px) {
    .page-header h1 {
        font-size: 22px;
    }
    .section-header h2 {
        font-size: 20px;
    }
}
/* ============================================================
   Auth Error Box + Retry Button
   ============================================================ */
   .auth-error-box {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-right: 4px solid var(--accent-red);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    animation: shakeError 0.4s ease-out;
}

.auth-error-icon {
    font-size: 20px;
    flex-shrink: 0;
    line-height: 1.4;
}

.auth-error-message {
    flex: 1;
    color: #991b1b;
    font-size: 13.5px;
    line-height: 1.8;
    font-weight: 500;
    direction: rtl;
    text-align: right;
    word-wrap: break-word;
}

.auth-retry-btn {
    width: 100%;
    padding: 12px 18px;
    background: #ffffff;
    color: var(--accent-blue);
    border: 2px solid var(--accent-blue);
    border-radius: 50px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 4px;
    margin-bottom: 8px;
}

.auth-retry-btn:hover {
    background: var(--accent-blue);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(45, 127, 193, 0.3);
}

.auth-retry-btn:active {
    transform: translateY(0);
}

@keyframes shakeError {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}