/* ══════════════════════════════════════════
   Pune District Court — Certificate Studio
   Design palette: #7E5A00 gold, deep parchment
   Fonts: Cinzel (headings), Cormorant Garamond
   ══════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@600;700;800;900&family=Merriweather:ital,wght@0,300;0,400;0,700;0,900;1,300;1,400;1,700&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

/* ── Tokens ── */
:root {
  --gold:       #7E5A00;
  --gold-lt:    #b8872b;
  --gold-pale:  #f5edd8;
  --gold-line:  #d4aa6a;
  --ink:        #1c1208;
  --ink-mid:    #3d2f10;
  --ink-muted:  #6b5730;
  --parchment:  #fdf8ee;
  --cream:      #f9f3e3;
  --white:      #ffffff;
  --border:     #e2cfa0;
  --shadow:     rgba(100, 70, 0, 0.10);
  --ui-font:    'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --serif:      'Merriweather', serif;
  --display:    'Cinzel', serif;
  --radius:     12px;
  --radius-sm:  8px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: #f0e9d6;
  color: var(--ink);
  font-family: var(--ui-font);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ══════════════════════════════════════════
   TOPBAR
   ══════════════════════════════════════════ */
.topbar {
  background: var(--ink);
  border-bottom: 3px solid var(--gold);
  padding: 0 max(20px, calc((100% - 1200px) / 2));
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 24px rgba(0,0,0,0.4);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}

.brand-seal {
  width: 52px;
  height: 52px;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(180,130,0,0.35));
  animation: slow-spin 40s linear infinite;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.brand-title {
  font-family: var(--ui-font);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--gold-lt);
  line-height: 1.2;
}

.brand-sub {
  font-family: var(--ui-font);
  font-size: 11px;
  color: #a8946a;
  letter-spacing: 0.01em;
}

.topbar-right { flex-shrink: 0; }

.dept-badge {
  display: inline-block;
  font-family: var(--ui-font);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--gold-lt);
  border: 1px solid var(--gold);
  border-radius: 4px;
  padding: 6px 12px;
  background: rgba(126,90,0,0.12);
  text-transform: none;
}

/* ══════════════════════════════════════════
   HERO STRIP
   ══════════════════════════════════════════ */
.hero-strip {
  background: linear-gradient(135deg, #1c1208 0%, #3d2412 50%, #1c1208 100%);
  text-align: center;
  padding: 40px 20px 36px;
  border-bottom: 2px solid var(--gold);
  position: relative;
  overflow: hidden;
}

.hero-strip::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 40px,
    rgba(126,90,0,0.04) 40px,
    rgba(126,90,0,0.04) 80px
  );
}

.hero-eyebrow {
  font-family: var(--ui-font);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--gold-lt);
  margin-bottom: 8px;
  position: relative;
}

.hero-title {
  font-family: var(--ui-font);
  font-size: clamp(24px, 4vw, 38px);
  font-weight: 700;
  color: var(--gold-pale);
  letter-spacing: -0.01em;
  line-height: 1.2;
  position: relative;
}

.hero-sub {
  font-family: var(--ui-font);
  font-size: 14px;
  color: #a8946a;
  margin-top: 8px;
  letter-spacing: 0.01em;
  position: relative;
}

/* ══════════════════════════════════════════
   WORKSPACE GRID
   ══════════════════════════════════════════ */
.workspace {
  max-width: 1200px;
  margin: 36px auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: minmax(290px, 370px) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

/* ══════════════════════════════════════════
   CARD SHELL
   ══════════════════════════════════════════ */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 40px var(--shadow);
  overflow: hidden;
}

/* ══════════════════════════════════════════
   EDITOR
   ══════════════════════════════════════════ */
.editor {
  padding: 24px 22px 18px;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 22px;
}

.panel-badge {
  background: var(--gold);
  color: #fff;
  font-family: var(--ui-font);
  font-size: 11px;
  font-weight: 700;
  border-radius: 6px;
  padding: 5px 9px;
  margin-top: 2px;
  flex-shrink: 0;
}

.panel-title {
  font-family: var(--ui-font);
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
  margin: 0;
}

/* Eyebrow label */
.eyebrow {
  font-family: var(--ui-font);
  font-size: 10px;
  letter-spacing: 0.08em;
  font-weight: 600;
  color: var(--gold);
  margin-bottom: 4px;
}

/* Form */
#editor-form {
  display: grid;
  gap: 16px;
}

.field-group { display: grid; }

.field {
  display: grid;
  gap: 6px;
}

.field-label {
  font-family: var(--ui-font);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ink-mid);
  display: flex;
  align-items: center;
  gap: 6px;
}

.field-tag {
  background: var(--gold-pale);
  color: var(--gold);
  font-size: 9px;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  border-radius: 3px;
  font-weight: 600;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--parchment);
  padding: 10px 12px;
  font-family: var(--ui-font);
  font-size: 14px;
  color: var(--ink);
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
  line-height: 1.5;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(126,90,0,0.14);
  background: #fffdf5;
}

.field textarea {
  resize: vertical;
  min-height: 72px;
}

/* Remove number input spinners */
.field input[type="number"] { -moz-appearance: textfield; }
.field input[type="number"]::-webkit-inner-spin-button,
.field input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; }

.field-hint {
  font-family: var(--ui-font);
  font-size: 12px;
  color: var(--ink-muted);
  line-height: 1.4;
}

.fee-words {
  font-family: var(--ui-font);
  font-weight: 500;
  color: var(--gold);
  font-size: 12px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* Advanced / address section */
.advanced {
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

.advanced summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--ui-font);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ink-mid);
  user-select: none;
  gap: 8px;
}

.advanced summary::-webkit-details-marker { display: none; }

.summary-edit-note {
  font-size: 11px;
  color: #b09060;
  font-weight: 500;
  letter-spacing: 0;
  font-family: var(--ui-font);
}

.summary-chevron {
  color: var(--gold);
  font-size: 18px;
  transition: transform 0.2s;
  margin-left: auto;
}

.advanced[open] .summary-chevron { transform: rotate(90deg); }

.advanced-content { padding-top: 14px; }

/* Editor footer */
.editor-foot {
  border-top: 1px solid var(--border);
  padding-top: 13px;
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--ui-font);
  font-size: 12px;
  color: #a08040;
}

.live-dot {
  width: 7px;
  height: 7px;
  background: #4caf6a;
  border-radius: 99px;
  display: inline-block;
  animation: pulse-dot 2s ease-in-out infinite;
}

/* ══════════════════════════════════════════
   PREVIEW AREA
   ══════════════════════════════════════════ */
.preview-area { min-width: 0; }

.preview-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 14px;
  padding: 0 4px;
}

.preview-heading .panel-title { margin: 0; }

.size-label {
  font-family: var(--ui-font);
  font-size: 11px;
  color: #a08040;
}

.size-label b { color: var(--gold-lt); padding: 0 3px; }

.canvas-wrap {
  background: #e8dfc8;
  border: 1px solid #d4c490;
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  justify-content: center;
  overflow: hidden;
  box-shadow: inset 0 2px 8px rgba(100,70,0,0.08);
}

.canvas-wrap canvas {
  width: min(100%, 500px);
  height: auto;
  background: #fff;
  box-shadow: 0 6px 32px rgba(50,30,0,0.22);
  border-radius: 2px;
}

/* ── Download button ── */
/* ── Download button (Prominent) ── */
.btn-download {
  width: 100%;
  margin-top: 18px;
  border: 1.5px solid #d4aa6a;
  border-radius: var(--radius);
  padding: 16px 20px;
  background: linear-gradient(135deg, #b8872b 0%, #8a6300 50%, #684a00 100%);
  color: #fff;
  font-family: var(--ui-font);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.18s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.18s, background 0.18s;
  box-shadow: 0 8px 26px rgba(126, 90, 0, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.32);
}

.btn-download:hover {
  background: linear-gradient(135deg, #c99632 0%, #9e7200 50%, #7a5800 100%);
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(126, 90, 0, 0.50), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.btn-download:active {
  transform: translateY(0);
  box-shadow: 0 4px 16px rgba(126, 90, 0, 0.35);
}

.btn-download-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
}

.download-icon {
  font-size: 24px;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.download-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  gap: 2px;
  flex: 1;
}

.download-text strong {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

.download-text small {
  font-size: 11px;
  color: #faebd0;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.download-arrow {
  font-size: 22px;
  line-height: 1;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.2s;
}

.btn-download:hover .download-arrow {
  transform: translateY(2px);
}

.download-note {
  text-align: center;
  color: #9a8050;
  font-family: var(--ui-font);
  font-size: 12px;
  margin: 10px 0 0;
}

/* ══════════════════════════════════════════
   FOOTER
   ══════════════════════════════════════════ */
.site-footer {
  background: var(--ink);
  border-top: 3px solid var(--gold);
  margin-top: 56px;
  padding: 28px max(20px, calc((100% - 1200px) / 2));
}

.footer-inner {
  display: flex;
  align-items: center;
  gap: 20px;
}

.footer-seal img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  opacity: 0.85;
  filter: drop-shadow(0 1px 4px rgba(180,130,0,0.25));
}

.footer-body {
  flex: 1;
}

.footer-court {
  font-family: var(--ui-font);
  font-size: 13px;
  font-weight: 600;
  color: var(--gold-lt);
  letter-spacing: 0.02em;
  margin-bottom: 3px;
}

.footer-addr {
  font-family: var(--ui-font);
  font-size: 11px;
  color: #a8946a;
  margin-bottom: 6px;
}

.footer-copy {
  font-family: var(--ui-font);
  font-size: 11px;
  color: #7a6440;
  letter-spacing: 0.01em;
}

.footer-right { flex-shrink: 0; }

.footer-dept {
  font-family: var(--ui-font);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--gold);
  text-align: right;
}

/* ══════════════════════════════════════════
   ANIMATIONS
   ══════════════════════════════════════════ */
@keyframes slow-spin { to { transform: rotate(360deg); } }

@keyframes pulse-dot {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(76,175,106,0.4); }
  50%       { opacity: 0.7; box-shadow: 0 0 0 4px rgba(76,175,106,0); }
}

/* ══════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════ */
@media (max-width: 800px) {
  .topbar-inner { height: auto; padding: 12px 0; flex-wrap: wrap; gap: 10px; }
  .topbar { position: static; }
  .brand-title { font-size: 11px; }
  .brand-sub { display: none; }
  .dept-badge { font-size: 8px; }
  .hero-strip { padding: 28px 16px 24px; }
  .workspace {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 16px;
    gap: 24px;
    margin: 20px auto;
  }
  .preview-area {
    order: -1;
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
  }
  aside.editor.card,
  .editor.card,
  .editor {
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    position: static;
  }
  .field-row { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; text-align: center; gap: 14px; }
  .footer-dept { text-align: center; }
}

@media (min-width: 801px) {
  .editor { position: sticky; top: 16px; }
}

/* ══════════════════════════════════════════
   PHOTO UPLOAD AREA
   ══════════════════════════════════════════ */
.photo-section { gap: 8px; display: grid; }

.photo-upload-area {
  position: relative;
  width: 100%;
  max-width: 190px;
  aspect-ratio: 35 / 45;
  margin: 0 auto;
  border: 2px dashed var(--gold-line);
  border-radius: var(--radius);
  background: var(--gold-pale);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.photo-upload-area:hover,
.photo-upload-area:focus-visible {
  border-color: var(--gold);
  background: #f9f2dc;
  box-shadow: 0 0 0 3px rgba(126,90,0,0.13);
  outline: none;
}

.photo-upload-area:active { opacity: 0.88; }

.photo-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px;
  text-align: center;
  color: var(--gold);
  pointer-events: none;
}

.photo-placeholder-icon {
  width: 52px;
  height: 52px;
  color: var(--gold);
  opacity: 0.7;
}

.photo-placeholder-label {
  font-family: var(--ui-font);
  font-size: 14px;
  font-weight: 600;
  color: var(--gold);
}

.photo-placeholder-sub {
  font-family: var(--ui-font);
  font-size: 11px;
  color: var(--ink-muted);
}

.photo-preview-thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: calc(var(--radius) - 2px);
}

.photo-clear-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: rgba(28,18,8,0.72);
  color: #fff;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  transition: background 0.15s, transform 0.15s;
  z-index: 2;
}

.photo-clear-btn:hover { background: rgba(28,18,8,0.92); transform: scale(1.1); }

.photo-thumb-overlay {
  position: absolute;
  bottom: 8px;
  left: 8px;
  right: 8px;
  display: flex;
  gap: 6px;
  z-index: 2;
}

.photo-overlay-btn {
  flex: 1;
  padding: 6px 10px;
  background: rgba(28, 18, 8, 0.85);
  border: 1px solid var(--gold);
  border-radius: 6px;
  color: var(--gold-lt);
  font-family: var(--ui-font);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  backdrop-filter: blur(4px);
  transition: background 0.15s, transform 0.12s, color 0.15s;
}

.photo-overlay-btn:hover {
  background: rgba(28, 18, 8, 0.98);
  color: #fff;
  transform: translateY(-1px);
}

/* ══════════════════════════════════════════
   PHOTO VIEWER MODAL
   ══════════════════════════════════════════ */
.photo-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(10, 7, 2, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(8px);
  animation: modal-in 0.22s ease;
}
@keyframes modal-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.photo-modal-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  max-width: min(420px, 100vw - 40px);
  width: 100%;
  animation: modal-scale-in 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes modal-scale-in {
  from { transform: scale(0.88); }
  to   { transform: scale(1); }
}
.photo-modal-img {
  width: 100%;
  max-width: 320px;
  aspect-ratio: 35 / 45;
  object-fit: cover;
  border-radius: 8px;
  border: 3px solid var(--gold);
  box-shadow: 0 20px 60px rgba(0,0,0,0.7), 0 0 0 1px rgba(180,130,0,0.25);
}
.photo-modal-meta {
  text-align: center;
}
.photo-modal-name {
  font-family: var(--ui-font);
  font-size: 16px;
  font-weight: 700;
  color: var(--gold-pale);
  margin-bottom: 3px;
}
.photo-modal-ref {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  color: #a8946a;
}
.photo-modal-close {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--ink);
  border: 2px solid var(--gold);
  color: var(--gold-lt);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
  transition: background 0.15s, transform 0.15s;
}
.photo-modal-close:hover {
  background: var(--gold);
  color: #1a0e00;
  transform: scale(1.1);
}

/* ══════════════════════════════════════════
   CROP MODAL
   ══════════════════════════════════════════ */
.crop-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #0d0a04;
  display: flex;
  flex-direction: column;
  overscroll-behavior: contain;
  touch-action: none;
}

.crop-modal-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 100dvh;
}

/* Header */
.crop-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #1a1208;
  border-bottom: 1px solid var(--gold);
  flex-shrink: 0;
  gap: 8px;
}

.crop-modal-title {
  font-family: var(--ui-font);
  font-size: 14px;
  font-weight: 700;
  color: var(--gold-pale);
  letter-spacing: 0.02em;
  text-align: center;
  flex: 1;
}

.crop-btn-ghost {
  padding: 8px 14px;
  background: transparent;
  border: 1px solid rgba(126,90,0,0.5);
  border-radius: 8px;
  color: #c8a860;
  font-family: var(--ui-font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.crop-btn-ghost:hover, .crop-btn-ghost:active { background: rgba(126,90,0,0.18); color: #f5edd8; }

.crop-btn-primary {
  padding: 8px 14px;
  background: linear-gradient(135deg, #b8872b 0%, #7e5a00 100%);
  border: 1px solid #d4aa6a;
  border-radius: 8px;
  color: #fff;
  font-family: var(--ui-font);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 3px 10px rgba(126,90,0,0.4);
  transition: transform 0.15s, box-shadow 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.crop-btn-primary:hover, .crop-btn-primary:active {
  transform: translateY(-1px);
  box-shadow: 0 5px 16px rgba(126,90,0,0.55);
}

/* Viewport */
.crop-viewport-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 12px 12px 4px;
}

.crop-viewport {
  position: relative;
  width: 100%;
  max-width: min(280px, 75vw);
  aspect-ratio: 35 / 45;
  overflow: hidden;
  border-radius: 8px;
  cursor: grab;
  touch-action: none;
  background: #ffffff;
  box-shadow: 0 0 0 2px var(--gold-lt), 0 12px 32px rgba(0,0,0,0.7);
}

.crop-viewport:active { cursor: grabbing; }

#crop-canvas {
  position: absolute;
  top: 0; left: 0;
  image-rendering: high-quality;
}

/* Overlay masking */
.crop-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* Crop box (full viewport = 35:45 passport) */
.crop-box {
  width: 100%;
  height: 100%;
  position: relative;
  border: 2px solid rgba(255,255,255,0.85);
}

/* Corner handles */
.crop-corner {
  position: absolute;
  width: 20px;
  height: 20px;
  border-color: #d4aa6a;
  border-style: solid;
}
.crop-corner.tl { top: -2px; left: -2px; border-width: 3px 0 0 3px; }
.crop-corner.tr { top: -2px; right: -2px; border-width: 3px 3px 0 0; }
.crop-corner.bl { bottom: -2px; left: -2px; border-width: 0 0 3px 3px; }
.crop-corner.br { bottom: -2px; right: -2px; border-width: 0 3px 3px 0; }

/* Passport face guide (oval) */
.crop-face-guide {
  position: absolute;
  top: 14%;
  left: 20%;
  right: 20%;
  height: 60%;
  border: 1px dashed rgba(212, 170, 106, 0.45);
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  pointer-events: none;
}

/* Rule-of-thirds grid lines */
.crop-rule-h,
.crop-rule-v {
  position: absolute;
  background: rgba(255,255,255,0.18);
  pointer-events: none;
}
.crop-rule-h { left: 0; right: 0; height: 1px; }
.crop-rule-v { top: 0; bottom: 0; width: 1px; }

.crop-hint-text {
  font-family: var(--ui-font);
  font-size: 11px;
  color: #a8946a;
  margin-top: 8px;
  letter-spacing: 0.02em;
  text-align: center;
}

/* Quick Actions Toolbar */
.crop-toolbar {
  padding: 10px 16px;
  background: #140d04;
  border-top: 1px solid rgba(126,90,0,0.3);
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
}

.crop-zoom-row {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 380px;
  margin: 0 auto;
  width: 100%;
}

.crop-tool-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(126,90,0,0.22);
  border: 1px solid rgba(212,170,106,0.4);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}
.crop-tool-btn:active {
  background: var(--gold);
  transform: scale(0.92);
}

.crop-action-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.crop-tool-pill {
  padding: 7px 14px;
  border-radius: 20px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(212,170,106,0.35);
  color: var(--gold-pale);
  font-family: var(--ui-font);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s, color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.crop-tool-pill:hover,
.crop-tool-pill:active {
  background: rgba(126,90,0,0.28);
  color: #fff;
}
.crop-tool-pill.active {
  background: var(--gold);
  color: #1a0e00;
  border-color: var(--gold-lt);
}

/* Controls */
.crop-controls {
  padding: 12px 20px 16px;
  background: #1a1208;
  border-top: 1px solid rgba(126,90,0,0.3);
  display: grid;
  gap: 12px;
  flex-shrink: 0;
}

.crop-slider-group { display: grid; gap: 6px; }

.crop-slider-label {
  display: flex;
  justify-content: space-between;
  font-family: var(--ui-font);
  font-size: 12px;
  font-weight: 600;
  color: #c8a860;
  letter-spacing: 0.01em;
}

.crop-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 4px;
  background: rgba(126,90,0,0.35);
  outline: none;
  cursor: pointer;
  accent-color: var(--gold-lt);
}

.crop-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, #d4aa6a 0%, #8a6300 100%);
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

.crop-slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, #d4aa6a 0%, #8a6300 100%);
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

/* Compact on very small screens */
@media (max-height: 640px) {
  .crop-controls { padding: 10px 16px 12px; gap: 8px; }
  .crop-slider-label { font-size: 11px; }
  .crop-modal-header { padding: 8px 12px; }
}

