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

body {
    font-family: 'Cairo', sans-serif;
    background: #F6F8F7;
    color: #2E3B33;
    line-height: 1.6;
}

header {
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.logo {
    font-size: 24px;
    font-weight: 800;
    color: #006C35;
}

.page-hero {
    padding: 50px 20px 30px;
    background: linear-gradient(135deg, #FFFFFF 0%, #F7F3EE 100%);
}

.page-hero-content {
    max-width: 1200px;
    margin: 0 auto;
}

.page-title {
    font-size: 32px;
    font-weight: 800;
    color: #0B3B23;
}

.page-subtitle {
    color: #5C6D64;
    font-size: 15px;
    margin-top: 8px;
    max-width: 820px;
}

.page-layout {
    max-width: 1000px;
    margin: 0 auto;
    padding: 30px 20px 80px;
}

.agreement-form {
    background: #fff;
    border-radius: 20px;
    padding: 28px;
    border: 1px solid rgba(197, 160, 89, 0.2);
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.08);
    display: grid;
    gap: 26px;
}

.form-section h2 {
    font-size: 20px;
    font-weight: 800;
    color: #0B3B23;
    margin-bottom: 6px;
}

.form-note {
    color: #5C6D64;
    font-size: 13px;
    margin-bottom: 14px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.form-field {
    display: grid;
    gap: 8px;
}

.form-field label {
    font-size: 14px;
    font-weight: 700;
    color: #2E3B33;
}

.form-field input,
.form-field textarea,
.form-field select {
    padding: 12px 14px;
    border: 1px solid #E0E0E0;
    border-radius: 12px;
    font-family: 'Cairo', sans-serif;
    font-size: 14px;
    background: #F8F9FA;
}

.phone-input {
    display: grid;
    grid-template-columns: minmax(120px, 1fr) 2fr;
    gap: 10px;
}

.phone-input select {
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, #6c757d 50%),
        linear-gradient(135deg, #6c757d 50%, transparent 50%);
    background-position: 12px 50%, 6px 50%;
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
    padding-left: 28px;
}

.form-field textarea {
    resize: vertical;
    min-height: 120px;
}

.loading-overlay {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    background: rgba(11, 59, 35, 0.2);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 2000;
}

.loading-overlay.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.loading-card {
    background: #fff;
    border-radius: 16px;
    padding: 18px 22px;
    display: grid;
    gap: 10px;
    align-items: center;
    justify-items: center;
    box-shadow: 0 16px 30px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(197, 160, 89, 0.25);
    font-weight: 700;
    color: #0B3B23;
}

.spinner {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: 3px solid rgba(11, 59, 35, 0.2);
    border-top-color: #0B3B23;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.payment-dropdown {
    position: relative;
}

.payment-trigger {
    width: 100%;
    border: 1px solid rgba(197, 160, 89, 0.35);
    background: linear-gradient(135deg, #ffffff 0%, #f7f5f0 100%);
    border-radius: 14px;
    padding: 14px 16px 14px 44px;
    font-family: 'Cairo', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: #2e3b33;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.06);
}

.payment-trigger:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(197, 160, 89, 0.25);
}

.payment-caret {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    color: #8a7c66;
    pointer-events: none;
}

.payment-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    left: 0;
    z-index: 20;
    padding: 12px;
    border-radius: 16px;
    background: #fff;
    border: 1px solid rgba(197, 160, 89, 0.35);
    box-shadow: 0 18px 30px rgba(0, 0, 0, 0.12);
    display: none;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.payment-menu.open {
    display: grid;
}

.payment-option {
    position: relative;
    display: grid;
    grid-template-columns: 40px 1fr;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border-radius: 14px;
    border: 1px solid #e6e2d8;
    background: #fff;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.payment-option img {
    width: 36px;
    height: 36px;
}

.payment-option span {
    font-size: 13px;
    font-weight: 700;
    color: #2e3b33;
}

.payment-option input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.payment-option:hover {
    transform: translateY(-2px);
    border-color: #c5a059;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
}

.payment-option input:checked ~ span {
    color: #0b3b23;
}

.payment-option input:checked ~ span::after {
    content: '✓';
    margin-right: 8px;
    color: #0b3b23;
    font-weight: 800;
}

.payment-option input:checked ~ img {
    transform: scale(1.05);
}

.value-box {
    padding: 12px 14px;
    border: 1px solid #E0E0E0;
    border-radius: 12px;
    font-size: 14px;
    background: #F8F9FA;
    color: #2E3B33;
    min-height: 46px;
}

.success-banner {
    background: #E6F7ED;
    color: #0B3B23;
    border: 1px solid #B7E2C8;
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-weight: 700;
}

.mou-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.mou-actions-menu {
    position: relative;
}

.icon-btn {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.mou-actions-dropdown {
    position: absolute;
    top: 52px;
    right: 0;
    min-width: 160px;
    background: #fff;
    border: 1px solid #E0E0E0;
    border-radius: 12px;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
    padding: 8px;
    display: none;
    z-index: 10;
}

.mou-actions-dropdown.open {
    display: grid;
    gap: 6px;
}

.dropdown-item {
    border: none;
    background: #F8F9FA;
    padding: 10px 12px;
    border-radius: 10px;
    font-family: 'Cairo', sans-serif;
    font-size: 14px;
    text-align: right;
    cursor: pointer;
}

.dropdown-item:hover {
    background: #E6F7ED;
}

.qr-box {
    display: grid;
    gap: 6px;
    text-align: center;
    padding: 10px;
    border: 1px dashed #C5A059;
    border-radius: 12px;
    background: #FDFBF7;
}

.qr-title {
    font-size: 12px;
    font-weight: 700;
    color: #5C6D64;
}

#mouQr canvas,
#mouQr img {
    display: block;
    margin: 0 auto;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.btn {
    border: none;
    border-radius: 999px;
    padding: 12px 26px;
    cursor: pointer;
    font-weight: 700;
    font-family: 'Cairo', sans-serif;
    text-decoration: none;
    text-align: center;
}

.btn-primary {
    background: #006C35;
    color: #fff;
}

.btn-secondary {
    background: #F1F4F2;
    color: #0B3B23;
}

.signature-preview {
    margin-top: 30px;
    background: #fff;
    border-radius: 18px;
    padding: 20px;
    border: 1px solid rgba(197, 160, 89, 0.2);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.06);
}

.signature-preview h2 {
    font-size: 18px;
    font-weight: 800;
    color: #0B3B23;
    margin-bottom: 16px;
}

.signature-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.signature-preview-card {
    border: 1px dashed #C5A059;
    border-radius: 12px;
    padding: 12px;
    background: #FDFBF7;
    text-align: center;
}

.signature-preview-title {
    font-size: 13px;
    font-weight: 700;
    color: #5C6D64;
    margin-bottom: 8px;
}

.signature-preview-card img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.pdf-page-break {
    break-before: page;
    page-break-before: always;
}

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

    .pdf-page-break {
        break-before: page;
        page-break-before: always;
    }
}

.sig-wrap {
    max-width: 520px;
}

.sig-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

.sig-box {
    border: 1px solid #d0d0d0;
    border-radius: 10px;
    background: #fff;
    width: 100%;
    height: 180px;
    overflow: hidden;
}

.sig-canvas {
    width: 100%;
    height: 100%;
    display: block;
    touch-action: none;
}

.sig-actions {
    margin-top: 10px;
    display: flex;
    gap: 10px;
}

.sig-actions button {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    background: #f7f7f7;
    cursor: pointer;
}

@media (max-width: 720px) {
    .agreement-form {
        padding: 20px;
    }
}
