/* Font Setup */
@font-style {
    font-family: 'Speda';
    src: local('Speda'), url('https://cdn.jsdelivr.net/gh/Unikurd/fonts/speda/speda.ttf') format('truetype');
}

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

:root {
    --primary-color: #0d3b66;
    --accent-color: #c9a227;
    --danger-color: #b7094c;
    --dark-color: #1d2d44;
    --light-bg: #f8f9fa;
    --border-color: #0d3b66;
}

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

body {
    font-family: 'Speda', 'Noto Naskh Arabic', sans-serif;
    background-color: #dbe2ef;
    color: #1a1a1a;
    direction: rtl;
    line-height: 1.45;
    padding: 15px 0;
}

/* Fix plate numbers to align mixed English/Kurdish text properly */
.plate-number {
    direction: ltr;
    unicode-bidi: embed;
    display: inline-block;
    font-weight: bold;
}

/* Dashboard Controls */
.dashboard-container {
    width: 210mm;
    margin: 0 auto 15px auto;
}

.dashboard-card {
    background: #ffffff;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-right: 5px solid var(--primary-color);
}

.dashboard-card h2 {
    color: var(--primary-color);
    font-size: 1.1rem;
    margin-bottom: 4px;
}

.dash-buttons {
    display: flex;
    gap: 8px;
    margin: 10px 0;
}

.dash-btn {
    padding: 8px 14px;
    border: 1px solid var(--primary-color);
    background: #fff;
    color: var(--primary-color);
    border-radius: 5px;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: bold;
    cursor: pointer;
}

.dash-btn.active, .dash-btn:hover {
    background: var(--primary-color);
    color: #fff;
}

.print-btn {
    background: #2b9348 !important;
    color: #fff !important;
    border-color: #2b9348 !important;
    margin-right: auto;
}

.input-form-grid {
    background: #f1f5f9;
    padding: 12px;
    border-radius: 6px;
    margin-top: 10px;
}

.input-form-grid h3 {
    font-size: 0.9rem;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.form-group {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 140px;
}

.form-group label {
    font-size: 0.8rem;
    font-weight: bold;
    margin-bottom: 3px;
}

.form-group input, .form-group select {
    padding: 6px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.85rem;
}

/* A4 Page Layout */
.a4-page {
    background: #ffffff;
    width: 210mm;
    min-height: 297mm;
    margin: 0 auto 20px auto;
    padding: 8mm;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    box-sizing: border-box;
}

/* Double Outer Frame */
.page-border-frame {
    border: 2px double var(--border-color);
    min-height: 280mm;
    width: 100%;
    padding: 8mm 10mm;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
}

.warning-frame {
    border-color: var(--danger-color) !important;
}

.watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-35deg);
    font-size: 4.5rem;
    font-weight: 900;
    color: rgba(13, 59, 102, 0.04);
    pointer-events: none;
    z-index: 1;
}

/* Header Styling */
.doc-header {
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 2;
}

.header-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo {
    width: 55px;
    height: 55px;
    object-fit: contain;
}

.brand-title h2 {
    font-size: 1.1rem;
    color: var(--primary-color);
    font-weight: 700;
}

.brand-title p {
    font-size: 0.68rem;
    color: #666;
}

.header-left {
    font-size: 0.75rem;
    border-right: 2.5px solid var(--accent-color);
    padding-right: 8px;
}

/* HEADER BANNER */
.header-banner {
    background: linear-gradient(135deg, var(--primary-color), #1d4e89);
    color: #ffffff;
    text-align: center;
    padding: 6px 12px;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(13, 59, 102, 0.15);
}

.alert-banner {
    background: linear-gradient(135deg, var(--danger-color), #800f2f) !important;
}

.banner-title {
    font-size: 0.88rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.warning-badge-icon {
    background: #ffffff;
    color: var(--danger-color);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.8rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.divider {
    border: none;
    height: 1.5px;
    background: var(--primary-color);
    margin: 8px 0;
}

.alert-divider {
    background: var(--danger-color) !important;
}

/* Body Content */
.recipient-section {
    background: var(--light-bg);
    padding: 6px 10px;
    border-right: 3px solid var(--primary-color);
    font-size: 0.78rem;
    margin-bottom: 5px;
}

.alert-recipient {
    border-right-color: var(--danger-color) !important;
    background: #fff0f3 !important;
}

.salutation {
    font-size: 0.82rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.intro-p {
    font-size: 0.76rem;
    margin-bottom: 6px;
    text-align: justify;
}

.bold-text {
    font-size: 0.8rem;
    line-height: 1.5;
}

.notice-block {
    margin-bottom: 6px;
    font-size: 0.74rem;
}

.notice-block h3 {
    font-size: 0.8rem;
    color: var(--primary-color);
    margin-bottom: 2px;
}

.notice-block ul, .notice-block ol {
    padding-right: 14px;
}

.notice-block li {
    margin-bottom: 1.5px;
}

.alert-border {
    border-right: 3px solid var(--danger-color);
    background: #fff0f3;
    padding: 6px 8px;
}

.alert-border h3 {
    color: var(--danger-color);
}

.highlight-block {
    background: #fff9e6;
    border: 1px solid #ffe399;
    padding: 6px 8px;
    border-radius: 4px;
}

.alert-highlight {
    background: #fff0f3 !important;
    border-color: #ffccd5 !important;
}

.alert-highlight h3 {
    color: var(--danger-color) !important;
}

.warning-grid {
    display: flex;
    gap: 8px;
    margin-top: 6px;
}

.warning-box {
    flex: 1;
    border: 1px solid #ffccd5;
    background: #ffffff;
    padding: 6px;
    border-radius: 4px;
}

.warning-box h4 {
    color: var(--danger-color);
    font-size: 0.78rem;
    margin-bottom: 2px;
}

.note-box {
    margin-top: 5px;
    background: #eef4f8;
    padding: 5px 8px;
    font-size: 0.72rem;
    border-radius: 4px;
}

.alert-note {
    background: #fff0f3 !important;
    border: 1px solid #ffccd5;
    color: var(--danger-color);
}

/* Contract & Form Styling */
.contract-title {
    font-size: 0.95rem;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.contract-intro {
    font-size: 0.78rem;
    margin-bottom: 8px;
}

.contract-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.contract-card {
    border: 1px solid #d8e2dc;
    padding: 7px 10px;
    border-radius: 5px;
    font-size: 0.76rem;
    background: #fafafa;
}

.contract-card h4 {
    color: var(--primary-color);
    font-size: 0.82rem;
    margin-bottom: 3px;
}

.form-acknowledgement {
    border: 1.5px dashed var(--primary-color);
    padding: 8px 12px;
    background: #ffffff;
    margin-top: 8px;
    border-radius: 5px;
}

.form-acknowledgement h3 {
    font-size: 0.82rem;
    color: var(--primary-color);
    margin-bottom: 4px;
}

.sig-grid {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    font-size: 0.76rem;
}

.sig-box {
    width: 48%;
}

.sig-box p {
    margin-bottom: 3px;
}

.text-center {
    text-align: center;
}

.doc-footer {
    margin-top: 6px;
    display: flex;
    justify-content: flex-end;
}

.signature-block {
    text-align: center;
    width: 170px;
    font-size: 0.75rem;
}

.title {
    font-weight: bold;
    color: var(--primary-color);
}

.stamp-placeholder {
    margin-top: 4px;
    border: 1px dashed #bbb;
    height: 45px;
    width: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #aaa;
    font-size: 0.62rem;
    margin-left: auto;
    margin-right: auto;
}

.alert-stamp {
    border-color: var(--danger-color) !important;
    color: var(--danger-color) !important;
}

/* Strict Single-Page Printing */
@media print {
    @page {
        size: A4 portrait;
        margin: 0;
    }

    body {
        background: #ffffff !important;
        padding: 0 !important;
        margin: 0 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .no-print {
        display: none !important;
    }

    .a4-page {
        width: 210mm !important;
        height: 297mm !important;
        padding: 5mm !important;
        margin: 0 !important;
        box-shadow: none !important;
        box-sizing: border-box !important;
    }

    .a4-page[style*="display: none"] {
        display: none !important;
    }

    .page-border-frame {
        border: 2px solid var(--primary-color) !important;
        height: 287mm !important;
    }

    .warning-frame {
        border-color: var(--danger-color) !important;
    }
}

/* واتەرمارکی وێنەیی (کەوتۆتە پشتی هەموو دەقەکان) */
.watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 380px; /* قەبارەی لۆگۆکە لە ناوەڕاستی لاپەڕە */
    height: auto;
    opacity: 0.08; /* ڕێژەی ڕووناکی / کاڵیی لۆگۆکە (دەتوانیت زیاتر یان کەمتری بکەیت) */
    pointer-events: none;
    user-select: none;
    z-index: 1;
}

.watermark img {
    width: 100%;
    height: auto;
    display: block;
}