/* ===== Ultra-Premium Styles ===== */
body {
    background: linear-gradient(180deg, #f4f7fb, #ffffff);
    font-family: 'Noto Sans Devanagari', 'Segoe UI', sans-serif;
    color: #1e293b;
    margin: 0;
    padding: 0;
}

/* ---------- Container (Responsive) ---------- */
.app-container {
    max-width: 1150px; /* Desktop max width */
    margin: auto;
    padding: 20px;
    width: 100%;
    box-sizing: border-box;
}

/* Extra fluid container on tablets */
@media (max-width: 991px) {
    .app-container {
        max-width: 95%;
        padding: 15px;
    }
}

/* Mobile (small phones) */
@media (max-width: 576px) {
    .app-container {
        max-width: 100%;
        padding: 12px;
    }
}

/* ---------- Header ---------- */
.app-header {
    background: #fff;
    border-radius: 20px;
    padding: 25px 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.app-header h3 {
    font-weight: 700;
    margin-bottom: 5px;
}

.app-header small {
    color: #64748b;
    font-size: 14px;
}

/* ---------- Cards ---------- */
.premium-card {
    background: #fff;
    border-radius: 18px;
    padding: 20px;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.07);
    transition: all .3s ease;
}

.premium-card:hover {
    box-shadow: 0 16px 50px rgba(0, 0, 0, 0.12);
}

/* ---------- Section ---------- */
.section-title {
    font-weight: 600;
    font-size: 18px;
    color: #2563eb;
    margin-bottom: 20px;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 10px;
}

/* ---------- Form ---------- */
.form-label {
    font-weight: 600;
    color: #334155;
}

.required {
    color: #ef4444;
}

.form-control,
.form-select {
    border-radius: 12px;
    border: 1px solid #94c0f8;
    font-size: 15px;
    /* padding: 10px 14px; */
    transition: all .2s;
}

.form-control:focus,
.form-select:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 .15rem rgba(37, 99, 235, .15);
    outline: none;
}

/* ---------- Drag Drop ---------- */
.drag-drop {
    position: relative;
    min-height: 100px;
    border: 2px dashed #dbeafe;
    border-radius: 14px;
    background: #f8fbff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    transition: .3s;
    cursor: pointer;
    padding: 12px;
}

.drag-drop.dragover {
    border-color: #2563eb;
    background: #eff6ff;
}

.drag-drop p {
    pointer-events: none;
    font-size: 13px;
    text-align: center;
    margin: 0;
}

/* ---------- File Preview ---------- */
.file-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.file-preview img {
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    max-width: 120px;
    max-height: 120px;
}

.file-preview a {
    display: block;
    font-weight: 500;
    color: #2563eb;
    text-decoration: underline;
    font-size: 13px;
}

/* ---------- Wizard ---------- */
.wizard {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.wizard-step {
    flex: 1;
    text-align: center;
    padding: 14px;
    border-radius: 12px;
    background: #e2e8f0;
    font-weight: 600;
    position: relative;
    transition: .3s;
    cursor: pointer;
    font-size: 14px;
}

.wizard-step.active {
    background: #2563eb;
    color: #fff;
}

.wizard-step.active::after {
    content: "";
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-top: 10px solid #2563eb;
}

/* ---------- Buttons ---------- */
.btn-premium {
    background: #2563eb;
    border: none;
    padding: 14px 50px;
    font-weight: 600;
    border-radius: 12px;
    color: #fff;
    letter-spacing: .4px;
    box-shadow: 0 10px 25px rgba(37, 99, 235, .25);
    transition: .25s;
}

.btn-premium:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
}

.btn-premium:disabled {
    background: #94a3b8;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* ---------- Wizard Content ---------- */
.wizard-content {
    opacity: 0;
    transform: translateX(50px);
    height: 0;
    overflow: hidden;
    pointer-events: none;
    transition: all .5s ease;
}

.wizard-content.active-step {
    opacity: 1;
    transform: translateX(0);
    height: auto;
    pointer-events: auto;
}

/* ---------- Checkmark ---------- */
.checkmark-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
    opacity: 0;
    transform: scale(0.7);
    transition: all .5s;
}

.checkmark-container.active {
    opacity: 1;
    transform: scale(1);
}

.checkmark {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid #16a34a;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.checkmark::after {
    content: '';
    position: absolute;
    width: 14px;
    height: 8px;
    border-left: 2px solid #16a34a;
    border-bottom: 2px solid #16a34a;
    transform: rotate(-45deg);
    opacity: 0;
    transition: all .4s ease .2s;
}

.checkmark-container.active .checkmark::after {
    opacity: 1;
}

.checkmark-text {
    font-weight: 600;
    color: #16a34a;
    font-size: 14px;
}

/* ---------- Lightbox ---------- */
#lightboxModal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

#lightboxModal img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 8px;
}

/* ---------- Progress ---------- */
.progress {
    height: 8px;
    border-radius: 6px;
    overflow: hidden;
    background: #e2e8f0;
}

.progress .bg-primary {
    height: 100%;
    transition: width .5s;
}

/* ---------- Live Preview / Certificate ---------- */
#livePreview,
.certificate-container {
    background: #fff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.15);
    border-radius: 12px;
    padding: 30px;
    transition: all .5s ease;
    transform: scale(0.95);
    opacity: 0;
    box-sizing: border-box;
    font-size: 16px; /* base font */
    line-height: 1.5;
    overflow-wrap: break-word;
}

.wizard-content[data-step="3"].active-step #livePreview,
.certificate-container.active-step {
    transform: scale(1);
    opacity: 1;
}

/* ---------- Certificate Header ---------- */
.certificate-header {
    text-align: center;
    margin-bottom: 20px;
}

.certificate-header h2 {
    margin: 0 0 5px 0;
    font-weight: 700;
    font-size: 22px;
}

.certificate-header small {
    font-size: 14px;
    color: #64748b;
}

/* ---------- Certificate Table ---------- */
.certificate-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.certificate-table td {
    border: 1px solid #ccc;
    padding: 6px;
    vertical-align: middle;
    font-size: 1rem;
}

.certificate-table .field-label {
    font-weight: 600;
    width: 35%;
}

.certificate-table .field-value {
    width: 65%;
}

/* ---------- Documents Preview ---------- */
.documents-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 15px;
}

.document-card {
    border: 1px solid #ccc;
    padding: 8px;
    border-radius: 8px;
    width: 120px;
    text-align: center;
    box-sizing: border-box;
    font-size: 0.875rem;
}

.document-card img {
    width: 100%;
    border-radius: 4px;
    display: block;
    margin-top: 5px;
}

.document-card a {
    font-size: 13px;
    word-break: break-word;
}

/* ===============================
   RESPONSIVE BREAKPOINTS
================================ */

/* Tablets */
@media (max-width: 991px) {
    .wizard-step {
        flex: 1 1 100%;
        text-align: left;
    }

    .wizard-step.active::after {
        display: none;
    }

    .btn-premium,
    #prevBtn,
    #nextBtn,
    #submitBtn {
        width: 100%;
        padding: 12px;
    }

    #livePreview {
        padding: 16px;
        overflow-x: auto;
    }

    .document-card {
        width: 45%;
    }
}

/* Mobile */
@media (max-width: 768px) {
    body { font-size: 14px; }

    .app-header h3 { font-size: 18px; }

    .section-title { font-size: 16px; }

    .form-control,
    .form-select { font-size: 14px; }

    .file-preview img {
        max-width: 90px;
        max-height: 90px;
    }

    .container { padding: 10px !important; }
}

/* Small Phones */
@media (max-width: 576px) {
    .app-container {
        max-width: 100%;
        padding: 12px;
    }

    .premium-card { padding: 14px; }

    .wizard-step { font-size: 12px; padding: 10px; }

    .file-preview img {
        max-width: 72px;
        max-height: 72px;
    }

    .btn-premium { font-size: 14px; padding: 12px; }

    .certificate-container { font-size: 14px; }

    .certificate-table td { font-size: 0.875rem; padding: 4px; }
}

/* Touch Devices */
@media (hover: none) {
    .premium-card:hover,
    .btn-premium:hover {
        transform: none;
    }
}

/* ===============================
   PRINT (A4 SAFE)
================================ */
@media print {
    body * { visibility: hidden; }

    #livePreview,
    #livePreview *,
    .certificate-container,
    .certificate-container * { visibility: visible; }

    #livePreview,
    .certificate-container {
        position: absolute;
        inset: 0;
        width: 210mm;
        padding: 20mm;
        box-shadow: none;
        border: none;
        transform: scale(1);
        font-size: 12pt;
    }

    .certificate-table td { font-size: 10pt; padding: 4pt; }
    .document-card { font-size: 9pt; }
}
