/* =========================================================
   Visa Candidate Portal — Premium full-width frontend styles
   ========================================================= */

.vcp-app {
    width: 100%;
    padding: 40px 20px;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #1f2937;
}

.vcp-container {
    max-width: 1180px;
    margin: 0 auto;
}

/* ---------- Search box ---------- */
.vcp-search-box {
    background: #fff;
    border-radius: 16px;
    padding: 28px 32px;
    box-shadow: 0 10px 30px -12px rgba(15,23,42,.12);
    border: 1px solid rgba(15,23,42,.05);
    margin-bottom: 28px;
}
.vcp-search-box label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .5px;
    text-transform: uppercase;
    color: #64748b;
    margin-bottom: 12px;
}
.vcp-search-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
#vcp-passport-input {
    flex: 1;
    min-width: 220px;
    padding: 14px 18px;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    background: #f9fafb;
    font-size: 15px;
    transition: all .2s;
    box-sizing: border-box;
}
#vcp-passport-input:focus {
    outline: none;
    border-color: #dc2626;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(220,38,38,.08);
}
#vcp-search-btn {
    background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
    color: #fff;
    border: none;
    padding: 14px 36px;
    border-radius: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
    font-size: 14px;
    transition: transform .15s, box-shadow .15s;
    box-shadow: 0 6px 16px -4px rgba(220,38,38,.4);
}
#vcp-search-btn:hover { transform: translateY(-1px); box-shadow: 0 10px 20px -6px rgba(220,38,38,.5); }

/* ---------- Loading / Error ---------- */
.vcp-loading {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 24px;
    background: #fff;
    border-radius: 12px;
    color: #64748b;
    font-weight: 500;
    box-shadow: 0 4px 12px -6px rgba(0,0,0,.08);
}
.vcp-spinner {
    width: 20px; height: 20px;
    border: 3px solid #e5e7eb;
    border-top-color: #dc2626;
    border-radius: 50%;
    animation: vcp-spin .8s linear infinite;
}
@keyframes vcp-spin { to { transform: rotate(360deg); } }

.vcp-error {
    background: #fef2f2;
    color: #991b1b;
    border-left: 4px solid #dc2626;
    padding: 14px 20px;
    border-radius: 8px;
    margin-top: 14px;
    font-weight: 500;
}

/* ---------- Document Card ---------- */
.vcp-document {
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 20px 50px -20px rgba(15,23,42,.18);
    overflow: hidden;
    border: 1px solid rgba(15,23,42,.05);
}

/* Header */
.vcp-doc-header {
    display: flex;
    align-items: center;
    gap: 28px;
    padding: 36px 40px;
    background: linear-gradient(135deg, #dc262642 0%, #f27070 60%, #f70303 100%);
    color: #fff;
    flex-wrap: wrap;
}
.vcp-photo-wrap {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    overflow: hidden;
    background: linear-gradient(135deg, #fbbf24, #dc2626);
    padding: 4px;
    flex-shrink: 0;
    box-shadow: 0 10px 25px -10px rgba(0,0,0,.5);
}
.vcp-photo-wrap img,
.vcp-photo-fallback {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    background: #1e293b;
}
.vcp-photo-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 52px;
    font-weight: 700;
}
.vcp-header-info h1 {
    margin: 0 0 12px 0;
    font-size: 30px;
    letter-spacing: .5px;
    font-weight: 700;
}
.vcp-badges { display: flex; gap: 8px; flex-wrap: wrap; }
.vcp-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .5px;
    text-transform: uppercase;
}
.vcp-badge-status { background: rgba(34,197,94,.2); color: #4ade80; border: 1px solid rgba(74,222,128,.4); }
.vcp-pay-paid     { background: rgba(34,197,94,.15); color: #16a34a; }
.vcp-pay-unpaid   { background: rgba(220,38,38,.15); color: #dc2626; }
.vcp-pay-partial  { background: rgba(245,158,11,.15); color: #d97706; }
.vcp-pay-refunded { background: rgba(100,116,139,.15); color: #475569; }

/* Sections */
.vcp-section {
    padding: 28px 40px;
    border-top: 1px solid #f1f5f9;
}
.vcp-section-title {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #dc2626;
    margin: 0 0 18px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #fee2e2;
}

/* Grid for personal info */
.vcp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
}
.vcp-info-cell {
    display: flex;
    flex-direction: column;
    padding: 14px 16px;
    background: #f9fafb;
    border-radius: 10px;
    border: 1px solid #f1f5f9;
}
.vcp-info-label {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: 4px;
}
.vcp-info-value {
    font-size: 15px;
    font-weight: 600;
    color: #0f172a;
    word-break: break-word;
}

/* Company */
.vcp-company .vcp-company-name {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 6px;
}
.vcp-company div { color: #475569; line-height: 1.7; }

/* Tables */
.vcp-table, .vcp-voucher {
    width: 100%;
    border-collapse: collapse;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
}
.vcp-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 14px;
}
.vcp-table tr:last-child td { border-bottom: none; }
.vcp-table td.vcp-label {
    background: #f9fafb;
    font-weight: 600;
    color: #475569;
    width: 35%;
}

.vcp-voucher th {
    background: #f1f5f9;
    color: #334155;
    padding: 12px 16px;
    font-size: 12px;
    font-weight: 700;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: .5px;
}
.vcp-voucher td {
    padding: 14px 16px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 14px;
    vertical-align: top;
}
.vcp-voucher .num { text-align: right; white-space: nowrap; }
.vcp-voucher .vcp-total-row td { background: #fafbfc; font-weight: 600; color: #475569; }
.vcp-voucher .vcp-grand-row td {
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
    font-weight: 700;
    color: #991b1b;
    font-size: 16px;
}

.vcp-pay-meta {
    margin-top: 18px;
    display: flex;
    gap: 32px;
    flex-wrap: wrap;
    font-size: 15px;
}
.vcp-pay-meta p { margin: 0; }

.vcp-note {
    margin-top: 18px;
    padding: 16px 18px;
    background: #fffbeb;
    border-left: 4px solid #f59e0b;
    border-radius: 8px;
    color: #78350f;
    font-size: 14px;
    line-height: 1.6;
}

.vcp-letter-subject { font-size: 15px; color: #0f172a; margin-bottom: 8px; }
.vcp-letter-body { color: #334155; line-height: 1.75; font-size: 14.5px; }
.vcp-letter-body p { margin: 0 0 12px 0; }

/* ---------- Actions ---------- */
.vcp-actions {
    margin-top: 24px;
    display: flex;
    justify-content: center;
}
#vcp-download-pdf-btn {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #fff;
    border: none;
    padding: 16px 40px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    font-size: 15px;
    letter-spacing: .5px;
    transition: transform .15s, box-shadow .15s;
    box-shadow: 0 10px 25px -8px rgba(15,23,42,.4);
}
#vcp-download-pdf-btn:hover { transform: translateY(-1px); box-shadow: 0 14px 30px -10px rgba(15,23,42,.55); }
#vcp-download-pdf-btn:disabled { opacity: .7; cursor: wait; }

/* ---------- Additional Details (rich content) ---------- */
.vcp-additional-body {
    color: #1f2937;
    line-height: 1.75;
    font-size: 14.5px;
}
.vcp-additional-body h1,
.vcp-additional-body h2,
.vcp-additional-body h3,
.vcp-additional-body h4 {
    color: #0f172a;
    margin: 18px 0 8px;
    font-weight: 700;
    letter-spacing: .3px;
}
.vcp-additional-body h2 { font-size: 17px; text-transform: uppercase; color: #991b1b; }
.vcp-additional-body h3 { font-size: 15px; text-transform: uppercase; color: #0f172a; }
.vcp-additional-body p  { margin: 0 0 10px 0; }
.vcp-additional-body ul,
.vcp-additional-body ol { margin: 0 0 12px 22px; }
.vcp-additional-body li { margin-bottom: 4px; }
.vcp-additional-body strong { color: #0f172a; }

/* ---------- PDF mode tweaks ---------- */
.vcp-pdf-mode {
    box-shadow: none !important;
    border-radius: 0 !important;
}
.vcp-pdf-mode .vcp-doc-header {
    background: #0f172a !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    color: #fff !important;
    padding: 28px 32px !important;
}
.vcp-pdf-mode .vcp-section,
.vcp-pdf-mode .vcp-doc-header,
.vcp-pdf-mode .vcp-voucher,
.vcp-pdf-mode .vcp-table,
.vcp-pdf-mode .vcp-note,
.vcp-pdf-mode tr,
.vcp-pdf-mode img {
    page-break-inside: avoid;
    break-inside: avoid;
}
.vcp-pdf-mode .vcp-section { padding: 20px 32px; }
.vcp-pdf-mode .vcp-grid { grid-template-columns: repeat(2, 1fr) !important; }
.vcp-pdf-mode .vcp-photo-wrap { width: 100px; height: 100px; }
.vcp-pdf-mode .vcp-header-info h1 { font-size: 24px; }
.vcp-pdf-mode .vcp-additional-body { font-size: 13px; line-height: 1.65; }
.vcp-pdf-mode .vcp-voucher .vcp-grand-row td { font-size: 14px; }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
    .vcp-doc-header { padding: 24px; text-align: center; justify-content: center; }
    .vcp-header-info { width: 100%; }
    .vcp-header-info h1 { font-size: 22px; }
    .vcp-section { padding: 22px; }
    .vcp-photo-wrap { width: 110px; height: 110px; }
}
