@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;500;600;700;800&display=swap');

:root {
    --accent: #4f46e5;
    --accent-dark: #4338ca;
    --accent-light: #ede9fe;
    --accent-mid: #8b5cf6;
    --success: #059669;
    --success-light: #d1fae5;
    --danger: #dc2626;
    --danger-light: #fee2e2;
    --warning: #d97706;
    --warning-light: #fef3c7;
    --ink: #0f1117;
    --ink-2: #3d4451;
    --ink-3: #6b7280;
    --ink-4: #9ca3af;
    --surface: #ffffff;
    --surface-2: #f8f9fb;
    --surface-3: #f1f2f5;
    --border: rgba(15, 17, 23, 0.08);
    --border-strong: rgba(15, 17, 23, 0.16);
    --radius: 8px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Vazirmatn', -apple-system, sans-serif;
    background: var(--surface-2);
    color: var(--ink);
    direction: rtl;
    line-height: 1.7;
    min-height: 100vh;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    border: 1px solid transparent;
    text-decoration: none;
    transition: all 0.15s;
    white-space: nowrap;
    line-height: 1;
}
.btn svg, .btn i { font-size: 15px; flex-shrink: 0; }
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-dark); transform: translateY(-1px); }
.btn-ghost { background: var(--surface); color: var(--ink-2); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--surface-3); }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #047857; }
.btn-danger { background: var(--surface); color: var(--danger); border-color: #fecaca; }
.btn-danger:hover { background: var(--danger-light); }
.btn-outline { background: var(--surface); color: var(--ink-2); border-color: var(--border-strong); }
.btn-outline:hover { background: var(--surface-3); }
.btn-sm { padding: 6px 13px; font-size: 13px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }
.btn-block { width: 100%; justify-content: center; }
.btn:disabled { opacity: 0.5; pointer-events: none; }
.btn-icon { width: 34px; height: 34px; padding: 0; justify-content: center; border-radius: var(--radius); }

/* ===== INPUTS ===== */
.form-input,
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="password"],
input[type="time"],
textarea,
select {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border-strong);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
    color: var(--ink);
    background: var(--surface);
    transition: all 0.15s;
    outline: none;
    line-height: 1.5;
}
input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="number"]:focus,
input[type="password"]:focus,
input[type="time"]:focus,
textarea:focus,
select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}
textarea { resize: vertical; min-height: 100px; }
select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 12px center;
    padding-left: 36px;
    cursor: pointer;
}
.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--ink-2);
    margin-bottom: 6px;
}
.required-star { color: var(--danger); }

/* ===== CARDS ===== */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

/* ===== BADGE ===== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
}
.badge-success { background: var(--success-light); color: var(--success); }
.badge-accent { background: var(--accent-light); color: var(--accent); }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-danger { background: var(--danger-light); color: var(--danger); }

/* ===== TOAST ===== */
.toast-container {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.toast {
    padding: 12px 18px;
    border-radius: var(--radius);
    background: var(--ink);
    color: white;
    font-size: 13px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    animation: slideInToast 0.25s ease;
    max-width: 300px;
}
.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
@keyframes slideInToast {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 56px 24px;
    background: var(--surface);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-lg);
}
.empty-icon {
    width: 56px; height: 56px;
    border-radius: 14px;
    background: var(--surface-3);
    display: flex; align-items: center; justify-content: center;
    font-size: 24px;
    margin: 0 auto 16px;
}
.empty-state h3 { font-size: 16px; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.empty-state p { font-size: 14px; color: var(--ink-3); margin-bottom: 20px; }
.empty-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ===== LOGO ===== */
.logo-wrap { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.logo-icon {
    width: 36px; height: 36px;
    background: var(--accent);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; color: white;
}
.logo-text { font-size: 17px; font-weight: 700; color: var(--ink); letter-spacing: -0.3px; }
.logo-text span { color: var(--accent); }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .btn { padding: 8px 14px; font-size: 13px; }
}
/* ========================================
   AI PAGE
======================================== */

.container{
    max-width:1100px;
    margin:0 auto;
    padding:24px;
}

.top-bar{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:16px;
    margin-bottom:40px;
}

.top-actions{
    display:flex;
    gap:8px;
    align-items:center;
}

.hero-section{
    text-align:center;
    padding:50px 20px;
    margin-bottom:24px;
}

.hero-badge{
    display:inline-flex;
    align-items:center;
    gap:8px;
    padding:8px 16px;
    border-radius:999px;
    background:var(--accent-light);
    color:var(--accent);
    font-size:13px;
    font-weight:600;
    margin-bottom:18px;
}

.hero-section h1{
    font-size:52px;
    font-weight:800;
    line-height:1.15;
    margin-bottom:14px;
    letter-spacing:-1px;
}

.hero-section h1 span{
    color:var(--accent);
}

.hero-section p{
    max-width:650px;
    margin:auto;
    color:var(--ink-3);
    font-size:17px;
}

/* ========================================
   GENERATOR
======================================== */

.generator-card{
    max-width:900px;
    margin:auto;
    padding:28px;
    border-radius:24px;
    box-shadow:0 15px 40px rgba(0,0,0,.06);
}

.generator-head{
    display:flex;
    align-items:flex-start;
    gap:16px;
    margin-bottom:20px;
}

.generator-icon{
    width:54px;
    height:54px;
    border-radius:16px;
    background:linear-gradient(
        135deg,
        var(--accent),
        var(--accent-mid)
    );
    color:white;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:24px;
    flex-shrink:0;
}

.generator-head h3{
    font-size:20px;
    margin-bottom:4px;
}

.generator-head p{
    color:var(--ink-3);
    font-size:14px;
}

.ai-textarea{
    min-height:160px !important;
    font-size:15px;
    padding:18px !important;
    border-radius:16px !important;
    resize:none;
    margin-bottom:20px;
}

.ai-textarea::placeholder{
    color:var(--ink-4);
}

.suggestions-title{
    font-size:13px;
    color:var(--ink-3);
    margin-bottom:12px;
    font-weight:600;
}

/* ========================================
   SUGGESTIONS
======================================== */

.examples-row{
    display:flex;
    flex-wrap:wrap;
    gap:10px;
    margin-bottom:20px;
}

.example-chip{
    border:none;
    background:white;
    border:1px solid var(--border);
    padding:11px 16px;
    border-radius:999px;
    cursor:pointer;
    font-family:inherit;
    font-size:13px;
    font-weight:500;
    transition:all .2s;
}

.example-chip:hover{
    background:var(--accent-light);
    border-color:var(--accent);
    color:var(--accent);
    transform:translateY(-2px);
}

/* ========================================
   LOADING
======================================== */

.loading-area{
    padding:30px;
}

.loading-box{
    background:white;
    border-radius:20px;
    padding:30px;
    text-align:center;
    box-shadow:var(--shadow);
}

.loading-spinner{
    width:42px;
    height:42px;
    border:4px solid #e5e7eb;
    border-top:4px solid var(--accent);
    border-radius:50%;
    margin:0 auto 16px;
    animation:spin 1s linear infinite;
}

@keyframes spin{
    to{
        transform:rotate(360deg);
    }
}

/* ========================================
   RESULT CARD
======================================== */

.result-card{
    margin-top:20px;
}

.card-header{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:10px;
    margin-bottom:20px;
}

.field-preview-row{
    display:flex;
    align-items:center;
    gap:12px;
    padding:12px 0;
    border-bottom:1px solid var(--border);
}

.field-icon{
    width:42px;
    height:42px;
    border-radius:12px;
    background:var(--surface-3);
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:18px;
}

.field-name{
    flex:1;
    font-weight:600;
}

.field-meta{
    color:var(--ink-4);
    font-size:13px;
}

.form-url-bar{
    margin-top:18px;
    background:var(--surface-2);
    border-radius:12px;
    padding:12px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    overflow:hidden;
}

.form-url-bar span{
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
    font-size:13px;
}

.result-actions{
    margin-top:16px;
    display:flex;
    gap:10px;
    flex-wrap:wrap;
}

/* ========================================
   MOBILE
======================================== */

@media (max-width:768px){

    .container{
        padding:14px;
    }

    .top-bar{
        flex-direction:column;
        align-items:stretch;
    }

    .top-actions{
        width:100%;
    }

    .top-actions .btn{
        flex:1;
        justify-content:center;
    }

    .hero-section{
        padding:24px 10px;
    }

    .hero-section h1{
        font-size:34px;
        line-height:1.2;
    }

    .hero-section p{
        font-size:15px;
    }

    .generator-card{
        padding:18px;
    }

    .generator-head{
        flex-direction:column;
        text-align:center;
        align-items:center;
    }

    .examples-row{
        display:grid;
        grid-template-columns:1fr 1fr;
    }

    .example-chip{
        width:100%;
        border-radius:14px;
    }

    .result-actions{
        flex-direction:column;
    }

    .result-actions .btn{
        width:100%;
        justify-content:center;
    }

    .form-url-bar{
        flex-direction:column;
        align-items:stretch;
    }

    .form-url-bar button{
        width:100%;
    }

    .toast-container{
        left:12px;
        right:12px;
        bottom:12px;
    }

    .toast{
        max-width:none;
    }
}

