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

:root {
    --green: #005A2B;
    --green-dark: #003D1C;
    --green-mid: #0A7A40;
    --yellow: #F5C200;
    --red: #BA0D0D;
    --text: #1A1A1A;
    --muted: #555;
    --panel-bg: #F7FAF8;
    --border: #D8E4DC;
    --shadow: 0 20px 50px rgba(0, 0, 0, .14);

    /* ── Card scale factor. Media queries / JS override this. ── */
    --s: 1;
}

html,
body {
    font-family: 'Montserrat', 'Inter', sans-serif;
    background: #cdd9d0;
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

/* ────────────────────────────────────────────────
   Page layout
──────────────────────────────────────────────── */
.generator-wrap {
    display: flex;
    flex-direction: row;
    min-height: 100vh;
}

/* ════════════════════════════════════════════════
   Side panel
════════════════════════════════════════════════ */
.side-panel {
    width: 300px;
    flex-shrink: 0;
    background: var(--panel-bg);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.side-inner {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
    padding: 2rem 1.6rem;
}

.brand {
    display: flex;
    justify-content: center;
}

.brand-logo {
    width: 100px;
    height: auto;
    filter: drop-shadow(0 2px 6px rgba(0, 90, 43, .15));
}

.side-title {
    font-size: 1.55rem;
    font-weight: 800;
    color: var(--green);
    letter-spacing: -.4px;
    line-height: 1.2;
}

.side-sub {
    font-size: .9rem;
    color: var(--muted);
    line-height: 1.55;
    margin-top: -.4rem;
}

/* Input */
.field-group {
    display: flex;
    flex-direction: column;
    gap: .45rem;
}

.field-label {
    font-size: .82rem;
    font-weight: 600;
    color: #444;
}

.field-input {
    width: 100%;
    padding: .85rem 1rem;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    border: 2px solid #D1DDD6;
    border-radius: 10px;
    background: #fff;
    transition: border-color .2s, box-shadow .2s;
}

.field-input:focus {
    outline: none;
    border-color: var(--green-mid);
    box-shadow: 0 0 0 4px rgba(10, 122, 64, .12);
}

/* Buttons */
.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    padding: .8rem 1.2rem;
    font-size: .95rem;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: transform .15s, box-shadow .15s, background .15s;
    width: 100%;
}

.btn:active {
    transform: scale(.97);
}

.btn-primary {
    background: var(--green);
    color: #fff;
    box-shadow: 0 6px 20px rgba(0, 90, 43, .28);
}

.btn-primary:hover {
    background: var(--green-dark);
    box-shadow: 0 8px 24px rgba(0, 90, 43, .34);
}

.btn-ghost {
    background: #fff;
    color: var(--text);
    border: 2px solid var(--border);
}

.btn-ghost:hover {
    background: #F0F5F2;
}

.btn-whatsapp {
    background: #25D366;
    color: #fff;
}

.btn-whatsapp:hover {
    background: #1DAA57;
}

.btn-email {
    background: #EA4335;
    color: #fff;
}

.btn-email:hover {
    background: #C5221F;
}

/* Share section */
.share-section {
    display: flex;
    flex-direction: column;
    gap: .75rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.share-section.hidden {
    display: none;
}

.share-label {
    font-size: .85rem;
    font-weight: 600;
    color: var(--green);
}

/* ════════════════════════════════════════════════
   Preview area
════════════════════════════════════════════════ */
.preview-area {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 2.5rem;
    overflow: auto;
}

/* ════════════════════════════════════════════════
   Card scaler — sized to PORTRAIT card dimensions (750 × 1060 px)
════════════════════════════════════════════════ */
.card-scaler {
    width: calc(750px * var(--s));
    height: calc(1060px * var(--s));
    flex-shrink: 0;
    overflow: hidden;
}

/* ════════════════════════════════════════════════
   THE INVITATION CARD (PORTRAIT 750 × 1060 px)
════════════════════════════════════════════════ */
.inv-card {
    position: relative;
    width: 750px;
    height: 1060px;
    background: #FAFBF9;
    overflow: hidden;
    box-shadow: var(--shadow);
    transform: scale(var(--s));
    transform-origin: top left;
    transition: box-shadow .2s;
    box-sizing: border-box;
}

/* Suppress scale during html2canvas capture */
.inv-card.capturing {
    transform: none !important;
}

/* Authentic background image (bg.png) */
.inv-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
    user-select: none;
    z-index: 1;
}

/* Content layer */
.inv-body {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    height: 100%;
    padding: 30px 40px 14px;
    box-sizing: border-box;
}

/* 1. URNI Logo Top */
.inv-top {
    margin-top: 15px;
    margin-bottom: 8px;
    display: flex;
    justify-content: center;
}

.inv-urni-logo {
    width: 250px;
    height: auto;
    display: block;
}

/* 2. Cordial Request */
.inv-cordial {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 2.5px;
    color: #333333;
    text-transform: uppercase;
    text-align: center;
    margin-top: 15px;
    margin-bottom: 10px;
}

/* 3. Guest Name container with underline */
.inv-name-container {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-bottom: 10px;
}

.inv-guest-name {
    font-family: 'Montserrat', sans-serif;
    font-size: 2.9rem;
    font-weight: 600;
    color: #005A2B;
    letter-spacing: 1px;
    text-transform: uppercase;
    line-height: 1.15;
    word-break: break-word;
    text-align: center;
    border-bottom: 2.5px solid #005A2B;
    padding-bottom: 6px;
    min-width: 200px;
    display: inline-block;
}


.inv-to-the {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 3px;
    color: #333333;
    text-transform: uppercase;
    text-align: center;
    margin-top: 4px;
    margin-bottom: 8px;
}

/* 4. Conference Logo */
.inv-conf-wrap {
    margin-bottom: 10px;
}

.inv-conf-logo {
    width: 230px;
    height: auto;
    display: block;
}

/* 5. Theme Section */
.inv-theme-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
}

.inv-theme-badge {
    background: #005A2B;
    color: #FFFFFF;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 1.2px;
    padding: 3px 12px;
    border-radius: 4px;
    text-transform: uppercase;
}

.inv-theme-img {
    width: 380px;
    height: auto;
    display: block;
}

/* 6. Date & Venue */
.inv-date-venue {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin-bottom: 26px;
}

.inv-date-line {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.6rem;
    font-weight: 900;
}

.inv-date-red {
    color: #C01414;
    letter-spacing: -0.2px;
}

.inv-date-red sup {
    font-size: 0.6em;
    vertical-align: super;
    font-weight: 900;
}

.inv-date-dot {
    color: #1A1A1A;
    font-size: 1.4rem;
}

.inv-date-time {
    color: #1A1A1A;
    letter-spacing: 0.5px;
}

.inv-venue-line {
    font-size: 1.12rem;
    font-weight: 700;
    letter-spacing: 0.4px;
    color: #222222;
}

.inv-venue-city {
    color: #666666;
    font-weight: 600;
}

/* 7. QR Code & Registration Section */
.inv-qr-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
}

.inv-qr-box {
    padding: 6px;
    border: 2px solid #005A2B;
    border-radius: 4px;
    background: #FFFFFF;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.inv-qr-img {
    width: 145px;
    height: 145px;
    display: block;
}

.inv-register-badge {
    background: #BA0D0D;
    color: #FFFFFF;
    font-weight: 800;
    font-size: 0.85rem;
    letter-spacing: 1px;
    padding: 8px 30px;
    border-radius: 3px;
    text-transform: uppercase;
}

.inv-url-pill {
    border: 1.5px solid #005A2B;
    color: #005A2B;
    font-weight: 800;
    font-size: 0.95rem;
    padding: 6px 26px;
    border-radius: 3px;
}

/* 8. Yellow Footer Bar matching screenshot */
.inv-footer-wrapper {
    width: calc(100% + 16px);
    margin-left: -8px;
    margin-right: -8px;
    display: flex;
    align-items: stretch;
    margin-top: auto;
    margin-bottom: 12px;
}

.inv-footer-cap {
    width: 14px;
    background: #DCA700;
    flex-shrink: 0;
}

.inv-footer-bar {
    flex: 1;
    background: #F5C200;
    padding: 8px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-sizing: border-box;
}

.inv-footer-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.inv-footer-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.8px;
    color: #111111;
    font-family: 'Montserrat', sans-serif;
}

.inv-footer-phones {
    font-size: 1.15rem;
    font-weight: 900;
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: 'Montserrat', sans-serif;
}

.inv-phone-green {
    color: #005A2B;
    font-weight: 800;
}

.inv-phone-or {
    color: #1A1A1A;
    font-size: 0.88rem;
    font-weight: 800;
}

.inv-footer-right {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.inv-socials {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #1A1A1A;
}

.inv-social-icon {
    width: 19px;
    height: 19px;
    background: #1A1A1A;
    color: #F5C200;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.inv-handle {
    font-size: 0.9rem;
    font-weight: 700;
    color: #1A1A1A;
    font-family: 'Montserrat', sans-serif;
}

/* 9. Tagline below yellow bar */
.inv-tagline {
    font-size: 0.85rem;
    font-weight: 800;
    color: #004822;
    text-align: center;
    margin-bottom: 2px;
    font-family: 'Montserrat', sans-serif;
}

/* ════════════════════════════════════════════════
   RESPONSIVE MEDIA QUERIES
════════════════════════════════════════════════ */

@media (max-width: 1100px) {
    :root {
        --s: 0.85;
    }
}

@media (max-width: 960px) {
    .generator-wrap {
        flex-direction: column;
    }

    .side-panel {
        width: 100%;
        height: auto;
        position: static;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .side-inner {
        padding: 1.25rem 1.5rem;
        gap: .85rem;
    }

    .brand {
        display: none;
    }

    .side-title {
        font-size: 1.3rem;
    }

    .side-sub {
        font-size: .85rem;
        margin-top: -.3rem;
    }

    .preview-area {
        padding: 1.5rem;
        justify-content: center;
        align-items: center;
    }

    :root {
        --s: 0.78;
    }
}

@media (max-width: 800px) {
    :root {
        --s: 0.70;
    }
}

@media (max-width: 680px) {
    .side-inner {
        padding: 1rem 1.25rem;
        gap: .7rem;
    }

    .field-input {
        padding: .7rem .9rem;
        font-size: .93rem;
    }

    .btn {
        padding: .7rem 1rem;
        font-size: .88rem;
    }

    .preview-area {
        padding: 1rem;
    }

    :root {
        --s: 0.60;
    }
}

@media (max-width: 540px) {
    :root {
        --s: 0.50;
    }
}

@media (max-width: 440px) {
    :root {
        --s: 0.40;
    }
}

@media (max-width: 360px) {
    .preview-area {
        padding: .5rem;
    }

    :root {
        --s: 0.33;
    }
}

/* Email delivery block */
.email-block {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.email-input {
    padding: .7rem .9rem;
    font-size: .9rem;
}