/* ═══════════════════════════════════════════════════════════════════

   ═══════════════════════════════════════════════════════════════════ */

/* ── Tokens ── */
:root {
    --red:    #C0392B;
    --blue:   #1A3A6B;
    --gold:   #D4A017;
    --light:  #FFF5F5;
    --white:  #FFFFFF;
    --text:   #1e2d3d;
    --muted:  #6b7280;
    --radius: 18px;
    --shadow: 0 8px 40px rgba(26,58,107,0.15), 0 1px 4px rgba(0,0,0,0.05);
    --trans:  all 0.25s ease;
}
:root {
    --primary: #1a3a6b;
    --secondary: #c0392b;
    --accent: #f5b301;
    --bg: #f6f8ff;
    --card: #ffffff;
    --text: #1e2d3d;
    --muted: #6b7280;
    --radius: 16px;
    --shadow: 0 10px 30px rgba(0,0,0,0.08);
    --transition: all 0.25s ease;
}

/* ── Reset / base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
    background: linear-gradient(145deg,
        #fde8e7 0%,
        #edf2ff 35%,
        #fdf8ec 65%,
        #edf2ff 100%
    );
    min-height: 100vh;
    font-family: 'Noto Sans', 'Noto Sans Devanagari', sans-serif;
    color: var(--text);
    padding: 16px;
}

.ne { font-family: 'Noto Sans Devanagari', 'Noto Sans', sans-serif; }

/* ── Main card ── */
main {
    max-width: 820px;
    margin: 0 auto;
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid rgba(26,58,107,0.1);
    margin-bottom: 32px;
}

/* ── Header ── */
/* header {
    background: linear-gradient(135deg, var(--red), #8e1a12);
    padding: 18px 24px;
} */
 header {
    background: linear-gradient(135deg, #274c8a);
    padding: 18px 24px;
    /* background: linear-gradient(135deg, var(--primary), #274c8a); */
}
.header-inner {
   
    align-items: center;
    justify-content: space-between;
}
.logo img {
    height: 64px;
    width: auto;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.3));
    transition: var(--trans);
}
.logo img:hover { transform: scale(1.04); }
.event-badge {
    text-align: center;
    color: white;
    font-weight: 800;
    font-size: 1.1em;
    padding: 6px 18px;
    border-radius: 50px;
    letter-spacing: 1px;
   
}

/* ── Hero ── */
/* â”€â”€ Hero â”€â”€ */
.hero {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(180deg, #eef3ff, #ffffff);
}
.hero::before {
    content: '';
    position: absolute;
    width: 340px; height: 340px;
    background: radial-gradient(circle, rgba(192,57,43,0.1) 0%, transparent 68%);
    top: -140px; right: -100px;
    border-radius: 50%;
    pointer-events: none;
}
.hero::after {
    content: '';
    position: absolute;
    width: 260px; height: 260px;
    background: radial-gradient(circle, rgba(26,58,107,0.08) 0%, transparent 68%);
    bottom: -100px; left: -70px;
    border-radius: 50%;
    pointer-events: none;
}
.hero-stripe {
    position: absolute; top: 0; height: 6px; width: 100%; left: 0;
    z-index: 1;
}
.hero-stripe.red  { background: #14dd5b;  top: 0; }
.hero-stripe.blue { background: var(--blue); top: 6px; height: 4px; }
h1 {
    font-size: clamp(1.6em, 4vw, 2.4em);
    font-weight: 800;
    color: var(--blue);
    line-height: 1.25;
    margin-bottom: 14px;
}
h1 .ne {
    display: block;
    font-size: 0.72em;
    color: var(--red);
    font-weight: 700;
    margin-top: 6px;
}
.hero-sub {
    color: black;
    font-size: 1.05em;
    line-height: 1.6;
    max-width: 560px;
    margin: 0 auto 6px;
}
.hero-sub.ne { color: var(--red); font-size: 0.95em; }
.event-chips {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 20px;
}
.chip {
    background: var(--blue);
    color: var(--white);
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 0.85em;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* ── Stepper ── */
.stepper {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 0;
    padding: 28px 20px 10px;
    background: linear-gradient(180deg, #3354c1 0%, #f9fafb 100%);
    border-bottom: 1px solid #e0e7ff;
}
.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    min-width: 80px;
    opacity: 0.45;
    transition: var(--trans);
}
.step.active, .step.done { opacity: 1; }
.step-circle {
    width: 40px; height: 40px;
    border-radius: 50%;
    border: 2.5px solid #d1d5db;
    background: var(--white);
    font-weight: 700;
    font-size: 1em;
    display: flex; align-items: center; justify-content: center;
    transition: var(--trans);
    color: #9ca3af;
}
.step.active .step-circle {
    background: var(--red);
    border-color: var(--red);
    color: var(--white);
    box-shadow: 0 4px 14px rgba(192,57,43,0.4);
}
.step.done .step-circle {
    background: #20d115;
    border-color: var(--blue);
    color: var(--white);
}
.step.done .step-circle::before { content: "\2713"; }
.step-text {
    font-size: 0.75em;
    text-align: center;
    color: var(--muted);
    line-height: 1.4;
}
.step.active .step-text { color: var(--red); font-weight: 600; }
.step.done  .step-text  { color: var(--blue); font-weight: 600; }
.step-line {
    flex: 1;
    height: 2px;
    background: #e5e7eb;
    margin-top: 19px;
    min-width: 24px;
    transition: var(--trans);
}
.step-line.done { background: var(--blue); }

/* ── Section cards ── */
.section-card {
    padding: 32px 28px;
    border-bottom: 1px solid #f3f4f6;
    position: relative;
}
.section-card:last-of-type {border-bottom: none;background: linear-gradient(135deg,#0f2027,#203a43,#2c5364);}
.section-num {
    position: absolute;
    top: 20px; right: 24px;
    font-size: 3em;
    font-weight: 800;
    color: #f3f4f6;
    line-height: 1;
    pointer-events: none;
    
}
.section-title {
    font-size: 1.25em;
    font-weight: 700;
    color: #ff57f1;
    margin-bottom: 22px;
    padding-left: 14px;
    border-left: 4px solid var(--red);
}
.section-title .ne {color: #fbcc5e;}

/* ── Template grid ── */
.template-grid {
    display: flex;
    justify-content: center;
    gap: 18px;
    flex-wrap: wrap;
}
.template-option {
    border: 2.5px solid #e5e7eb;
    border-radius: 14px;
    padding: 12px;
    cursor: pointer;
    transition: var(--trans);
    background: #fafafa;
    text-align: center;
    min-width: 110px;
}
.template-option:hover {
    border-color: var(--red);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(192,57,43,0.15);
}
.template-option.active {
    border-color: var(--red);
    background: var(--light);
    box-shadow: 0 8px 24px rgba(192,57,43,0.2);
}
.tpl-img-wrap { width: 90px; height: 90px; overflow: hidden; border-radius: 10px; margin: 0 auto 8px; }
.tpl-img-wrap img { width: 100%; height: 100%; object-fit: cover; }
.template-option span { font-size: 0.85em; font-weight: 600; color: var(--muted); }
.template-option.active span { color: var(--red); }

/* ── Drop zone ── */
.inputfile { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; z-index: -1; }
.drop-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 2.5px dashed #d1d5db;
    border-radius: var(--radius);
    padding: 44px 24px;
    cursor: pointer;
    transition: var(--trans);
    background: #fafafa;
    text-align: center;
}
.drop-zone:hover, .drop-zone.drag-over {
    border-color: var(--red);
    background: var(--light);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(192,57,43,0.12);
}
.drop-zone.drag-over { border-style: solid; }
.drop-icon { font-size: 3em; line-height: 1; }
.drop-main { font-size: 1.05em; color: var(--text); font-weight: 500; }
.drop-main strong { color: var(--red); }
.drop-ne { font-size: 0.9em; color: var(--red); }
.drop-hint { font-size: 0.82em; color: var(--muted); margin-top: 4px; }

/* ── Photo frame preview ── */
.photo-frame {
    width: min(85%, 480px);
    margin: 0 auto 22px;
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
    box-shadow: 0 12px 36px rgba(0,0,0,0.12);
    border: 3px solid #e5e7eb;
    transition: var(--trans);
}
.photo-frame:hover { box-shadow: 0 16px 48px rgba(0,0,0,0.18); }
#overlay-img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 0;
    transition: var(--trans);
}
#overlay-img.frame-ready { border: none; }

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 14px 28px;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 700;
    font-family: inherit;
    letter-spacing: 0.4px;
    transition: var(--trans);
    white-space: nowrap;
    text-decoration: none;
}
.btn:active { transform: scale(0.97); }

.download-btn {background: linear-gradient(135deg, #dd1667, #8d1d9b);color: var(--white);box-shadow: 0 6px 20px rgba(26,58,107,0.35);}
.download-btn:hover { box-shadow: 0 10px 28px rgba(26,58,107,0.5); transform: translateY(-2px); }

.share-fb-btn { background: linear-gradient(135deg, #1877f2, #0d5ed9); color: var(--white); box-shadow: 0 6px 20px rgba(24,119,242,0.35); }
.share-fb-btn:hover { box-shadow: 0 10px 28px rgba(24,119,242,0.5); transform: translateY(-2px); }

.copy-btn { background: linear-gradient(135deg, var(--gold), #b8860b); color: #1a1a1a; box-shadow: 0 6px 20px rgba(212,160,23,0.35); }
.copy-btn:hover { box-shadow: 0 10px 28px rgba(212,160,23,0.5); transform: translateY(-2px); }

.apply-btn { background: linear-gradient(135deg, var(--red), #e74c3c); color: var(--white); box-shadow: 0 6px 18px rgba(192,57,43,0.35); }
.apply-btn:hover { box-shadow: 0 10px 24px rgba(192,57,43,0.5); transform: translateY(-2px); }

.ghost-btn {/* background: #595d5800; */color: #1a1a1a;border: 2px solid #e5e7eb;}
.ghost-btn:hover { border-color: var(--red); color: var(--red); }

.btn-icon { width: 16px; height: 16px; }

/* ── Action row ── */
.action-row {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}
.restart-row { text-align: center; margin-top: 8px; }

/* ── Processing overlay ── */
#processing-overlay {
    position: fixed;
    inset: 0;
    z-index: 9000;
    background: rgba(26,58,107,0.6);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
}
.processing-card {
    background: var(--white);
    border-radius: 20px;
    padding: 40px 48px;
    text-align: center;
    box-shadow: 0 25px 60px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}
.processing-spinner {
    width: 54px; height: 54px;
    border: 4px solid #e5e7eb;
    border-top-color: var(--red);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
.processing-text { font-size: 1.1em; font-weight: 700; color: var(--blue); }
.processing-sub  { font-size: 0.9em; color: var(--muted); }

/* ── Crop Modal ── */
#crop-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    align-items: center;
    justify-content: center;
}
#crop-modal.open { display: flex; }

.crop-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.72);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
}
.crop-box {
    position: relative;
    z-index: 1;
    background: var(--white);
    border-radius: 20px;
    padding: 24px 22px 20px;
    width: 92%;
    max-width: 560px;
    box-shadow: 0 30px 70px rgba(0,0,0,0.35);
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: 92vh;
    overflow-y: auto;
}
.crop-header { display: flex; align-items: center; justify-content: space-between; }
.crop-header h3 { font-size: 1em; font-weight: 700; color: #00ed56; }
.crop-header h3 .ne { color: #f00cf1; font-weight: 600; }
.crop-close {
    background: none; border: none; font-size: 1.6em; cursor: pointer; color: var(--muted);
    line-height: 1; padding: 2px 6px; border-radius: 6px; transition: var(--trans);
}
.crop-close:hover { background: #fee2e2; color: var(--red); }

.crop-aspect-row { display: flex; gap: 8px; flex-wrap: wrap; }
.aspect-pill {
    padding: 6px 16px;
    border-radius: 50px;
    border: 2px solid #e5e7eb;
    background: #f9fafb;
    font-size: 0.82em;
    font-weight: 600;
    cursor: pointer;
    transition: var(--trans);
    font-family: inherit;
}
.aspect-pill:hover { border-color: var(--red); color: var(--red); }
.aspect-pill.active { background: var(--red); border-color: var(--red); color: var(--white); }

.crop-img-wrap {
    width: 100%;
    max-height: 52vh;
    overflow: hidden;
    border-radius: 12px;
    background: #111;
}
.crop-img-wrap img { display: block; max-width: 100%; }

.crop-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }

/* ── Toast ── */
#toast-container {
    position: fixed;
    bottom: 24px; right: 24px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}
.toast {
    background: #1e2d3d;
    color: var(--white);
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 0.92em;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
    transform: translateX(120%);
    transition: transform 0.35s cubic-bezier(.34,1.56,.64,1), opacity 0.35s ease;
    opacity: 0;
    max-width: 280px;
    border-left: 4px solid #4b5563;
}
.toast.toast-show { transform: translateX(0); opacity: 1; }
.toast.toast-success { border-left-color: #22c55e; }
.toast.toast-error   { border-left-color: var(--red); }
.toast.toast-info    { border-left-color: var(--blue); }

/* ── Company logo bar ── */
.company-logo-bar {
    padding: 32px 24px;
    text-align: center;
    border-top: 1px solid #f0f0f0;
    background: #fafbfc;
}
.company-logo-bar img {
    width: 90%;
    max-width: 680px;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.1));
}

@media (max-width: 600px) {
    .company-logo-bar { padding: 24px 16px; }
    .company-logo-bar img { width: 95%; }
}

/* ── Footer ── */
/* ── FOOTER ── */
.site-footer {
    text-align: center;
    padding: 30px;
    background: var(--primary);
    color: white;
}
.footer-flag { font-size: 3em; margin-bottom: 10px; }
.site-footer h3 {font-size: 1.4em;font-weight: 800;color: white;margin-bottom: 8px;}
.site-footer .ne {font-size: 1.4em;margin-bottom: 12px;color: white;}
.footer-credit {font-size: 0.95em;color: #efd50c;margin-top: 16px;}
.footer-credit strong { color: #efd50c; }

/* ── Loader (spinner keyframe) ── */
@keyframes spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* ── Position Modal ── */
#position-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    align-items: center;
    justify-content: center;
}
#position-modal.open { display: flex; }

.position-box {
    position: relative;
    z-index: 1;
    background: linear-gradient(135deg, #408dad, #1f4a59, #296179);
    border-radius: 20px;
    padding: 22px 18px 18px;
    width: 96%;
    max-width: 580px;
    box-shadow: 0 30px 70px rgba(0,0,0,0.4);
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 96vh;
    overflow-y: auto;
}
.position-hint {
    font-size: 0.82em;
    color: white;
    text-align: center;
    margin: -4px 0 0;
}
.position-canvas-wrap {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #111;
    border-radius: 12px;
    overflow: hidden;
    min-height: 180px;
}
#position-canvas {
    display: block;
    cursor: grab;
    max-width: 100%;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}
#position-canvas:active { cursor: grabbing; }
.position-controls {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
}
.sm-btn {
    padding: 7px 13px !important;
    font-size: 0.8em !important;
    font-weight: 600 !important;
}

/* ── Responsive ── */
@media (max-width: 600px) {
    body { padding: 8px; }
    .hero { padding: 36px 18px 28px; }
    .section-card { padding: 24px 16px; }
    .template-grid { gap: 12px; }
    .tpl-img-wrap { width: 72px; height: 72px; }
    .action-row { flex-direction: column; align-items: stretch; }
    .btn { justify-content: center; }
    .stepper { padding: 20px 12px 8px; gap: 0; }
    .step { min-width: 60px; }
    .step-text { font-size: 0.68em; }
    .step-circle { width: 32px; height: 32px; font-size: 0.85em; }
    .step-line { margin-top: 15px; min-width: 12px; }
    .crop-actions { justify-content: stretch; }
    .crop-actions .btn { flex: 1; }
    #toast-container { bottom: 12px; right: 12px; left: 12px; }
    .toast { max-width: 100%; }
}