* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: "Cairo", sans-serif;
}

:root {
    --color-primary: #2a6d9a;
    --color-accent: #ea376e;
    --color-primary-dark: #214c6c;
    --color-bg-soft: #f5f7fb;
}

.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background:  var(--color-primary);
}

.login-container {
    background-color: #ffffff;
    padding: 32px 28px;
    border-radius: 12px;
    width: 100%;
    max-width: 360px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
    
}
.card-login-header {
    display: flex;
    flex-direction: column;
    align-items: center;   /* 👈 ده المهم */
    text-align: center;
    
}

.login-title {
    font-size: 24px;
    margin-bottom: 4px;
    color: var(--color-primary);
    text-align: center;
}

.login-subtitle {
    font-size: 14px;
    margin-bottom: 24px;
    color: #4a4a4a;
    text-align: center;
}

.form-group {
    display: flex;
    flex-direction: column;
    text-align: right;
    margin-bottom: 16px;
}

label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    color: #333333;
}

.input {
    width: 100%;
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid #c5d4e2;
    font-size: 14px;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(42, 109, 154, 0.25);
}

.login-button {
    width: 100%;
    border: none;
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    background-color: var(--color-primary);
    color: #ffffff;
    transition: background-color 0.15s ease, transform 0.05s ease;
}

.login-button:hover {
    background-color: var(--color-accent);
}

.login-button:active {
    transform: translateY(1px);
}




.index-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background:  var(--color-primary);
    padding: 80px 20px;
}

/* .print-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--color-accent);
    color: #fff;
    border: none;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.print-btn:hover {
    background: var(--color-accent);
} */

.invitation-card {
    position: relative;
    width: 100%;
    max-width: 430px;
    aspect-ratio: 9 / 13;
    border-radius: 20px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 20px 40px rgba(0,0,0,.22);
}

.card-bg-img {
    position: absolute;
    inset: 0;
    left: 0px;
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0.5;
    z-index: 0;
    pointer-events: none;
}

.invitation-card > *:not(.card-bg-img) {
    position: relative;
    z-index: 1;
}

.card-accent {
    position: absolute;
    inset: 0;
    pointer-events: none;
}


.badge-circle {
    position: absolute;
    top: 18px;
    left: 22px;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 20%, #ffffff, #9ac0de);
    border: 2px solid rgba(255, 255, 255, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary-dark);
    font-size: 18px;
    font-weight: 700;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.18);
}

.badge-circle span {
    transform: translateY(1px);
}

.card-header {
    background: white;
    color: var(--color-accent);
    padding: 12px 20px;
    text-align: center;
    display: flex;
    justify-content: space-between;
        gap:5px;
}

.header-logo {
    width: 70px;
    height: 70px;
    object-fit: contain;
    border-radius: 50%;
    margin-bottom: 8px;
    border: 3px solid #ffffff;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.2);
}

.invitation-title {
    font-size: 28px;
    margin-bottom: 6px;
    letter-spacing: 0.03em;
}

.invitation-subtitle {
    font-size: 13px;
    opacity: 0.9;
}

.card-body {
    padding: 32px;
    position: relative;
}

.details {
    direction: rtl;
}

.details {
    margin-top: 20px;
}

.detail-row {
    display: grid;
    grid-template-columns: 120px 1fr; /* label | value */
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.detail-label {
    color: #2a6d9a;
    font-weight: 600;
    text-align: right;
}

.detail-input {
    width: 100%;
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: inherit;
    text-align: right;
}

.detail-input[readonly] {
    pointer-events: none;
}

.detail-input:not([readonly]) {
    border-bottom: 1px solid #2a6d9a;
}

.detail-label , .detail-row  {
    font-weight: 800;
    white-space: nowrap;
    font-size: 18px;
}
.detail-input {
    font-weight: 600;
    white-space: nowrap;
    font-size: 16px;
}

.detail-label{
    color: var(--color-primary);

}


.detail-value {
    color: #333;
    direction: ltr;
    text-align: left;
    font-size: 14px;
}

.footer-note {
    margin-top: 28px;
    padding-top: 18px;
    border-top: 1px dashed #ddd;
    font-size: 12px;
    color: #666;
    text-align: center;
}

/* ===================== */
/* PRINT STYLES */
/* ===================== */
@media print {
     html, body {
        height: auto !important;
        min-height: 0 !important;
        padding: 0 !important;
        margin: 20px !important;
    }

    .index-body {
        min-height: 10 !important;
        padding: 0 !important;
        background: #fff !important;
    }

    .invitation-card {
        margin: 0 auto !important;
        page-break-inside: avoid !important;
        break-inside: avoid !important;
          overflow: visible !important;
              box-shadow: none !important;
        border: 1.5px solid rgba(0,0,0,0.25) !important;

    }

    
   
 * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

  

    .top-actions,
    .edit-btn,
    .save-btn {
        display: none !important;
    }

    /* .invitation-card {
        box-shadow: none !important;
    } */
     
    body {
        background: #ffffff !important;
        padding: 0;

    }

    .print-btn {
        display: none;
    }
    .save-btn {
        display: none;
    }
    .edit-btn {
        display: none;
    }
     .print-page {
        display: block !important;   /* ❌ إلغاء flex */
        min-height: auto !important;
        padding: 0 !important;
        page-break-after: always;
        break-after: page;
    }
    /* .image-upload:not(.has-image) {
        display: none !important;
    } */

    /* .invitation-card {
        box-shadow: none;
        border-radius: 0;
        max-width: none;
    }

    .card-header {
        background: #ffffff;
        color: #000;
        border-bottom: 2px solid #000;
    } */

    /* @page {
        size: A4;
        margin: 20mm;
    } */
/* 
    .upload-text {
        display: none;
    } */

    /* .image-placeholder {
        border: none !important;     
        background: transparent !important; 
    } */
}

.image-upload {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

/* container */
.image-placeholder {
    width: 150px;
    height: 150px;
    border-radius: 50%; /* ⭕ دائري */
    border: 2px dashed var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    background: #f9f9f9;
}

/* image */
.image-placeholder img {
    position: absolute;
    inset: 0;
    margin: auto;
    width: 100%;
    height: 100%;
    object-fit: cover; /* أفضل للصور الشخصية */
    border-radius: 50%; /* ⭕ الصورة نفسها دائرية */
}

/* text */
.upload-text {
    color: var(--color-primary);
    font-size: 14px;
    text-align: center;
    padding: 10px;
    z-index: 2;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.image-placeholder:hover .upload-text {
    opacity: 1;
    pointer-events: auto;
}
/* عند وجود صورة */
.image-placeholder.has-image {
    border: none;
    background: transparent;
}

.image-placeholder.has-image {
    border: none;
    background: transparent;
}
/* إخفاء النص لو فيه صورة */


#photoInput {
    display: none;
}

.detail-input {
    width: 100%;
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: inherit;
    text-align: right;
    color: #333;
}

.detail-input:focus {
    outline: none;
    border-bottom: 1px solid var(--color-primary);
}

.save-btn {
    margin-top: 16px;
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    background: var(--color-primary);
    color: #fff;
    border: none;
    cursor: pointer;
}
.top-actions {
    position: fixed;
    top: 24px;
    right: 24px;
    display: flex;
    gap: 12px;
    z-index: 2000; /* أعلى من أي حاجة */
}

/* تأكيد إن مفيش زر أعلى من التاني */
.print-btn,
.edit-btn {
    position: relative;
    z-index: 1;
    padding: 10px 16px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
}

/* ألوان */
.print-btn {
    background: #e83e6d;
    color: #fff;
}

.edit-btn {
    background: #e83e6d;
    color: #fff;
}

.edit-btn.cancel {
    background: #999;
}

.hidden {
    display: none;
}

.detail-input[readonly] {
    border: none;
    background: transparent;
    cursor: default;
}

.detail-input:not([readonly]) {
    border-bottom: 1px solid var(--color-primary);
    background: transparent;
}

.save-btn {
    margin-top: 16px;
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    background: var(--color-primary);
    color: #fff;
    border: none;
    cursor: pointer;
}

