@import url('https://fonts.googleapis.com/css2?family=Dancing+Script:wght@400..700&display=swap');
:root {
    --orange: #FF8200;
    --red: #E20015;
    --fuchsia: #B90276;
    --violet: #50237F;
    --dark-purple: #160821;
    --white: #ffffff;
    --ink: #24102e;
    --muted: #7c5c86;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    font-family: "Segoe UI", system-ui, sans-serif;
}
body {
    min-height: 100vh;
    overflow: hidden;
    background: #160821;
    color: var(--white);
}

.video-background {
    position: fixed;
    inset: 0;
    z-index: -3;
    overflow: hidden;
    background: #160821;
}

.video-background video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: saturate(1.25) contrast(1.08) brightness(.72);
    transform: scale(1.04);
}

.video-overlay {
    position: absolute;
    inset: 0;
    /* background:
        radial-gradient(circle at 20% 18%, rgba(185, 2, 118, .58), transparent 32%),
        radial-gradient(circle at 80% 80%, rgba(255, 130, 0, .25), transparent 32%),
        linear-gradient(135deg, rgba(22, 8, 33, .88), rgba(80, 35, 127, .68), rgba(185, 2, 118, .56)); */
    backdrop-filter: blur(.5px);
}

.video-overlay::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle, rgba(255,255,255,.55) 1.5px, transparent 2.5px),
        radial-gradient(circle, rgba(255,130,0,.28) 1px, transparent 2px);
    background-size: 88px 88px, 46px 46px;
    opacity: .55;
    animation: magicStars 18s linear infinite;
}

@keyframes magicStars {
    from { transform: translateY(0); }
    to { transform: translateY(-120px); }
}
body {
    min-height: 100vh;
    background:
        radial-gradient(circle at 15% 18%, rgba(185, 2, 118, .58), transparent 28%),
        radial-gradient(circle at 88% 15%, rgba(226, 0, 21, .28), transparent 25%),
        radial-gradient(circle at 78% 88%, rgba(255, 130, 0, .32), transparent 30%),
        linear-gradient(135deg, var(--dark-purple) 0%, var(--violet) 48%, var(--fuchsia) 100%);
    overflow: hidden;
    color: var(--white);
}



@keyframes magicStars {
    from { transform: translateY(0); }
    to { transform: translateY(-120px); }
}

@keyframes auraSpin {
    to { transform: rotate(360deg); }
}

/* Floating background bubbles */

.magic-bg span {
    position: fixed;
    border-radius: 50%;
    opacity: .45;
    filter: blur(1px);
    animation: bubbleFloat 9s infinite ease-in-out;
    z-index: 1;
}

.magic-bg span:nth-child(1) {
    width: 150px;
    height: 150px;
    left: 5%;
    top: 18%;
    background: var(--fuchsia);
}

.magic-bg span:nth-child(2) {
    width: 110px;
    height: 110px;
    right: 8%;
    top: 14%;
    background: var(--orange);
    animation-delay: 1.2s;
}

.magic-bg span:nth-child(3) {
    width: 170px;
    height: 170px;
    left: 14%;
    bottom: 10%;
    background: var(--violet);
    animation-delay: 2.4s;
}

.magic-bg span:nth-child(4) {
    width: 125px;
    height: 125px;
    right: 18%;
    bottom: 12%;
    background: var(--red);
    animation-delay: 3.6s;
}

.magic-bg span:nth-child(5) {
    width: 90px;
    height: 90px;
    left: 47%;
    top: 10%;
    background: var(--fuchsia);
    animation-delay: 4.8s;
}

@keyframes bubbleFloat {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-48px) scale(1.18);
    }
}

/* Main form screens */

.app {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px;
    position: relative;
    z-index: 5;
}

.screen {
    display: none;
}

.screen.active {
    display: block;
    animation: pagePop .75s cubic-bezier(.2,.9,.2,1);
}

@keyframes pagePop {
    from {
        opacity: 0;
        transform: translateY(55px) scale(.9) rotateX(10deg);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1) rotateX(0);
    }
}

.welcome-card,
.form-card {
    width: min(760px, 94vw);
    padding: 23px 52px 23px 52px;
    border-radius: 46px;
    text-align: center;
    color: var(--white);
    position: relative;
    overflow: hidden;
    background:
    linear-gradient(145deg, rgb(81 71 85 / 24%), rgb(80 37 110 / 91%));
    border: 1px solid rgba(255,255,255,.30);
    backdrop-filter: blur(28px);
    box-shadow:
        0 40px 110px rgba(0,0,0,.44),
        inset 0 1px 0 rgba(255,255,255,.36);
}

.welcome-card::before,
.form-card::before {
    content: "";
    position: absolute;
    inset: 12px;
    border-radius: 36px;
    border: 2px dashed rgba(255,255,255,.24);
    pointer-events: none;
}

.welcome-card::after,
.form-card::after {
    content: "✦ ★ ✧ ✦ ★ ✧";
    position: absolute;
    left: 28px;
    right: 28px;
    bottom: 24px;
    color: rgba(255,255,255,.40);
    font-size: 30px;
    letter-spacing: 18px;
    animation: twinkle 1.4s infinite alternate;
    pointer-events: none;
}

@keyframes twinkle {
    from {
        opacity: .35;
        transform: scale(.96);
    }
    to {
        opacity: 1;
        transform: scale(1.04);
    }
}

.logo {
    max-width: 450px;
    margin-bottom: 6px;
    /* animation: logoFloat 2.8s infinite ease-in-out; */
    filter: drop-shadow(0 18px 28px rgba(0,0,0,.35));
}

@keyframes logoFloat {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-10px) scale(1.05);
    }
}

.welcome-card h1 {
    position: relative;

    margin: 0 0 28px;

    font-size: 85px;
    line-height: 1.02;
    font-weight: 950;
    letter-spacing: -2px;
    font-family: "Dancing Script", cursive;
    background:
        linear-gradient(
            135deg,
            #ffffff 0%,
            #ffe082 15%,
            #ff9de1 32%,
            #d8b4fe 48%,
            #93c5fd 65%,
            #f9a8d4 82%,
            #ffffff 100%
        );

    background-size: 300% 300%;

    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;

    animation: magicalGradient 8s ease infinite;

    filter: drop-shadow(0 0 18px rgba(255,255,255,.25));

    text-shadow:
        0 0 22px rgba(255,255,255,.18),
        0 8px 25px rgba(185,2,118,.18);
}

.welcome-card h1::after {
    content: "";

    position: absolute;

    left: 50%;
    bottom: -15px;

    transform: translateX(-50%);

    width: 79%;
    height: 6px;

    border-radius: 999px;

    background:
        linear-gradient(
            90deg,
            #ffb3ec,
            #ffd166,
            #c084fc,
            #8be9fd
        );

    opacity: .9;

    box-shadow:
        0 0 14px rgba(255,255,255,.4);
}

@keyframes magicalGradient {

    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* h1 {
    margin: 10px 0 16px;
    font-size: clamp(42px, 5vw, 62px);
    line-height: 1.04;
    font-weight: 950;
    font-family: "Dancing Script", cursive;
    color: var(--white);
     animation: logoFloat 2.8s infinite ease-in-out;
    text-shadow:
        0 8px 22px rgba(0,0,0,.35),
        0 0 32px rgba(185,2,118,.42);
} */

h2 {
    margin: 0 0 30px;
    font-size: clamp(34px, 4vw, 48px);
    font-weight: 950;
    color: var(--white);
    text-shadow: 0 8px 22px rgba(0,0,0,.32);
}

p {
    max-width: 560px;
    margin: 0 auto 34px;
    font-size: 22px;
    line-height: 1.5;
    color: rgba(255,255,255,.94);
}

input {
    width: 100%;
    height: 72px;
    padding: 0 26px;
    margin: 13px 0;
    border: 0;
    border-radius: 26px;
    outline: none;
    font-size: 23px;
    font-weight: 800;
    color: var(--ink);
    background: rgba(255,255,255,.96);
    box-shadow:
        0 20px 42px rgba(0,0,0,.22),
        inset 0 0 0 2px rgba(255,255,255,.70);
    transition: .25s ease;
}

input::placeholder {
    color: #a78aad;
}

input:focus {
    transform: translateY(-4px) scale(1.01);
    box-shadow:
        0 26px 58px rgba(0,0,0,.30),
        inset 0 0 0 4px var(--fuchsia);
}

.date-input {
    cursor: pointer;
    background:
        linear-gradient(90deg, rgba(255,255,255,.98), rgba(255,245,252,.96)),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 24 24' fill='none' stroke='%23B90276' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E") no-repeat right 24px center;
}

.gender-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin: 22px 0 32px;
}

.gender-grid button {
    min-height: 100px;
    border: 0;
    border-radius: 30px;
    color: var(--violet);
    background: rgba(255,255,255,.96);
    cursor: pointer;
    font-size: 22px;
    font-weight: 950;
    box-shadow: 0 20px 42px rgba(0,0,0,.22);
    transition: .25s ease;
    position: relative;
    overflow: hidden;
}

.gender-grid button::before {
    display: block;
    font-size: 34px;
    margin-bottom: 6px;
}

.gender-grid button[data-gender="girl"]::before {
    content: "🌸";
}

.gender-grid button[data-gender="boy"]::before {
    content: "🧸";
}

.gender-grid button[data-gender="other"]::before {
    content: "⭐";
}

.gender-grid button:hover,
.gender-grid button.selected {
    transform: translateY(-8px) scale(1.045);
    color: white;
    background: linear-gradient(135deg, var(--violet), var(--fuchsia), var(--red));
}

.primary-btn {
    min-width: 270px;
    border: 0;
    padding: 23px 52px;
    border-radius: 999px;
    color: white;
    font-size: 24px;
    font-weight: 950;
    cursor: pointer;
    background: linear-gradient(135deg, var(--orange), var(--red), var(--fuchsia), var(--violet));
    box-shadow:
        0 24px 55px rgba(185,2,118,.45),
        inset 0 1px 0 rgba(255,255,255,.30);
    transition: .25s ease;
    position: relative;
    overflow: hidden;
}

.primary-btn:hover {
    transform: translateY(-7px) scale(1.05);
    box-shadow:
        0 34px 80px rgba(185,2,118,.55),
        0 0 40px rgba(255,130,0,.30);
}

.primary-btn::after {
    content: "";
    position: absolute;
    top: 0;
    left: -80%;
    width: 55%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent);
    transform: skewX(-20deg);
    animation: shine 2.2s infinite;
}

@keyframes shine {
    0% { left: -80%; }
    60%, 100% { left: 130%; }
}

/* Certificate print page */

.print-body {
    background: var(--dark-purple) !important;
    overflow: auto;
}

.certificate-v2 {
    width: 297mm;
    height: 210mm;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
    padding: 16mm;
    color: var(--ink);
    background:
        radial-gradient(circle at 12% 16%, rgba(255,130,0,.32), transparent 20%),
        radial-gradient(circle at 85% 20%, rgba(185,2,118,.34), transparent 25%),
        radial-gradient(circle at 50% 95%, rgba(80,35,127,.42), transparent 34%),
        linear-gradient(135deg, #fff7fb 0%, #ffffff 38%, #fdf2ff 100%);
}

.certificate-v2::before {
    content: "";
    position: absolute;
    inset: 9mm;
    border-radius: 34px;
    border: 5px solid transparent;
    background:
        linear-gradient(#fff, #fff) padding-box,
        linear-gradient(135deg, var(--fuchsia), var(--orange), var(--violet), var(--fuchsia)) border-box;
    z-index: 1;
    box-shadow:
        0 0 0 8px rgba(185,2,118,.08),
        inset 0 0 45px rgba(185,2,118,.08);
}

.certificate-v2::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle, rgba(185,2,118,.22) 2px, transparent 3px),
        radial-gradient(circle, rgba(255,130,0,.20) 1.6px, transparent 2.8px);
    background-size: 34px 34px, 58px 58px;
    opacity: .65;
    z-index: 0;
}

.cert-bg-shape {
    position: absolute;
    border-radius: 999px;
    filter: blur(.2px);
    z-index: 0;
}

.shape-1 {
    width: 260px;
    height: 260px;
    background: rgba(185,2,118,.18);
    left: -80px;
    top: -70px;
}

.shape-2 {
    width: 300px;
    height: 300px;
    background: rgba(255,130,0,.18);
    right: -95px;
    bottom: -95px;
}

.shape-3 {
    width: 220px;
    height: 220px;
    background: rgba(80,35,127,.14);
    right: 80px;
    top: 42px;
}

.cert-header,
.cert-content,
.cert-footer,
.cert-stars {
    position: relative;
    z-index: 3;
}

.cert-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cert-main-logo {
    width: 245px;
    height: auto;
    object-fit: contain;
}

.cert-badge {
    padding: 12px 24px;
    border-radius: 999px;
    color: #fff;
    font-size: 16px;
    font-weight: 900;
    letter-spacing: .5px;
    background: linear-gradient(135deg, var(--violet), var(--fuchsia), var(--red));
    box-shadow: 0 12px 32px rgba(185,2,118,.28);
}

.cert-stars span {
    position: absolute;
    color: var(--orange);
    font-size: 30px;
    opacity: .85;
}

.cert-stars span:nth-child(1) { left: 58mm; top: 33mm; }
.cert-stars span:nth-child(2) { right: 58mm; top: 38mm; color: var(--fuchsia); }
.cert-stars span:nth-child(3) { left: 28mm; bottom: 48mm; color: var(--violet); }
.cert-stars span:nth-child(4) { right: 36mm; bottom: 42mm; }
.cert-stars span:nth-child(5) { left: 143mm; top: 26mm; color: var(--fuchsia); }

.cert-content {
    height: 122mm;
    display: grid;
    grid-template-columns: 150px 1fr 170px;
    align-items: center;
    gap: 22px;
    margin-top: 6mm;
}

.cert-center {
    text-align: center;
}

.cert-center h1 {
    margin: 0 0 12px;
    font-size: 55px;
    line-height: 1.05;
    color: var(--violet);
    font-weight: 950;
    letter-spacing: -1.5px;
    text-shadow: 0 8px 0 rgba(185,2,118,.08);
}

.cert-desc {
    width: 88%;
    margin: 0 auto 20px;
    font-size: 23px;
    line-height: 1.5;
    color: #3d2947;
}

.cert-desc strong {
    color: var(--fuchsia);
}

.toy-name-v2 {
    display: inline-flex;
    min-width: 390px;
    justify-content: center;
    margin: 6px 0 22px;
    padding: 18px 46px;
    border-radius: 30px;
    color: white;
    font-size: 48px;
    font-weight: 950;
    background:
        linear-gradient(135deg, var(--orange), var(--red) 38%, var(--fuchsia) 72%, var(--violet));
    box-shadow:
        0 22px 44px rgba(185,2,118,.26),
        inset 0 1px 0 rgba(255,255,255,.35);
    transform: rotate(-1deg);
}

.cert-info-v2 {
    display: flex;
    justify-content: center;
    gap: 18px;
}

.cert-info-v2 div {
    min-width: 230px;
    padding: 15px 22px;
    border-radius: 22px;
    background: rgba(255,255,255,.82);
    border: 2px solid rgba(185,2,118,.14);
    box-shadow: 0 12px 28px rgba(80,35,127,.12);
}

.cert-info-v2 small {
    display: block;
    color: var(--muted);
    font-weight: 800;
    font-size: 14px;
    margin-bottom: 5px;
}

.cert-info-v2 strong {
    color: var(--ink);
    font-size: 21px;
}

.toy-medal {
    width: 142px;
    height: 142px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    position: relative;
    background:
        radial-gradient(circle, #fff 0%, #fff4fb 58%, #ffd7ee 100%);
    border: 5px solid var(--fuchsia);
    box-shadow:
        0 20px 40px rgba(185,2,118,.25),
        inset 0 0 0 8px rgba(255,255,255,.75);
}

.toy-icon {
    font-size: 64px;
    transform: translateY(-8px);
}

.toy-ribbon {
    position: absolute;
    bottom: -18px;
    left: 50%;
    transform: translateX(-50%);
    width: 155px;
    padding: 9px 12px;
    text-align: center;
    border-radius: 999px;
    color: white;
    font-size: 14px;
    font-weight: 950;
    background: linear-gradient(135deg, var(--orange), var(--red));
    box-shadow: 0 12px 24px rgba(226,0,21,.25);
}

.official-seal {
    width: 148px;
    height: 148px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--violet);
    text-align: center;
    background:
        radial-gradient(circle, #fff 0 48%, #ffe4f3 49% 63%, var(--fuchsia) 64% 100%);
    border: 6px double var(--orange);
    box-shadow: 0 20px 44px rgba(80,35,127,.22);
}

.official-seal span {
    font-size: 13px;
    font-weight: 900;
}

.official-seal strong {
    font-size: 17px;
    line-height: 1.1;
    color: var(--fuchsia);
}

.official-seal em {
    margin-top: 7px;
    font-size: 10px;
    font-style: normal;
    font-weight: 900;
    color: var(--violet);
}

.cert-footer {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 20px;
    margin-top: 2mm;
}

.footer-line {
    height: 3px;
    border-radius: 999px;
    background: linear-gradient(90deg, transparent, var(--fuchsia), var(--orange));
}

.footer-text {
    text-align: center;
    color: var(--violet);
    font-size: 17px;
    font-weight: 850;
}

.signature-v2 {
    justify-self: end;
    padding: 13px 25px;
    border-radius: 999px;
    color: white;
    font-size: 19px;
    font-weight: 950;
    background: linear-gradient(135deg, var(--violet), var(--fuchsia));
    box-shadow: 0 14px 28px rgba(80,35,127,.22);
}

.theme-girl .toy-name-v2 {
    background: linear-gradient(135deg, var(--fuchsia), var(--red), var(--orange));
}

.theme-boy .toy-name-v2 {
    background: linear-gradient(135deg, var(--violet), var(--fuchsia), #008ECF);
}

.theme-other .toy-name-v2 {
    background: linear-gradient(135deg, var(--violet), var(--fuchsia), #78BE20);
}

/* Print buttons */

.print-actions {
    text-align: center;
    padding: 22px;
    background: var(--dark-purple);
}

.print-actions button,
.print-actions a,
.print-link {
    display: inline-block;
    margin: 0 6px;
    padding: 13px 25px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--violet), var(--fuchsia));
    color: white;
    font-size: 15px;
    font-weight: 900;
    text-decoration: none;
    cursor: pointer;
}

/* Panel */

.panel-body {
    overflow: auto;
    background:
        radial-gradient(circle at 15% 18%, rgba(185, 2, 118, .45), transparent 28%),
        linear-gradient(135deg, var(--dark-purple), var(--violet), var(--fuchsia));
    color: var(--ink);
}

.panel {
    max-width: 1250px;
    margin: 42px auto;
    padding: 34px;
    background: rgba(255,255,255,.92);
    border-radius: 34px;
    box-shadow: 0 34px 90px rgba(0,0,0,.32);
    border: 1px solid rgba(255,255,255,.5);
}

.panel h1 {
    color: var(--violet);
    font-size: 38px;
    margin: 0 0 26px;
}

table {
    width: 100%;
    border-collapse: collapse;
    overflow: hidden;
    border-radius: 22px;
}

th {
    background: linear-gradient(135deg, var(--violet), var(--fuchsia));
    color: white;
    padding: 16px;
    text-align: left;
}

td {
    padding: 15px;
    border-bottom: 1px solid rgba(80,35,127,.12);
    color: var(--ink);
}

tr:hover td {
    background: rgba(185,2,118,.06);
}

/* Print settings */

@page {
    size: A4 landscape;
    margin: 0;
}

@media print {
    body {
        background: #fff !important;
    }

    body::before,
    body::after,
    .magic-bg,
    .print-actions {
        display: none !important;
    }

    html,
    body {
        width: 297mm;
        height: 210mm;
        margin: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
    }

    .certificate-v2 {
        width: 297mm;
        height: 210mm;
        margin: 0;
        box-shadow: none;
        page-break-after: avoid;
    }
}

/* Mobile */

@media (max-width: 768px) {
    .welcome-card,
    .form-card {
        padding: 34px 24px;
        border-radius: 34px;
    }

    .gender-grid {
        grid-template-columns: 1fr;
    }

    .primary-btn {
        width: 100%;
        min-width: auto;
    }

    .logo {
        max-width: 240px;
    }
}
#welcomeScreen {
    position: relative;
    width: 100vw;
    min-height: 100vh;
    display: none;
    place-items: center;
}

#welcomeScreen.active {
    display: grid;
}

.welcome-character {
    position: absolute;
    bottom: 35px;
    z-index: 6;
    pointer-events: none;
    filter: drop-shadow(0 24px 30px rgba(0,0,0,.45));
}

.character-left {
    position: absolute;
    left: 370px;
    bottom: 75px;
    width: clamp(220px, 18vw, 320px);
    z-index: 18;
    animation: characterLeftDance 15s infinite ease-in-out;
    filter: drop-shadow(0 22px 28px rgba(0, 0, 0, .45)) drop-shadow(0 0 20px rgba(255, 255, 255, .18));
}

.character-right {
    position: absolute;
    right: 430px;
    bottom: 480px;
    width: clamp(200px, 16vw, 290px);
    z-index:18;
    animation: characterRightDance 12s infinite ease-in-out;
    filter:
        drop-shadow(0 22px 28px rgba(0,0,0,.45))
        drop-shadow(0 0 20px rgba(255,255,255,.18));
}
@keyframes characterLeftDance {
    0%, 100% {
        transform: translateY(0) rotate(-6deg) scale(1);
    }

    25% {
        transform: translateY(-18px) rotate(2deg) scale(1.03);
    }

    50% {
        transform: translateY(-30px) rotate(6deg) scale(1.06);
    }

    75% {
        transform: translateY(-12px) rotate(-2deg) scale(1.03);
    }
}

@keyframes characterRightDance {
    0%, 100% {
        transform: translateY(0) rotate(6deg) scale(1);
    }

    25% {
        transform: translateY(-20px) rotate(-2deg) scale(1.03);
    }

    50% {
        transform: translateY(-34px) rotate(-6deg) scale(1.06);
    }

    75% {
        transform: translateY(-12px) rotate(2deg) scale(1.03);
    }
}

.welcome-card {
    z-index: 8;
}

@media (max-width: 1100px) {
    .welcome-character {
        opacity: .35;
    }

    .character-left {
        left: -35px;
    }

    .character-right {
        right: -35px;
    }
}