/* ==========================================================================
   Career Sankalp – CR80 Vertical ID Card Stylesheet
   Physical Size: 54 mm x 85.6 mm
   Export Canvas: 638 px x 1011 px (300 DPI)
   ========================================================================== */

/* Preview Stage Scaling & 3D Flip */
.card-flip-viewport {
  width: calc(638px * var(--card-scale, 0.45));
  height: calc(1011px * var(--card-scale, 0.45));
  position: relative;
  flex-shrink: 0;
  transition: width 0.2s ease, height 0.2s ease;
}

.card-scale-box {
  width: 638px;
  height: 1011px;
  transform-origin: top left;
  transform: scale(var(--card-scale, 0.45));
  perspective: 2200px;
  transition: transform 0.2s ease;
}

.card-flip-inner {
  width: 638px;
  height: 1011px;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.68s cubic-bezier(0.35, 0.15, 0.2, 1);
  transform-origin: center center;
}

.card-flip-inner.is-flipped {
  transform: rotateY(180deg);
}

.card-flip-face {
  position: absolute;
  inset: 0;
  width: 638px;
  height: 1011px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 24px 52px -12px rgba(7, 20, 38, 0.34);
}

.card-flip-face--back {
  transform: rotateY(180deg);
}

/* Base Native 638x1011 ID Card */
.id-card {
  width: 638px;
  height: 1011px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  font-family: 'Inter', Arial, sans-serif;
  color: #0F172A;
  background: #FFFFFF;
  user-select: none;
  box-sizing: border-box;
}

/* During export: remove shadows and outer border-radius for clean full-bleed print */
.id-card.is-exporting {
  border-radius: 0 !important;
  box-shadow: none !important;
}

.id-card.is-exporting .card-logo-box,
.id-card.is-exporting .card-photo-frame,
.id-card.is-exporting .card-id-pill {
  box-shadow: none !important;
}

/* SVG Background Layer Toggling */
.card-bg-svg {
  position: absolute;
  inset: 0;
  width: 638px;
  height: 1011px;
  z-index: 0;
  pointer-events: none;
}

.id-card .svg-layer {
  display: none;
}

.id-card.template-executive .svg-exec {
  display: block;
}

.id-card.template-minimal .svg-minimal {
  display: block;
}

.id-card.template-luxury .svg-luxury {
  display: block;
}

/* Subtle Company Watermark */
.card-watermark {
  position: absolute;
  top: 52%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 340px;
  height: 340px;
  z-index: 1;
  pointer-events: none;
  opacity: 0.055;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-watermark--back {
  top: 50%;
  opacity: 0.045;
}

.card-watermark-img {
  width: 320px;
  height: 320px;
  object-fit: contain;
}

/* ==========================================================================
   FRONT SIDE STRUCTURE (Tight, Balanced CR80 Proportions)
   ========================================================================== */
.card-front-header {
  position: relative;
  z-index: 2;
  padding: 34px 40px 14px;
  height: 162px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.card-brand-row {
  display: flex;
  align-items: center;
  gap: 18px;
  width: 100%;
}

.card-logo-box {
  width: 82px;
  height: 82px;
  border-radius: 18px;
  background: #FFFFFF;
  padding: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 6px 16px rgba(7, 20, 38, 0.16);
}

.card-logo-img {
  width: 68px;
  height: 68px;
  object-fit: contain;
  display: block;
}

.card-company-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.card-company-name {
  font-family: 'Poppins', Arial, sans-serif;
  font-size: 31px;
  font-weight: 800;
  letter-spacing: 0.05em;
  line-height: 1.12;
  color: #FFFFFF;
}

.card-company-industry {
  font-family: 'Inter', Arial, sans-serif;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #FDBA74;
  margin-top: 5px;
}

/* Portrait & Employee ID Pill */
.card-photo-section {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 10px;
}

.card-photo-frame {
  width: 248px;
  height: 298px;
  padding: 6px;
  border-radius: 22px;
  background: #FFFFFF;
  border: 4px solid #F97316;
  box-shadow: 0 14px 32px rgba(11, 31, 58, 0.22);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-photo-img {
  width: 100%;
  height: 100%;
  border-radius: 14px;
  object-fit: cover;
  display: block;
  background: #F1F5F9;
}

.card-id-pill {
  margin-top: -22px;
  position: relative;
  z-index: 3;
  background: #0B1F3A;
  color: #FFFFFF;
  border: 3px solid #FFFFFF;
  border-radius: 999px;
  padding: 7px 24px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 6px 16px rgba(11, 31, 58, 0.24);
}

.id-pill-label {
  font-size: 13px;
  font-weight: 700;
  color: #F97316;
  letter-spacing: 0.06em;
}

.id-pill-value {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #FFFFFF;
}

/* Identity Block (Name & Designation) */
.card-identity-block {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 20px 36px 14px;
}

.card-employee-name {
  font-family: 'Poppins', Arial, sans-serif;
  font-size: 35px;
  font-weight: 700;
  line-height: 1.18;
  color: #0B1F3A;
  word-break: break-word;
}

.card-employee-designation {
  font-family: 'Poppins', Arial, sans-serif;
  font-size: 19px;
  font-weight: 600;
  color: #EA580C;
  margin-top: 7px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

/* Lower Meta + QR Split (Balanced cleanly without empty middle void) */
.card-front-lower {
  position: relative;
  z-index: 2;
  margin: 16px 36px 26px;
  padding: 24px 24px;
  border-radius: 18px;
  background: rgba(248, 250, 252, 0.96);
  border: 1.5px solid #E2E8F0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.card-meta-list {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.card-meta-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.meta-label {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748B;
}

.meta-value {
  font-size: 16.5px;
  font-weight: 600;
  color: #0B1F3A;
  word-break: break-word;
  line-height: 1.25;
}

.card-qr-box {
  width: 154px;
  flex-shrink: 0;
  background: #FFFFFF;
  border: 2px solid #CBD5E1;
  border-radius: 14px;
  padding: 11px 11px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.card-qr-img {
  width: 128px;
  height: 128px;
  display: block;
  image-rendering: pixelated;
}

.qr-caption {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: #0B1F3A;
}

/* Front Corporate Footer */
.card-front-footer {
  position: relative;
  z-index: 2;
  margin-top: auto;
  height: 86px;
  padding: 16px 36px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #FFFFFF;
}

.footer-tagline {
  font-family: 'Poppins', Arial, sans-serif;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.footer-web {
  font-size: 13.5px;
  font-weight: 600;
  color: #FDBA74;
}

/* Placeholder Text Tone */
.id-card .is-placeholder {
  opacity: 0.56;
}

/* ==========================================================================
   BACK SIDE STRUCTURE
   ========================================================================== */
.card-back-header {
  position: relative;
  z-index: 2;
  height: 126px;
  padding: 20px 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.card-back-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.card-back-logo {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: 12px;
  background: #FFFFFF;
  padding: 4px;
}

.card-back-company {
  display: block;
  font-family: 'Poppins', Arial, sans-serif;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #FFFFFF;
  line-height: 1.15;
}

.card-back-sub {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: #CBD5E1;
  margin-top: 2px;
}

.back-id-chip {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 14px;
  font-weight: 700;
  color: #FFFFFF;
  background: rgba(249, 115, 22, 0.24);
  border: 1.5px solid #F97316;
  padding: 6px 12px;
  border-radius: 999px;
  white-space: nowrap;
}

.card-back-body {
  position: relative;
  z-index: 2;
  flex: 1;
  padding: 24px 36px 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
}

.back-section {
  background: rgba(248, 250, 252, 0.96);
  border: 1.5px solid #E2E8F0;
  border-radius: 14px;
  padding: 18px 20px;
}

.back-section-title {
  font-family: 'Poppins', Arial, sans-serif;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #0B1F3A;
  margin-bottom: 13px;
  padding-bottom: 6px;
  border-bottom: 2px solid #F97316;
  display: inline-block;
}

.back-details-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 18px;
}

.back-detail-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.back-detail-full {
  grid-column: 1 / -1;
}

.back-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748B;
}

.back-value {
  font-size: 15px;
  font-weight: 600;
  color: #0F172A;
  line-height: 1.34;
  word-break: break-word;
}

.badge-blood {
  color: #DC2626;
  font-weight: 800;
}

.back-expiry-val {
  color: #0B1F3A;
  font-weight: 700;
}

.back-terms-box {
  border-left: 5px solid #F97316;
  background: #FFF7ED;
  border-color: #FED7AA;
  border-left-color: #F97316;
  padding: 18px 20px;
}

.back-terms-text {
  font-size: 14px;
  line-height: 1.56;
  color: #334155;
  font-weight: 500;
}

.back-bottom-split {
  display: grid;
  grid-template-columns: 1.24fr 0.76fr;
  gap: 18px;
  align-items: stretch;
}

.back-org-contact {
  background: rgba(248, 250, 252, 0.96);
  border: 1.5px solid #E2E8F0;
  border-radius: 14px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.org-contact-line {
  font-size: 13px;
  line-height: 1.46;
  color: #334155;
  margin-top: 3px;
  word-break: break-word;
}

.org-web-line {
  font-weight: 700;
  color: #2563EB;
  margin-top: 6px;
}

.back-signatory-box {
  background: rgba(248, 250, 252, 0.96);
  border: 1.5px solid #E2E8F0;
  border-radius: 14px;
  padding: 14px 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
}

.signatory-area {
  width: 100%;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}

.signatory-img {
  max-width: 168px;
  max-height: 60px;
  object-fit: contain;
}

.signatory-rule {
  width: 100%;
  height: 2px;
  background: #0B1F3A;
  opacity: 0.75;
  margin-bottom: 7px;
}

.signatory-title {
  font-family: 'Poppins', Arial, sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: #0B1F3A;
}

.signatory-subtitle {
  font-size: 11px;
  color: #64748B;
  margin-top: 1px;
}

.card-back-footer {
  position: relative;
  z-index: 2;
  height: 63px;
  padding: 8px 34px 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #E2E8F0;
}

/* ==========================================================================
   TEMPLATE 2 – PREMIUM MINIMAL OVERRIDES
   ========================================================================== */
.id-card.template-minimal .card-front-header {
  padding-top: 46px;
  height: 184px;
}

.id-card.template-minimal .card-logo-box {
  background: #FFFFFF;
  border: 1.5px solid #E2E8F0;
  box-shadow: 0 4px 12px rgba(11, 31, 58, 0.08);
}

.id-card.template-minimal .card-company-name {
  color: #0B1F3A;
}

.id-card.template-minimal .card-company-industry {
  color: #F97316;
}

.id-card.template-minimal .card-photo-frame {
  border-color: #0B1F3A;
  box-shadow: 0 10px 26px rgba(11, 31, 58, 0.12);
}

.id-card.template-minimal .card-id-pill {
  background: #FFFFFF;
  color: #0B1F3A;
  border: 2.5px solid #F97316;
}

.id-card.template-minimal .id-pill-value {
  color: #0B1F3A;
}

.id-card.template-minimal .card-employee-designation {
  color: #2563EB;
}

.id-card.template-minimal .card-front-lower {
  background: #FFFFFF;
  border-color: #CBD5E1;
}

.id-card.template-minimal .card-front-footer {
  height: 82px;
  padding: 6px 42px 24px;
  color: #0B1F3A;
}

.id-card.template-minimal .footer-web {
  color: #F97316;
}

/* Back Minimal Overrides */
.id-card.template-minimal .card-back-header {
  height: 136px;
  padding: 44px 42px 14px;
}

.id-card.template-minimal .card-back-logo {
  border: 1.5px solid #E2E8F0;
}

.id-card.template-minimal .card-back-company {
  color: #0B1F3A;
}

.id-card.template-minimal .card-back-sub {
  color: #64748B;
}

.id-card.template-minimal .back-id-chip {
  background: #FFF7ED;
  color: #0B1F3A;
  border-color: #F97316;
}

.id-card.template-minimal .card-back-body {
  padding: 20px 42px 16px;
}

.id-card.template-minimal .card-back-footer {
  height: 66px;
  padding: 6px 42px 24px;
  color: #0B1F3A;
}

/* ==========================================================================
   TEMPLATE 3 – LUXURY PROFESSIONAL OVERRIDES
   ========================================================================== */
.id-card.template-luxury {
  background: #071324;
  color: #F8FAFC;
}

.id-card.template-luxury .card-watermark {
  opacity: 0.06;
}

.id-card.template-luxury .card-logo-box {
  background: #FFFFFF;
  border: 2.5px solid #D4AF37;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.id-card.template-luxury .card-company-name {
  color: #FFFFFF;
}

.id-card.template-luxury .card-company-industry {
  color: #F2D078;
}

.id-card.template-luxury .card-photo-frame {
  background: #0B1F3A;
  border: 4px solid #D4AF37;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
}

.id-card.template-luxury .card-id-pill {
  background: #050D1A;
  border: 2.5px solid #D4AF37;
}

.id-card.template-luxury .id-pill-label {
  color: #F2D078;
}

.id-card.template-luxury .card-employee-name {
  color: #FFFFFF;
}

.id-card.template-luxury .card-employee-designation {
  color: #F2D078;
}

.id-card.template-luxury .card-front-lower {
  background: rgba(13, 32, 61, 0.92);
  border: 1.5px solid rgba(212, 175, 55, 0.45);
}

.id-card.template-luxury .meta-label {
  color: #94A3B8;
}

.id-card.template-luxury .meta-value {
  color: #F8FAFC;
}

.id-card.template-luxury .card-qr-box {
  background: #FFFFFF;
  border: 2.5px solid #D4AF37;
}

.id-card.template-luxury .card-front-footer {
  height: 86px;
  padding: 12px 42px 24px;
  color: #F2D078;
}

.id-card.template-luxury .footer-web {
  color: #FFFFFF;
}

/* Back Luxury Overrides */
.id-card.template-luxury .card-back-header {
  height: 142px;
  padding: 30px 42px 16px;
}

.id-card.template-luxury .card-back-logo {
  background: #FFFFFF;
  border: 2px solid #D4AF37;
}

.id-card.template-luxury .back-id-chip {
  background: rgba(212, 175, 55, 0.16);
  color: #F2D078;
  border-color: #D4AF37;
}

.id-card.template-luxury .card-back-body {
  padding: 20px 42px 16px;
}

.id-card.template-luxury .back-section,
.id-card.template-luxury .back-org-contact,
.id-card.template-luxury .back-signatory-box {
  background: rgba(13, 32, 61, 0.92);
  border-color: rgba(212, 175, 55, 0.36);
}

.id-card.template-luxury .back-section-title {
  color: #F2D078;
  border-bottom-color: #D4AF37;
}

.id-card.template-luxury .back-label,
.id-card.template-luxury .signatory-subtitle {
  color: #94A3B8;
}

.id-card.template-luxury .back-value,
.id-card.template-luxury .org-contact-line,
.id-card.template-luxury .signatory-title {
  color: #F8FAFC;
}

.id-card.template-luxury .badge-blood {
  color: #FCA5A5;
}

.id-card.template-luxury .back-expiry-val,
.id-card.template-luxury .org-web-line {
  color: #F2D078;
}

.id-card.template-luxury .back-terms-box {
  background: rgba(212, 175, 55, 0.08);
  border-color: rgba(212, 175, 55, 0.38);
  border-left-color: #D4AF37;
}

.id-card.template-luxury .back-terms-text {
  color: #E2E8F0;
}

.id-card.template-luxury .signatory-area.has-signatory-img {
  background: rgba(255, 255, 255, 0.94);
  border-radius: 8px;
  padding: 4px;
}

.id-card.template-luxury .signatory-rule {
  background: #D4AF37;
}

.id-card.template-luxury .card-back-footer {
  height: 76px;
  padding: 8px 42px 24px;
  color: #F2D078;
}

/* ==========================================================================
   PRINT STYLES (Exact CR80 54 mm x 85.6 mm)
   ========================================================================== */
@media print {
  @page {
    size: 54mm 85.6mm;
    margin: 0;
  }

  html,
  body {
    margin: 0 !important;
    padding: 0 !important;
    background: #FFFFFF !important;
    width: 54mm !important;
    height: auto !important;
  }

  body>*:not(#print-area) {
    display: none !important;
  }

  #print-area {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .print-card-page {
    width: 54mm;
    height: 85.6mm;
    overflow: hidden;
    page-break-after: always;
    break-after: page;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .print-card-page:last-child {
    page-break-after: auto;
    break-after: auto;
  }

  .print-card-img {
    width: 54mm;
    height: 85.6mm;
    display: block;
    object-fit: fill;
  }
}