@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800&display=swap');

:root {
    --primary: #0f766e;
    --primary-dark: #115e59;
    --primary-soft: #f0fdfa;
    --whatsapp: #25D366;
    --bg: #f1f5f9;
    --card: #ffffff;
    --text: #0f172a;
    --muted: #64748b;
    --border: #cbd5e1;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Cairo', sans-serif;
}

body {
    background: var(--bg);
    color: var(--text);
    direction: rtl;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.top-header {
    background: var(--card);
    border-bottom: 1px solid #e2e8f0;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text);
}

.main-wrapper {
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 26px 14px 48px;
}

.print-card {
    background: var(--card);
    width: 100%;
    max-width: 660px;
    border-radius: 20px;
    padding: 30px 26px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.07);
    border: 1px solid #e2e8f0;
}

.card-header {
    text-align: center;
    margin-bottom: 24px;
}

.card-header h1 {
    font-size: 1.55rem;
    font-weight: 800;
    margin-bottom: 6px;
}

.card-header p {
    color: var(--muted);
    font-size: 0.92rem;
}

.field-block {
    margin-bottom: 22px;
}

.field-label {
    display: block;
    font-weight: 800;
    font-size: 0.98rem;
    margin-bottom: 10px;
}

/* منطقة رفع الملفات */
.upload-zone {
    border: 2px dashed var(--border);
    border-radius: 14px;
    padding: 22px 16px;
    text-align: center;
    background: #f8fafc;
    cursor: pointer;
    transition: all 0.2s;
}

.upload-zone:hover {
    border-color: var(--primary);
    background: var(--primary-soft);
}

.add-more-btn {
    width: 100%;
    margin-top: 10px;
    padding: 11px 16px;
    border-radius: 12px;
    border: 2px dashed var(--primary);
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 0.94rem;
    font-weight: 800;
    cursor: pointer;
    transition: 0.2s;
}

.add-more-btn:hover {
    background: #ccfbf1;
}

/* بطاقة إعدادات كل مرفق على حدة */
.attachment-item-card {
    border: 1.5px solid #cbd5e1;
    border-right: 5px solid var(--primary);
    border-radius: 14px;
    padding: 14px 16px;
    background: #ffffff;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03);
}

.att-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
    padding-bottom: 10px;
    margin-bottom: 12px;
    border-bottom: 1px dashed #e2e8f0;
}

.att-file-title {
    font-weight: 800;
    font-size: 0.94rem;
    color: var(--text);
    word-break: break-all;
}

.att-badges {
    display: flex;
    align-items: center;
    gap: 6px;
}

.pages-badge {
    background: #f1f5f9;
    color: #334155;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
}

.item-price-badge {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #6ee7b7;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 800;
}

.remove-att-btn {
    border: none;
    background: #fee2e2;
    color: #b91c1c;
    padding: 4px 9px;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 800;
    cursor: pointer;
}

.att-controls-grid {
    display: grid;
    gap: 10px;
}

.att-control-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.att-row-label {
    font-size: 0.86rem;
    font-weight: 700;
    color: #334155;
    min-width: 82px;
}

.mini-pills {
    display: flex;
    gap: 6px;
    flex: 1;
}

.mini-pill {
    flex: 1;
    padding: 7px 10px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
    font-size: 0.84rem;
    font-weight: 700;
    text-align: center;
    cursor: pointer;
    transition: 0.15s;
}

.mini-pill.active {
    border-color: var(--primary);
    background: var(--primary-soft);
    color: var(--primary);
}

/* عداد النسخ داخل البطاقة */
.mini-copies {
    display: inline-flex;
    align-items: center;
    border: 1.5px solid #cbd5e1;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}

.mini-copies button {
    width: 34px;
    height: 34px;
    border: none;
    background: #f1f5f9;
    font-size: 1.1rem;
    font-weight: 800;
    cursor: pointer;
}

.mini-copies input {
    width: 54px;
    height: 34px;
    border: none;
    text-align: center;
    font-size: 0.95rem;
    font-weight: 800;
    outline: none;
}

/* خيارات موعد التوصيل */
.choice-option input {
    display: none;
}

.choice-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.93rem;
    cursor: pointer;
    transition: 0.2s;
    background: #fff;
}

.choice-option input:checked + .choice-box {
    border-color: var(--primary);
    background: var(--primary-soft);
    color: var(--primary);
}

/* الحقول النصية وموقع التسليم */
.text-input {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 0.95rem;
    outline: none;
    transition: 0.2s;
}

.text-input:focus {
    border-color: var(--primary);
}

.location-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.location-row .text-input {
    flex: 1;
    min-width: 200px;
}

.gps-btn {
    padding: 10px 14px;
    border-radius: 12px;
    border: 2px solid var(--primary);
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    white-space: nowrap;
}

.submit-btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 12px;
    background: var(--primary);
    color: #fff;
    font-size: 1.05rem;
    font-weight: 800;
    cursor: pointer;
    transition: 0.2s;
    margin-top: 6px;
}

.submit-btn:hover {
    background: var(--primary-dark);
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.wa-note {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
    font-size: 0.88rem;
    color: var(--muted);
}

.wa-note a {
    color: #15803d;
    font-weight: 800;
    text-decoration: none;
}

.success-box {
    display: none;
    text-align: center;
    padding: 20px 10px;
}

@media (max-width: 520px) {
    .print-card { padding: 22px 16px; }
    .mini-pills { flex-basis: 100%; }
}
