@font-face {
    font-family: "Agenor";
    src: url("../font/AgenorNeue-Regular.woff") format("woff");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
* {
    padding: 0;
    margin: 0;
}
body {
    background: #a855f7;
    color: #fff;
    font-family: "Agenor", sans-serif;
    text-align: center;
}

body.overlay-open {
    overflow: hidden;
}

.hidden {
    display: none !important;
}
.btn {
    background: transparent;
    background-image: url(../img/btn-bg.webp);
    background-size: cover; /* or contain */
    background-repeat: no-repeat;
    background-position: center;
    font-family: "Agenor", sans-serif;
    font-size: 3.2vw;
    letter-spacing: 0.2vw;
    text-transform: uppercase;
    padding: 0.2vw 0 0;
    cursor: pointer;
    margin: 10px;
    border: none;
    color: #fff;
    width: 30vw;
    height: 10vw;
}
.form-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 1vw;
    margin-top: 1vw;
}
.form-actions .btn {
    margin: 0;
}
.result-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 1vw;
    margin-top: 2vw;
}
.result-actions .btn {
    margin: 0;
}
.share-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5vw;
    background: rgba(0, 0, 0, 0.75);
}
.share-modal.hidden {
    display: none !important;
}

.share-qr-frame {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 3vw;
    border-radius: 1vw;
    background: #fff;
    padding: 2vw;
    max-width: 280px;
    width: 70vw;
    min-height: 280px;
    max-height: 280px;
    box-sizing: border-box;
    overflow: hidden;
}
.share-qr-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 14px;
    letter-spacing: 0.06em;
    color: #000;
    text-align: center;
    padding: 2vw;
    margin: 0;
    animation: loader-pulse 1.5s ease-in-out infinite;
    z-index: 2;
}
.share-qr-loading.hidden {
    display: none;
}
.share-modal-content img#share-qr {
    display: block;
    position: relative;
    z-index: 1;
    margin: 0;
    border-radius: 0;
    background: transparent;
    padding: 0;
    max-width: 100%;
    width: 100%;
    height: auto;
}
.share-modal-content img#share-qr.hidden {
    display: none;
}

.template-img {
    cursor: pointer;
}
.template-img:hover {
    border: 2px solid #1e90ff;
    transform: scale(1.05);
}
video,
img {
    width: 300px;
    border-radius: 8px;
    margin-top: 15px;
}

/*Theming Styles*/
.container {
    max-width: 1200px;
    margin: auto;
    background-image: url(../img/bg-amazon.webp);
    background-size: cover;
    background-position: center bottom;
    background-repeat: no-repeat;
    min-height: 100vh;
    padding: 2.5vw 5vw 5vw;
}

.container:has(#welcome-screen:not(.hidden)) {
    max-width: none;
    width: 100%;
    padding: 0;
    background-size: cover;
    background-position: center bottom;
}

/* Welcome / Start Screen */
#welcome-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 430px;
    min-height: 100vh;
    margin: 0 auto;
    padding: 18px 22px 40px;
    box-sizing: border-box;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

.welcome-logos {
    display: flex;
    align-items: flex-end;
    align-self: flex-start;
    gap: 18px;
    width: 100%;
    margin-bottom: 18px;
}

.welcome-logos img {
    width: auto;
    height: 68px;
    margin-top: 0;
    border-radius: 0;
    object-fit: contain;
}

.welcome-header {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    margin-bottom: 14px;
}

.welcome-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.title-ai {
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 86px;
    font-weight: 700;
    line-height: 0.82;
    letter-spacing: -0.04em;
    text-transform: uppercase;
}

.title-divider {
    display: block;
    width: 2px;
    height: 68px;
    background: #fff;
    flex-shrink: 0;
}

.title-details {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 7px;
}

.title-badge {
    display: inline-block;
    background: #fff;
    color: #111;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.01em;
    padding: 5px 9px;
    border-radius: 3px;
    line-height: 1.1;
    white-space: nowrap;
}

.title-edition {
    display: flex;
    align-items: center;
    gap: 8px;
}

.title-location {
    font-size: 15px;
    font-weight: 400;
    line-height: 1.05;
    letter-spacing: 0.02em;
    text-align: left;
    text-transform: none;
}

.title-year {
    font-size: 15px;
    font-weight: 400;
    letter-spacing: 0.04em;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    line-height: 1;
}

.welcome-tagline {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    line-height: 1.5;
    margin: 0;
    padding: 0;
}

.start-banner {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin: 6px 0 36px;
}

.start-banner img {
    width: 100%;
    max-width: 100%;
    height: auto;
    border: none;
    border-radius: 0;
    margin-top: 0;
}

.btn-start,
.btn-primary,
.screen-overlay .btn,
.share-modal-content .btn {
    background: #7c3aed;
    background-image: none;
    width: auto;
    max-width: none;
    height: auto;
    min-height: 0;
    padding: 14px 45px 12px;
    border: 1px solid #fff;
    border-radius: 15px;
    box-shadow: none;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 1px;
    text-indent: 0;
    text-transform: uppercase;
    margin: 0;
    box-sizing: border-box;
    cursor: pointer;
    color: #fff;
}

.btn-start:hover,
.btn-primary:hover,
.screen-overlay .btn:hover,
.share-modal-content .btn:hover {
    background: #6d28d9;
    box-shadow: none;
}

.btn-start {
    margin: 0 auto 12vh;
    flex-shrink: 0;
}

#welcome-screen .btn.btn-start {
    margin: 0 auto 12vh;
}

.screen-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-y: auto;
    padding: 24px 22px 40px;
    box-sizing: border-box;
    background-image: url(../img/bg-amazon.webp);
    background-size: cover;
    background-position: center bottom;
    background-repeat: no-repeat;
    background-color: #a855f7;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

.screen-overlay.hidden {
    display: none !important;
}

#user-form-screen {
    z-index: 200;
}

#template-screen {
    z-index: 300;
    justify-content: flex-start;
    align-items: stretch;
    padding: 24px 22px 32px;
}

#template-screen h2 {
    margin-bottom: 16px;
    flex-shrink: 0;
    max-width: none;
    width: 100%;
}

#template-screen #templates {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    column-gap: 10px;
    row-gap: 10px;
    width: 100%;
    max-width: none;
    margin: 0 0 16px;
    flex: 0 1 auto;
}

#template-screen .template-frame {
    position: relative;
    width: 100%;
    max-width: none;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    flex: unset;
    box-sizing: border-box;
    cursor: pointer;
}

#template-screen .template-frame.selected {
    box-shadow: inset 0 0 0 3px #fff;
}

#template-screen .template-frame::after {
    content: "";
    background-image: url(../img/template-frame.webp);
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-position: center center;
    display: block;
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

#template-screen .template-frame.selected::before {
    content: "✓";
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    height: 28px;
    width: 28px;
    right: 6px;
    top: 6px;
    z-index: 3;
    pointer-events: none;
    background: #fff;
    color: #7c3aed;
    border-radius: 50%;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
}

#template-screen #templates img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    margin: 0;
    border-radius: 0;
    display: block;
}

#template-screen #template-continue-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #7c3aed;
    background-image: none;
    width: auto;
    height: auto;
    min-height: 0;
    padding: 14px 45px 12px;
    border: 1px solid #fff;
    border-radius: 15px;
    box-shadow: none;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 1px;
    line-height: 1;
    text-indent: 0;
    text-transform: uppercase;
    margin: 0 auto;
    flex-shrink: 0;
    cursor: pointer;
    color: #fff;
    align-self: center;
}

#template-screen #template-continue-btn:hover {
    background: #6d28d9;
}

#photo-screen {
    z-index: 400;
    justify-content: flex-start;
    padding-bottom: 48px;
}

#loading {
    z-index: 500;
    justify-content: flex-start;
    padding: 24px 22px 40px;
}

#result-screen {
    z-index: 600;
}

.screen-overlay h2 {
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.08em;
    line-height: 1.35;
    text-transform: uppercase;
    margin: 8px 0 20px;
    max-width: 430px;
    width: 100%;
}

.screen-overlay .screen-content {
    width: 100%;
    max-width: 430px;
}

.screen-overlay .form-actions,
.screen-overlay .result-actions,
.screen-overlay .photo-screen-btns {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 0;
    width: 100%;
    max-width: 430px;
}

#user-form-screen form {
    width: 100%;
    max-width: 430px;
}

#user-form-screen .user-form {
    margin: 0 auto 20px;
    padding: 20px;
    max-width: none;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

#user-form-screen .user-form label,
#user-form-screen .user-form .radio-label {
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.06em;
    margin-bottom: 8px;
}

#user-form-screen .user-form input:not([type="radio"]) {
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 16px;
    padding: 10px 12px;
    width: calc(100% - 28px);
    margin-bottom: 16px;
    border-radius: 6px;
}

#user-form-screen .user-form .radio-container {
    display: flex;
    align-items: center;
    gap: 28px;
    margin-top: 6px;
}

#user-form-screen .user-form .radio-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    line-height: 1;
    margin-bottom: 0;
    margin-right: 0;
    padding-left: 0;
    width: auto;
    cursor: pointer;
    position: static;
}

#user-form-screen .user-form input[type="radio"] {
    width: 16px;
    height: 16px;
    min-width: 16px;
    margin: 0;
    padding: 0;
    flex-shrink: 0;
    position: static;
    accent-color: #fff;
    cursor: pointer;
    vertical-align: middle;
}

#user-form-screen .form-actions {
    margin-top: 0;
    gap: 16px;
}

#photo-screen .photo-input {
    position: relative;
    width: min(300px, 88vw);
    height: min(375px, 110vw);
    margin: 0 auto 24px;
    overflow: hidden;
    flex-shrink: 0;
}

#photo-screen .photo-input video,
#photo-screen .photo-input img#preview {
    position: absolute;
    top: 10%;
    left: 7%;
    width: 86%;
    height: 80%;
    object-fit: cover;
    object-position: center;
    transform: scaleX(-1);
    margin: 0;
    border-radius: 0;
}

#photo-screen .photo-input img#preview {
    z-index: 1;
}

#photo-screen .photo-input::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url(../img/capture-frame.webp);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center center;
    transform: scaleX(-1);
    z-index: 2;
    pointer-events: none;
}

#photo-screen .photo-screen-btns {
    flex-direction: column;
    gap: 12px;
}

#photo-screen .photo-screen-btns .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #7c3aed;
    background-image: none;
    width: auto;
    height: auto;
    min-height: 0;
    padding: 14px 45px 12px;
    border: 1px solid #fff;
    border-radius: 15px;
    box-shadow: none;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 1px;
    line-height: 1;
    text-indent: 0;
    text-transform: uppercase;
    margin: 0;
    cursor: pointer;
    color: #fff;
}

#photo-screen .photo-screen-btns .btn:hover {
    background: #6d28d9;
}

#loading .loader {
    width: 72px;
    height: 72px;
    margin: 24px auto 20px;
    border: 4px solid rgba(255, 255, 255, 0.15);
    border-top-color: #ffffff;
    border-right-color: #5dd4e8;
    border-radius: 50%;
    animation: loader-spin 0.85s linear infinite;
    box-shadow: 0 0 30px rgba(93, 212, 232, 0.45);
}

#loading .loader-text {
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 14px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.9);
    animation: loader-pulse 1.5s ease-in-out infinite;
}

#result-screen .result-img-frame {
    position: relative;
    margin: 0 auto 20px;
    width: max-content;
    max-width: 100%;
}

#result-screen .result-img-frame img {
    margin: 0;
    max-width: min(320px, 85vw);
    width: auto;
    height: auto;
}

.share-modal-content {
    background: rgba(0, 0, 0, 0.35);
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 16px;
    padding: 28px 24px;
    max-width: 420px;
    width: 100%;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

.share-modal-content h3 {
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 20px;
}

.share-hint {
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 13px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 20px;
}

h2 {
    font-family: "Agenor", sans-serif;
    font-size: 4.2vw;
    letter-spacing: 0.4vw;
    text-transform: uppercase;
}
.user-form {
    background: #00000051;
    padding: 4vw;
    border-radius: 2vw;
    border: 2px solid #7a7496;
    max-width: 800px;
    margin: 6vw auto 4vw;
}
.user-form label {
    text-align: left;
    display: block;
    width: 100%;
    text-transform: uppercase;
    font-size: 2.35vw;
    letter-spacing: 0.1vw;
    margin-bottom: 1vw;
}
.user-form input {
    text-align: left;
    display: block;
    width: calc(100% - 4.5vw);
    margin: 0;
    background: #817f8e;
    border: 2px solid #c9c8cf;
    border-radius: 0.8vw;
    outline: none;
    padding: 1.2vw 2vw;
    font-size: 2.5vw;
    color: #fff;
    margin-bottom: 2.5vw;
}
.user-form input[type="radio"] {
    text-align: left;
    display: inline-block;
    width: auto;
    margin: 0;
    border: 0;
    margin-bottom: 0;
}
.user-form .radio-label {
    font-size: 1.8vw;
    width: fit-content;
    margin-right: 2.5vw;
}
.user-form .radio-container {
    display: flex;
}

#templates {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5vw;
    margin: 1.2vw auto;
    max-width: 95vw;
}
#templates .template-frame {
    position: relative;
    flex: 0 0 calc(33.333% - 1vw);
    max-width: 100%;
    box-sizing: border-box;
}
#templates .template-frame::after {
    content: " ";
    background-image: url(../img/template-frame.webp);
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center center;
    padding: 0 1vw;
    display: block;
    position: absolute;
    height: 100%;
    width: 100%;
    left: 0;
    top: 0;
}
#templates .template-frame.selected {
    box-shadow: inset 0 0 0 3px #fff;
}

#templates .template-frame.selected::before {
    content: "✓";
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    height: 28px;
    width: 28px;
    right: 6px;
    top: 6px;
    z-index: 3;
    pointer-events: none;
    background: #fff;
    color: #7c3aed;
    border-radius: 50%;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
}
#templates img {
    width: calc(100% + 1.5vw);
    margin-top: 0;
    border-radius: 0;
}

@keyframes loader-spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes loader-pulse {
    0%,
    100% {
        opacity: 0.55;
    }
    50% {
        opacity: 1;
    }
}

.result-img-frame {
    position: relative;
    margin: 5vw auto 1.5vw;
    width: max-content;
}
.result-img-frame img {
    margin: 0;
}
.result-img-frame::after {
    content: " ";
    background-image: url(../img/template-frame.webp);
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center center;
    padding: 0;
    display: block;
    position: absolute;
    height: 100%;
    width: 100%;
    left: 0;
    top: 0;
}

@media (max-width: 576px) {
    #user-form-screen {
        padding: 20px 18px 32px;
    }
    #user-form-screen h2 {
        font-size: 17px;
    }
    #user-form-screen .user-form label {
        font-size: 12px;
    }
    #user-form-screen .user-form input:not([type="radio"]) {
        font-size: 16px;
        padding: 10px 12px;
        width: calc(100% - 28px);
    }
    #user-form-screen .user-form .radio-label {
        font-size: 12px;
        gap: 8px;
        padding-left: 0;
        position: static;
    }
    #user-form-screen .user-form .radio-container {
        gap: 24px;
        height: auto;
    }
    #user-form-screen .user-form input[type="radio"] {
        position: static;
        top: auto;
        left: auto;
    }
    #welcome-screen {
        padding: 16px 18px 32px;
    }
    .welcome-logos {
        gap: 14px;
        margin-bottom: 14px;
    }
    .welcome-logos img {
        height: 58px;
    }
    .title-ai {
        font-size: 76px;
    }
    .title-divider {
        height: 58px;
    }
    .welcome-tagline {
        font-size: 18px;
        letter-spacing: 0.05em;
    }
    .start-banner {
        margin-bottom: 28px;
    }
    .btn-start,
    #welcome-screen .btn.btn-start {
        margin-bottom: 10vh;
    }
    .user-form input {
        font-size: 16px;
        margin-bottom: 15px;
    }
    #template-screen #templates {
        column-gap: 8px;
        row-gap: 8px;
    }
    #template-screen #template-continue-btn {
        font-size: 16px;
        padding: 14px 40px 12px;
    }
    #loading .loader-text {
        font-size: 14px;
    }
    .share-modal-content h3 {
        font-size: 18px;
    }
    .share-hint {
        font-size: 13px;
    }
    .share-qr-loading {
        font-size: 14px;
    }
}
