/* AI avatar pages (Santa greeting, cartoon heroes and other avatars) */
.avatar-page { position: relative; overflow: hidden; padding-bottom: 60px; }
.avatar-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: start; }
@media (max-width: 900px) { .avatar-layout { grid-template-columns: 1fr; } }

.avatar-side h2 { font-size: 30px; margin: 0 0 12px; }
.avatar-side p { font-size: 17px; line-height: 1.6; }
.avatar-example { margin-top: 24px; }
.avatar-example h3 { margin: 0 0 10px; font-size: 18px; }
.avatar-example video, .avatar-status video { width: 100%; border-radius: 12px; background: #000; display: block; }
.avatar-example-empty { height: 220px; border-radius: 12px; border: 2px dashed #c0392b; display: flex; align-items: center; justify-content: center; font-size: 72px; }

.avatar-card { background: #fff; border-radius: 16px; padding: 28px; box-shadow: 0 8px 30px rgba(0, 0, 0, .12); position: relative; z-index: 1; }
.avatar-card-wide { max-width: 860px; margin: 0 auto; }

.avatar-form label { display: block; margin-bottom: 16px; }
.avatar-form label > span { display: block; font-weight: 600; margin-bottom: 6px; }
.avatar-form input[type=text], .avatar-form input[type=email], .avatar-form input[type=tel], .avatar-form textarea { width: 100%; padding: 12px 14px; border: 1px solid #ccc; border-radius: 8px; font: inherit; box-sizing: border-box; }
.avatar-form input:focus, .avatar-form textarea:focus { outline: none; border-color: #3d3226; box-shadow: 0 0 0 3px rgba(61, 50, 38, .14); }
.avatar-form small { display: block; color: #777; margin-top: 4px; }
.avatar-form [hidden] { display: none !important; }
.avatar-error { color: #c0392b; font-size: 14px; font-style: normal; display: block; margin-top: 4px; }
.avatar-lead { font-size: 17px; margin: 0 0 12px; }
.avatar-mode { border: 0; padding: 0; margin: 0 0 16px; }
.avatar-mode legend { font-weight: 600; margin-bottom: 8px; padding: 0; }
.avatar-form label.avatar-radio { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; cursor: pointer; }
.avatar-form label.avatar-radio > span { margin: 0; font-weight: 400; }
.avatar-submit { display: inline-block; background: #c0392b; color: #fff; border: 0; padding: 14px 30px; border-radius: 8px; font-size: 18px; font-weight: 600; cursor: pointer; text-decoration: none; }
.avatar-submit:hover { background: #a52f23; color: #fff; }

/* character picker */
.avatar-group-title { font-size: 22px; margin: 20px 0 12px; }
.avatar-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; margin-bottom: 8px; }
.avatar-form label.avatar-tile { margin: 0; cursor: pointer; }
.avatar-tile input { position: absolute; opacity: 0; pointer-events: none; }
.avatar-tile-body { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px; border: 2px solid #ddd; border-radius: 12px; text-align: center; height: 100%; box-sizing: border-box; }
.avatar-form .avatar-tile-body { font-weight: 400; margin: 0; }
.avatar-tile-body img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; }
.avatar-tile-placeholder { font-size: 54px; line-height: 1; padding: 18px 0; }
.avatar-tile input:checked + .avatar-tile-body { border-color: #c0392b; background: #fdf0ee; }
.avatar-tile input:focus-visible + .avatar-tile-body { outline: 2px solid #c0392b; }

.avatar-status { text-align: center; }
.avatar-status h2 { margin-top: 0; }

/* Christmas mood for the Santa page */
.avatar-christmas { background: linear-gradient(180deg, #fdf3f1 0%, #f3faf4 100%); }
.avatar-christmas .avatar-card { border-top: 6px solid #c0392b; }
.avatar-snow { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.avatar-snow i { position: absolute; top: -30px; color: #bcd6e6; font-style: normal; font-size: 20px; animation: avatar-fall linear infinite; }
@keyframes avatar-fall { to { transform: translateY(110vh) rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .avatar-snow { display: none; } }

/* "your video is being made" preloader */
.avatar-state-processing { padding: 8px 0 4px; }
.avatar-loader { position: relative; width: 110px; height: 110px; margin: 0 auto 18px; }
.avatar-loader-ring { position: absolute; inset: 0; border-radius: 50%; border: 6px solid #f0d9d5; border-top-color: #c0392b; animation: avatar-spin 1s linear infinite; }
.avatar-loader-icon { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 46px; animation: avatar-pulse 1.6s ease-in-out infinite; }
.avatar-progress { height: 6px; max-width: 320px; margin: 18px auto 0; border-radius: 3px; background: #f0d9d5; overflow: hidden; }
.avatar-progress span { display: block; height: 100%; width: 40%; border-radius: 3px; background: #c0392b; animation: avatar-slide 1.6s ease-in-out infinite; }
.avatar-state-done video { max-height: 70vh; }
.avatar-status [hidden] { display: none !important; }
@keyframes avatar-spin { to { transform: rotate(360deg); } }
@keyframes avatar-pulse { 50% { transform: scale(1.12); } }
@keyframes avatar-slide { 0% { margin-left: -40%; } 100% { margin-left: 100%; } }
@media (prefers-reduced-motion: reduce) { .avatar-loader-ring, .avatar-loader-icon, .avatar-progress span { animation: none; } }
.avatar-progress span { transition: width 1s linear; animation: none; }
.avatar-eta { color: #777; font-size: 14px; margin: 10px 0 0; }

/* several children in one greeting */
.avatar-form .avatar-child { border: 1px solid #e3d9d0; border-radius: 12px; padding: 16px 16px 2px; margin-bottom: 16px; background: #fffdfb; }
.avatar-form .avatar-child-head { display: flex; align-items: center; justify-content: space-between; min-height: 4px; }
.avatar-form .avatar-child-head strong { color: #c0392b; margin-bottom: 8px; }
.avatar-form .avatar-child-remove { background: none; border: 0; font-size: 18px; line-height: 1; color: #999; cursor: pointer; padding: 4px 8px; margin-left: auto; }
.avatar-form .avatar-child-remove:hover { color: #c0392b; }
.avatar-form .avatar-add-child { display: block; width: 100%; padding: 12px; margin-bottom: 20px; border: 2px dashed #c0392b; border-radius: 10px; background: transparent; color: #c0392b; font: inherit; font-weight: 600; cursor: pointer; }
.avatar-form .avatar-add-child:hover { background: #fdf0ee; }

/* nicer children blocks, picture picker and price */
.avatar-form .avatar-child { position: relative; border: 0; border-left: 5px solid #c0392b; border-radius: 12px; padding: 16px 18px 4px; background: linear-gradient(180deg, #fffaf8, #fff); box-shadow: 0 2px 12px rgba(192, 57, 43, .10); }
.avatar-form .avatar-child-head strong { font-size: 15px; letter-spacing: .02em; }
.avatar-form .avatar-child-remove { width: 28px; height: 28px; border-radius: 50%; background: #f4e4e1; color: #c0392b; font-size: 13px; padding: 0; margin-bottom: 8px; }
.avatar-form .avatar-child-remove:hover { background: #c0392b; color: #fff; }
.avatar-form .avatar-photo { position: relative; cursor: pointer; }
.avatar-form .avatar-photo input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.avatar-form .avatar-photo-drop { display: flex; align-items: center; gap: 14px; margin: 0; padding: 12px 14px; border: 2px dashed #d9b9b3; border-radius: 12px; background: #fff; font-weight: 400; transition: border-color .15s, background .15s; }
.avatar-form .avatar-photo:hover .avatar-photo-drop, .avatar-form .avatar-photo:focus-within .avatar-photo-drop { border-color: #c0392b; background: #fdf0ee; }
.avatar-form .avatar-photo-thumb { flex: none; width: 64px; height: 64px; margin: 0; border-radius: 12px; background: #f6e9e6 center / cover no-repeat; display: flex; align-items: center; justify-content: center; font-size: 28px; font-weight: 400; }
.avatar-form .avatar-photo-thumb.has-image { font-size: 0; box-shadow: 0 0 0 3px #fff, 0 0 0 5px #c0392b; }
.avatar-form .avatar-photo-text { display: block; margin: 0; font-weight: 400; }
.avatar-form .avatar-photo-text b { display: block; color: #c0392b; font-weight: 600; }
.avatar-form .avatar-photo-text small { margin-top: 2px; }
.avatar-form .avatar-add-child { border-style: solid; border-width: 2px; border-radius: 12px; transition: background .15s, color .15s; }
.avatar-form .avatar-add-child:hover { background: #c0392b; color: #fff; }
.avatar-form .avatar-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; margin: 4px 0 14px; padding: 12px 16px; border-radius: 12px; background: #f3faf4; border: 1px solid #cfe6d3; }
.avatar-form .avatar-price strong { font-size: 24px; color: #1e7a38; }
.avatar-form .avatar-price small { flex-basis: 100%; margin: 0; }
.avatar-form .avatar-price-hint:empty { display: none; }
.avatar-form .avatar-submit { width: 100%; }

/* ===== New Year look of the Santa page (the page has the same cream background as the header and the footer) ===== */
.avatar-christmas { background: none; }
.avatar-christmas::before, .avatar-christmas::after { content: ""; position: absolute; width: 340px; height: 340px; pointer-events: none; z-index: 0; opacity: .55;
    background: radial-gradient(circle at 50% 50%, rgba(192, 57, 43, .10), transparent 65%); }
.avatar-christmas::before { top: -120px; left: -120px; }
.avatar-christmas::after { bottom: -140px; right: -120px; background: radial-gradient(circle at 50% 50%, rgba(30, 122, 56, .12), transparent 65%); }

/* the text on the left: a golden underline, a festive frame around the example video */
.avatar-christmas .avatar-side h2 { position: relative; padding-bottom: 14px; margin-bottom: 18px; }
.avatar-christmas .avatar-side h2::after { content: "✦ ✦ ✦"; position: absolute; left: 0; bottom: -4px; font-size: 14px; letter-spacing: 8px; color: #d4a437; }
.avatar-christmas .avatar-example video, .avatar-christmas .avatar-example-empty { border: 3px solid #fff; box-shadow: 0 0 0 3px #c0392b, 0 12px 30px rgba(192, 57, 43, .25); border-radius: 14px; }
.avatar-christmas .avatar-example h3::before { content: "🎁 "; }

/* the form card: a string of lights on top instead of a plain line */
.avatar-christmas .avatar-card { border-top: 0; border-radius: 18px; padding-top: 38px; box-shadow: 0 10px 34px rgba(61, 50, 38, .14); }
.avatar-christmas .avatar-card::before { content: ""; position: absolute; left: 18px; right: 18px; top: 12px; height: 12px; border-radius: 6px; pointer-events: none;
    background: radial-gradient(circle at 10px 6px, #c0392b 0 4px, transparent 5px) 0 0 / 60px 12px repeat-x,
                radial-gradient(circle at 30px 6px, #d4a437 0 4px, transparent 5px) 0 0 / 60px 12px repeat-x,
                radial-gradient(circle at 50px 6px, #1e7a38 0 4px, transparent 5px) 0 0 / 60px 12px repeat-x; }
.avatar-christmas .avatar-card::after { content: ""; position: absolute; left: 18px; right: 18px; top: 17px; height: 2px; background: #cfc3b3; opacity: .7; z-index: -1; }
.avatar-christmas .avatar-submit { background: linear-gradient(135deg, #c0392b, #a52f23); box-shadow: 0 6px 16px rgba(192, 57, 43, .35); border-radius: 12px; letter-spacing: .02em; }
.avatar-christmas .avatar-submit::before { content: "🎅 "; }
.avatar-christmas .avatar-submit:hover { background: linear-gradient(135deg, #d44332, #b5342a); }

/* "what should Santa say": two big cards instead of the plain radio buttons */
.avatar-form .avatar-mode legend { font-size: 18px; margin-bottom: 10px; }
.avatar-form .avatar-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .avatar-form .avatar-choices { grid-template-columns: 1fr; } }
.avatar-form label.avatar-radio { position: relative; display: block; margin: 0; cursor: pointer; }
.avatar-form label.avatar-radio input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.avatar-form .avatar-radio-card { position: relative; display: flex; align-items: center; gap: 12px; height: 100%; box-sizing: border-box; padding: 14px 44px 14px 14px; border: 2px solid #e3d9d0; border-radius: 14px; background: #fff; font-weight: 400; margin: 0; transition: border-color .15s, background .15s, box-shadow .15s, transform .15s; }
.avatar-form .avatar-radio-card i { flex: none; width: 44px; height: 44px; border-radius: 12px; background: #f6efe8; display: flex; align-items: center; justify-content: center; font-style: normal; font-size: 24px; transition: background .15s; }
.avatar-form .avatar-radio-card b { font-weight: 600; line-height: 1.3; }
.avatar-form .avatar-radio-card::after { content: ""; position: absolute; right: 14px; top: 50%; width: 22px; height: 22px; margin-top: -11px; border-radius: 50%; border: 2px solid #cfc3b3; background: #fff; box-sizing: border-box; transition: all .15s; }
.avatar-form label.avatar-radio:hover .avatar-radio-card { border-color: #d9b9b3; transform: translateY(-1px); }
.avatar-form label.avatar-radio input:checked + .avatar-radio-card { border-color: #c0392b; background: #fdf0ee; box-shadow: 0 6px 18px rgba(192, 57, 43, .18); }
.avatar-form label.avatar-radio input:checked + .avatar-radio-card i { background: #f8d9d4; }
.avatar-form label.avatar-radio input:checked + .avatar-radio-card::after { background: #c0392b url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 14px no-repeat; border-color: #c0392b; }
.avatar-form label.avatar-radio input:focus-visible + .avatar-radio-card { outline: 3px solid rgba(192, 57, 43, .35); outline-offset: 2px; }

/* the page has exactly the colour of the header and the footer (--paper in home.css): no tinted corners over it */
.avatar-page.avatar-christmas { background: var(--paper, #fefdf3); }
.avatar-christmas::before, .avatar-christmas::after { display: none; }

.avatar-form .avatar-lang-hint { margin-top: 4px; }

/* own-text order: up to 4 pictures, a strip of small previews */
.avatar-form .avatar-photo-strip { display: flex; gap: 8px; margin-top: 10px; }
.avatar-form .avatar-photo-strip:empty { display: none; }
.avatar-form .avatar-photo-strip i { width: 64px; height: 64px; border-radius: 10px; background: #f6e9e6 center / cover no-repeat; box-shadow: 0 0 0 2px #fff, 0 0 0 4px #c0392b; }
