/* ============================================================================
   Member ID Card — premium print template (rendered off-screen -> PDF)
   html2canvas-safe: only linear/radial gradients, solid borders, drop shadows.
   Vertical PVC card proportion (54 x 85.6 mm). Base 540 x 856 px.
   Palette: Deep Maroon #6e0d0d · Antique Gold #c9a24a · Cream #fffdf6
   ============================================================================ */

.idcard-stage {
    position: fixed;
    left: -10000px;
    top: 0;
    width: 540px;
    z-index: -1;
    pointer-events: none;
}

.idcard {
    width: 540px;
    height: 856px;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
    background: #fffdf6;
    color: #2c1a12;
    font-family: 'Noto Sans Devanagari', 'Montserrat', sans-serif;
    -webkit-font-smoothing: antialiased;
}

.idc-frame {
    position: absolute;
    inset: 9px;
    border-radius: 27px;
    padding: 5px;
    background: linear-gradient(135deg, #f6dd9c 0%, #c9a24a 30%, #9a7424 55%, #e7c878 78%, #c9a24a 100%);
}

.idc-inner {
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
    border-radius: 22px;
    overflow: hidden;
    border: 1.5px solid #c9a24a;
    background:
        repeating-linear-gradient(45deg, rgba(154, 116, 36, 0.020) 0 1px, transparent 1px 8px),
        repeating-linear-gradient(-45deg, rgba(154, 116, 36, 0.020) 0 1px, transparent 1px 8px),
        radial-gradient(circle at 50% -8%, rgba(201, 162, 74, 0.14), transparent 44%),
        linear-gradient(180deg, #fffefa 0%, #fdf6e7 100%);
}

/* ─────────────── FRONT ─────────────── */
.idc-front-watermark {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.085;
    z-index: 0;
    pointer-events: none;
}

.idc-header,
.idc-body,
.idc-temple,
.idc-footer {
    position: relative;
    z-index: 1;
}

.idc-header {
    flex-shrink: 0;
    background:
        radial-gradient(circle at 86% 20%, rgba(236, 202, 116, 0.30), transparent 40%),
        linear-gradient(155deg, #8a1414 0%, #6e0d0d 55%, #4f0707 100%);
    padding: 17px 20px 32px;
    border-bottom: 3px solid #c9a24a;
}

.idc-jai {
    text-align: center;
    color: #f0cd80;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 1.5px;
    margin-bottom: 9px;
}

.idc-headrow {
    display: flex;
    align-items: center;
    gap: 14px;
}

.idc-logo {
    width: 86px;
    height: 86px;
    object-fit: contain;
    border-radius: 50%;
    background: #fffdf6;
    border: 3px solid #c9a24a;
    box-shadow: 0 0 12px rgba(236, 202, 116, 0.5);
    flex-shrink: 0;
}

.idc-titles {
    min-width: 0;
}

.idc-title-hi {
    color: #fff;
    font-size: 25px;
    font-weight: 800;
    line-height: 1.1;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.idc-title-en {
    color: #f0cd80;
    font-family: 'Cormorant Garamond', serif;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1.4px;
    margin-top: 3px;
}

.idc-badge {
    position: absolute;
    left: 50%;
    bottom: -19px;
    transform: translateX(-50%);
    background: linear-gradient(180deg, #f6dd9c 0%, #d9b252 50%, #b88f30 100%);
    border: 1.5px solid #fff0c8;
    border-radius: 999px;
    padding: 7px 32px;
    text-align: center;
    box-shadow: 0 8px 16px -6px rgba(79, 7, 7, 0.75);
    white-space: nowrap;
}

.idc-badge-hi {
    display: block;
    color: #571010;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.1;
}

.idc-badge-en {
    display: block;
    color: #6e0d0d;
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: 2px;
}

.idc-body {
    flex: 1;
    display: flex;
    gap: 18px;
    padding: 38px 22px 10px;
    min-height: 0;
}

.idc-left {
    flex-shrink: 0;
    width: 186px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.idc-photo-frame {
    position: relative;
    padding: 3px;
    border-radius: 14px;
    background: linear-gradient(135deg, #e7c878, #c9a24a 50%, #9a7424);
    box-shadow: 0 10px 20px -8px rgba(60, 20, 8, 0.55);
}

.idc-photo {
    width: 180px;
    height: 228px;
    border-radius: 11px;
    overflow: hidden;
    background: #f1e7d2;
    border: 3px solid #fffdf6;
}

.idc-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Silver hologram security seal */
.idc-holo {
    position: absolute;
    bottom: -12px;
    right: -12px;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    border: 2px solid #fffdf6;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    background: linear-gradient(135deg, #eef2f6 0%, #cdbde2 16%, #b8dde2 34%, #dbe2b8 52%, #f2cbda 70%, #c3cbdc 86%, #eef2f6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.idc-holo::after {
    content: "\0950";
    font-family: 'Noto Sans Devanagari', serif;
    font-size: 23px;
    font-weight: 700;
    color: rgba(70, 70, 95, 0.5);
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
}

.idc-fields {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 2px 0 4px;
}

.idc-row {
    position: relative;
    line-height: 1.1;
    padding: 0 0 7px 13px;
    border-bottom: 1px solid rgba(201, 162, 74, 0.4);
}

.idc-row:last-child {
    border-bottom: 0;
}

.idc-row::before {
    content: "";
    position: absolute;
    left: 0;
    top: 3px;
    width: 5px;
    height: 5px;
    background: #c9a24a;
    transform: rotate(45deg);
}

.idc-row-split {
    display: flex;
    gap: 12px;
    padding-left: 0;
}

.idc-row-split::before {
    display: none;
}

.idc-subcol {
    position: relative;
    flex: 1;
    min-width: 0;
    padding-left: 13px;
}

.idc-subcol::before {
    content: "";
    position: absolute;
    left: 0;
    top: 3px;
    width: 5px;
    height: 5px;
    background: #c9a24a;
    transform: rotate(45deg);
}

.idc-lbl {
    display: block;
    color: #9a7424;
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

.idc-val {
    display: block;
    margin-top: 2px;
    color: #2c1a12;
    font-size: 14.5px;
    font-weight: 700;
    word-break: break-word;
}

.idc-temple {
    flex-shrink: 0;
    line-height: 0;
}

.idc-temple svg {
    width: 100%;
    height: 64px;
    display: block;
}

.idc-temple svg g {
    fill: #c9a24a !important;
}

.idc-footer {
    flex-shrink: 0;
    background:
        radial-gradient(circle at 50% 0%, rgba(236, 202, 116, 0.22), transparent 55%),
        linear-gradient(155deg, #8a1414, #6e0d0d 60%, #4f0707);
    border-top: 3px solid #c9a24a;
    text-align: center;
    padding: 10px 10px 12px;
}

.idc-footer-hi {
    color: #f0cd80;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 1.5px;
}

.idc-footer-en {
    color: #ffe7c2;
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 2.5px;
    margin-top: 3px;
}

/* ─────────────── BACK ─────────────── */
.idc-back-header {
    flex-shrink: 0;
    position: relative;
    z-index: 2;
    background:
        radial-gradient(circle at 86% 30%, rgba(236, 202, 116, 0.26), transparent 48%),
        linear-gradient(155deg, #8a1414, #6e0d0d 60%, #4f0707);
    border-bottom: 3px solid #c9a24a;
    color: #f0cd80;
    text-align: center;
    font-size: 17px;
    font-weight: 800;
    letter-spacing: 1px;
    padding: 15px 12px;
}

.idc-terms {
    flex: 1;
    position: relative;
    z-index: 2;
    padding: 16px 24px 4px;
    min-height: 0;
}

.idc-terms-group {
    margin-bottom: 13px;
}

.idc-terms ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.idc-terms li {
    position: relative;
    padding-left: 17px;
    margin-bottom: 6px;
    color: #4a2f1c;
    font-size: 11.5px;
    line-height: 1.4;
}

.idc-terms li::before {
    content: "";
    position: absolute;
    left: 2px;
    top: 5px;
    width: 5px;
    height: 5px;
    background: #c9a24a;
    transform: rotate(45deg);
}

.idc-terms-en li {
    font-family: 'Montserrat', sans-serif;
    font-size: 11px;
}

.idc-watermark {
    position: absolute;
    right: -40px;
    top: 150px;
    width: 330px;
    height: 330px;
    object-fit: contain;
    opacity: 0.14;
    z-index: 1;
    pointer-events: none;
}

.idc-qrs {
    flex-shrink: 0;
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: center;
    gap: 30px;
    padding: 8px 22px 4px;
}

.idc-qr-item {
    text-align: center;
}

.idc-qr {
    width: 162px;
    height: 162px;
    padding: 9px;
    background: #fff;
    border: 2.5px solid #c9a24a;
    border-radius: 14px;
    box-shadow: 0 6px 14px -6px rgba(60, 20, 8, 0.6);
}

.idc-qr img,
.idc-qr canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

.idc-qr-cap {
    display: block;
    margin-top: 6px;
    color: #6e0d0d;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.3px;
}

.idc-signstamp {
    flex-shrink: 0;
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: flex-end;
    padding: 2px 28px 2px;
}

.idc-signstamp-box {
    text-align: center;
}

.idc-signstamp img {
    width: 128px;
    max-height: 92px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.idc-signstamp-cap {
    display: block;
    margin-top: 1px;
    color: #2c1a12;
    font-size: 9.5px;
    font-weight: 700;
}

.idc-contact {
    flex-shrink: 0;
    position: relative;
    z-index: 2;
    margin: 8px 20px 12px;
    background: linear-gradient(180deg, rgba(110, 13, 13, 0.05), rgba(201, 162, 74, 0.06));
    border: 1px solid rgba(201, 162, 74, 0.5);
    border-radius: 12px;
    padding: 11px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.idc-contact div {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #3a241a;
    font-size: 11.5px;
    font-weight: 600;
    word-break: break-all;
}

.idc-contact i {
    color: #fff;
    background: #6e0d0d;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    flex-shrink: 0;
}

.idc-back-temple {
    flex-shrink: 0;
    line-height: 0;
    background:
        radial-gradient(circle at 50% 0%, rgba(236, 202, 116, 0.2), transparent 55%),
        linear-gradient(155deg, #8a1414, #6e0d0d 60%, #4f0707);
    border-top: 3px solid #c9a24a;
}

.idc-back-temple svg {
    width: 100%;
    height: 50px;
    display: block;
}

.idc-back-temple svg g {
    fill: #ecca74 !important;
}

/* ============================================================================
   Photo cropper — drag / zoom / rotate an upload into the card's 180:228 slot.
   (On-screen UI only; never part of the rendered card.)
   ============================================================================ */
.pc-overlay {
    position: fixed;
    inset: 0;
    background: rgba(30, 18, 10, 0.74);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 1rem;
}

.pc-overlay[hidden] {
    display: none;
}

.pc-dialog {
    background: #fffdf6;
    border: 1px solid #e7c878;
    border-radius: 18px;
    padding: 18px 18px 14px;
    width: 100%;
    max-width: 340px;
    text-align: center;
    box-shadow: 0 24px 60px rgba(30, 18, 10, 0.38);
    animation: pcIn 0.24s ease;
}

@keyframes pcIn {
    from { opacity: 0; transform: translateY(18px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.pc-head {
    color: #6e0d0d;
    font-weight: 800;
    font-size: 1rem;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.pc-head i {
    color: #c9a24a;
}

.pc-stagewrap {
    display: flex;
    justify-content: center;
    padding: 6px;
    background:
        repeating-linear-gradient(45deg, rgba(154, 116, 36, 0.04) 0 1px, transparent 1px 9px),
        linear-gradient(180deg, #fffefa, #fdf6e7);
    border: 1px solid #e7c878;
    border-radius: 14px;
}

.pc-canvas {
    display: block;
    width: min(240px, 62vw);
    aspect-ratio: 540 / 684;
    height: auto;
    border-radius: 10px;
    background: #f1e7d2;
    box-shadow: 0 8px 18px -8px rgba(60, 20, 8, 0.6);
    touch-action: none;
    cursor: grab;
    -webkit-user-select: none;
    user-select: none;
}

.pc-canvas:active {
    cursor: grabbing;
}

.pc-zoom {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 16px 4px 4px;
    color: #9a7424;
}

.pc-zoom i {
    font-size: 0.8rem;
}

.pc-zoom i:last-child {
    font-size: 1rem;
}

.pc-zoom input[type="range"] {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 999px;
    background: linear-gradient(90deg, #e7c878, #c9a24a);
    outline: none;
}

.pc-zoom input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #6e0d0d;
    border: 3px solid #fffdf6;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    cursor: pointer;
}

.pc-zoom input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #6e0d0d;
    border: 3px solid #fffdf6;
    cursor: pointer;
}

.pc-actions {
    display: flex;
    gap: 8px;
    margin-top: 14px;
}

.pc-btn {
    flex: 1;
    border: none;
    border-radius: 999px;
    padding: 10px 6px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: transform 0.12s ease, filter 0.12s ease;
}

.pc-btn:active {
    transform: translateY(1px);
}

.pc-btn-primary {
    background: linear-gradient(180deg, #8a1414, #6e0d0d);
    color: #ffe7c2;
}

.pc-btn-primary:hover {
    filter: brightness(1.08);
}

.pc-btn-ghost {
    background: #f6ecd6;
    color: #6e0d0d;
    border: 1px solid #e7c878;
}

.pc-btn-ghost:hover {
    background: #f0e2c2;
}

.pc-hint {
    margin: 12px 2px 2px;
    font-size: 0.72rem;
    color: #9a7424;
    line-height: 1.45;
}

/* Preview shown under the upload field once a photo has been cropped */
.photo-preview {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 4px;
    padding: 10px 12px;
    background: linear-gradient(180deg, rgba(201, 162, 74, 0.08), rgba(110, 13, 13, 0.04));
    border: 1px solid rgba(201, 162, 74, 0.45);
    border-radius: 12px;
}

.photo-preview[hidden] {
    display: none;
}

.photo-preview-thumb {
    width: 62px;
    aspect-ratio: 180 / 228;
    height: auto;
    flex-shrink: 0;
    border-radius: 8px;
    border: 2px solid #c9a24a;
    background: #f1e7d2 center / cover no-repeat;
    box-shadow: 0 4px 10px -4px rgba(60, 20, 8, 0.5);
}

.photo-preview-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 7px;
}

.photo-preview-ok {
    color: #2e7d32;
    font-size: 0.82rem;
    font-weight: 700;
}

.photo-preview-ok i {
    margin-right: 4px;
}

.photo-preview-adjust {
    background: #fffdf6;
    color: #6e0d0d;
    border: 1px solid #c9a24a;
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.12s ease;
}

.photo-preview-adjust:hover {
    background: #f6ecd6;
}
