:root {
    --md-primary: #6750A4;
    --md-on-primary: #FFFFFF;
    --md-secondary: #625B71;
    --md-surface: #FFF;
    --md-surface-variant: #F3EDF7;
    --md-outline: #79747E;
    --md-error: #B00020;

    --elev-1: 0 1px 3px rgba(0, 0, 0, .12), 0 1px 2px rgba(0, 0, 0, .24);
    --elev-3: 0 10px 20px rgba(0, 0, 0, .19), 0 6px 6px rgba(0, 0, 0, .23);

    --font-sans: "Inter", system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, sans-serif;

    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --radius: 12px;
}

* {
    box-sizing: border-box
}

html,
body {
    height: 100%
}

body {
    margin: 0;
    font-family: var(--font-sans);
    color: #1D1B20;
    background: #fafafa;
    line-height: 1.4;
}

/* Top App Bar */
.appbar {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--md-surface);
    box-shadow: var(--elev-1)
}

.appbar__inner {
    margin: 0 auto;
    padding: var(--space-4) 24px;
    display: flex;
    align-items: center;
    gap: var(--space-4)
}

.appbar__title {
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: .2px
}

.appbar__spacer {
    flex: 1
}

.icon-btn {
    border: none;
    background: transparent;
    padding: var(--space-2);
    border-radius: 50%;
    cursor: pointer;
    position: relative
}

.material-symbols-rounded {
    font-variation-settings: "FILL" 0, "wght" 500, "GRAD" 0, "opsz" 24
}

.icon-btn:focus-visible {
    outline: 2px solid var(--md-primary)
}

/* Layout grid */
.container {
    /* max-width: 1100px; */
    max-width: 100%;
    margin: 0 auto;
    padding: var(--space-6) var(--space-4)
}

.grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-6)
}

.pict__inside {
    height: 100%;
    width: 100%;
    object-fit: cover;
}

@media (min-width:900px) {
    .grid {
        grid-template-columns: 420px 1fr
    }
}

/* Cards */
.card {
    background: var(--md-surface);
    border-radius: var(--radius);
    box-shadow: var(--elev-1);
    overflow: hidden
}

.card-output {
    width: 600px;
    height: 400px;
    aspect-ratio: 3 / 2;
    background: #fff;
    box-shadow: var(--elev-3);
    position: relative;
    overflow: hidden;
    /* add */
    display: flex;
    justify-content: center;
    align-items: center;
}

.card__header {
    padding: var(--space-5) var(--space-6) var(--space-3);
    border-bottom: 1px solid #eee;
    background: var(--md-surface-variant);
    /* added by deifr */
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card__title {
    margin: 0;
    font-weight: 700;
    font-size: 1rem
}

.card__body {
    padding: var(--space-6);
    /* display: grid; */
    gap: var(--space-5);
}

/* Form controls */
.field {
    /* display: grid; */
    gap: var(--space-2)
}

.label {
    font-size: .9rem;
    color: #3F3D45;
    font-weight: 600
}

input[type="file"],
select,
textarea,
input[type="text"] {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #ddd;
    border-radius: 10px;
    background: #fff;
    font: inherit;
    transition: border-color .15s ease, box-shadow .15s ease;
}

textarea {
    min-height: 110px;
    resize: vertical
}

select {
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, #777 50%), linear-gradient(135deg, #777 50%, transparent 50%);
    background-position: calc(100% - 18px) calc(50% - 4px), calc(100% - 12px) calc(50% - 4px);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--md-primary);
    box-shadow: 0 0 0 3px rgba(103, 80, 164, .2)
}

/* Buttons */
.actions {
    display: flex;
    gap: var(--space-4);
    flex-wrap: wrap
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    letter-spacing: .2px;
    transition: transform .02s ease, box-shadow .15s ease, background .15s ease;
    position: relative
}

.btn--primary {
    background: var(--md-primary);
    color: var(--md-on-primary);
    box-shadow: var(--elev-1)
}

.btn--cancel {
    background: var(--md-error);
    color: var(--md-on-error);
    box-shadow: var(--elev-1)
}

.btn--tonal {
    background: #EADDFF;
    color: #2B1F5D
}

.btn--outline {
    background: transparent;
    color: var(--md-primary);
    border: 1.5px solid var(--md-primary)
}

.btn:active {
    transform: scale(0.99)
}

.btn:focus-visible {
    outline: 2px solid var(--md-primary);
    outline-offset: 2px
}

.btn::after,
.icon-btn::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(closest-side, rgba(255, 255, 255, .4), transparent);
    opacity: 0;
    transition: opacity .2s ease
}

.btn:active::after,
.icon-btn:active::after {
    opacity: .6
}

/* Preview */
.preview {
    display: grid;
    grid-template-rows: auto 1fr;
    min-height: 480px;
    background: #F8F6FF
}

.preview__toolbar {
    display: flex;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    align-items: center;
    border-bottom: 1px solid #eee;
    background: var(--md-surface)
}

.preview__canvas {
    display: grid;
    place-items: center;
    padding: var(--space-6)
}

.card-output__bg img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: saturate(1.05) contrast(1.05)
}

.card-output__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(140deg, rgba(103, 80, 164, .15), rgba(255, 255, 255, .0) 40%, rgba(0, 0, 0, .25) 100%)
}

.card-output__text {
    /* position: absolute;
            bottom: 20px;
            left: 50px;
            right: 50px;
            height: 240px;
            min-width: 80%;
            background: rgba(255, 255, 255, 0.9);
            padding: 14px;
            border-radius: 12px;
            text-align: center;
            box-sizing: border-box;
            text-shadow: 0 2px 8px rgba(0, 0, 0, .35) */

    position: absolute;
    /* color: #572a31; */
    bottom: 0;
    left: 0;
    right: 0;
    min-height: 70px;
    max-width: 50%;
    padding: 0 10px;
    border-radius: 12px;
    text-align: center;
    box-sizing: border-box;
    text-shadow: 0 2px 8px rgba(0, 0, 0, .35);
}

.card-output__pict {
    /* position: absolute;
            height: 130px;
            width: 130px;
            top: 5px;
            left: 0px;
            right: 0px;
            margin: auto;
            background: #9c9c9c;
            border-radius: 50%;
            text-align: center;
            z-index: 1;
            overflow: hidden;
            display: flex;
            align-items: center;
            justify-content: center; */

    position: absolute;
    width: 200px;
    padding: 0 5px;
    bottom: 0;
    right: 13%;
    margin: auto;
    text-align: center;
    z-index: 1;
    border-radius: 10%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-output__title {
    margin: 0;
    font-weight: 700;
    font-size: clamp(20px, 4vw, 20px);
    letter-spacing: .2px;
    /* color: #572a31; */
}

.card-output__note {
    margin: 0;
    font-size: clamp(14px, 2.2vw, 15px);
    opacity: .95;

}

.card-output__footer {
    display: block;
    margin-top: 1rem;
    font-size: 14px;
    font-weight: 800;
    color: #572a31;
}

/* Footer */
footer {
    padding: var(--space-6) var(--space-4);
    text-align: center;
    color: #6B6873
}

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    display: none;
    place-items: center;
    z-index: 20
}

.modal--open {
    display: grid
}

.modal__scrim {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .4);
    z-index: -1;
}

.modal__card {
    width: min(100%, 900px);
    max-height: 85vh;
    display: grid;
    grid-template-rows: auto 1fr auto
}

.cropper-wrap {
    width: 100%;
    height: 54vh;
    margin-bottom: .5rem;
    background: #111;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 10px
}

.cropper-wrap img {
    max-width: 100%;
    max-height: 100%;
    display: block
}

.chip-set {
    display: flex;
    flex-wrap: wrap;
    gap: 8px
}

.chip {
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 999px;
    padding: 6px 12px;
    font-weight: 600;
    cursor: pointer
}

.chip--active {
    border-color: var(--md-primary);
    color: var(--md-primary)
}

.modal-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end
}

#employee_picture {
    display: none;
}

.card-output__logo {
    max-width: 150px;
    position: absolute;
    right: 3px;
    top: 3px;
}

/* Responsive adjustments for email */
@media (max-width: 600px) {
    .card-output__text {
        max-width: 100% !important;
    }

    .card-output__pict {
        width: 100px !important;
        right: 5% !important;
    }
}

/* Full page loader */
#pageLoader {
    position: fixed;
    inset: 0;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    transition: opacity 300ms ease, visibility 300ms ease;
}

#pageLoader.hidden {
    opacity: 0;
    visibility: hidden;
}

#pageLoader img {
    width: 120px;
    height: auto;
    display: block;
}

/* Fullscreen container (optional) */
.loading-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    /* semi-transparent background */
    z-index: 9999;
}

/* Rotating image */
.loading-spinner {
    width: 64px;
    /* adjust size */
    height: 64px;
    /* adjust size */
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-25px);
    }

    100% {
        transform: translateY(0);
    }
}