/* Kartoon Kids custom theme */
:root {
  --main-bg: #fff8e8;
  --main-bg2: #ffffff;
  --body-text: #263447;
  --muted-text: #64748b;
  --accent-color: #ff6b4a;
  --accent-hover: #e94f31;
  --mint: #42c6a5;
  --sky: #62b6ff;
  --sun: #ffd45a;
  --pink: #ff8db3;
  --border-color: #f2d9a8;
  --overlay-bg: rgba(0, 0, 0, 0.5);
  --radius-sm: 8px;
  --radius-md: 8px;
  --sticker-shadow: 0 14px 0 rgba(255, 177, 74, 0.22), 0 20px 34px rgba(38, 52, 71, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  min-height: 100svh;
  background:
    linear-gradient(90deg, rgba(98, 182, 255, 0.14) 1px, transparent 1px),
    linear-gradient(rgba(255, 141, 179, 0.12) 1px, transparent 1px),
    linear-gradient(180deg, #f4fbff 0%, #f6fbff 100%);
  background-attachment: fixed, fixed, fixed;
  background-size: 28px 28px, 28px 28px, auto;
  color: var(--body-text);
  font-family: "Trebuchet MS", "Arial Rounded MT Bold", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

#main {
  min-height: 100%;
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  padding: 0 12px;
}

#app {
  width: 100%;
  min-height: 100%;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease;
}

#app.inited {
  opacity: 1;
  visibility: visible;
}

#app.inited + #loading-spinner {
  display: none !important;
}

#loading-spinner {
  position: fixed;
  inset: 0;
  background-color: rgba(255, 255, 255, 0.8);
  z-index: 9999;
}

header {
  padding: 18px 0 8px;
  border-bottom: 0;
  background: transparent;
}
header .container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 96px;
  margin-top: 0.5rem;
  padding: 2.25rem 0.8rem 1rem;
  background: rgba(255, 255, 255, 0.86);
  border: 2px solid #ffffff;
  border-bottom: 5px solid #f3cf76;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 28px rgba(38, 52, 71, 0.1);
}
header .container h1 {
  margin: 0;
  width: 100%;
  min-width: 0;
}

h1,
h2,
h3,
h4,
h5,
p,
li {
  color: var(--body-text);
  font-family: inherit;
}

h1 {
  font-size: 1.65rem;
  line-height: 1.15;
  font-weight: 900;
  white-space: normal;
  text-align: center;
  margin: 0;
  color: #1f3a5f;
}

h2 {
  font-size: 1.55rem;
  line-height: 1.25;
  font-weight: 800;
  margin: 0.8rem 0 0.4rem;
  color: #1f3a5f;
}

h3 {
  font-size: 1.28rem;
  line-height: 1.3;
  font-weight: 700;
  margin: 0.6rem 0 0.35rem;
  color: #1f3a5f;
}

h4 {
  font-size: 1.05rem;
  line-height: 1.35;
  font-weight: 700;
  margin: 1rem 0 0.5rem;
  color: #1f3a5f;
}

.container {
  margin: 1rem auto;
  padding-left: 0.65rem;
  padding-right: 0.65rem;
}

.logo {
  position: absolute;
  left: 1rem;
  top: 0.8rem;
  height: 24px;
  width: 128px;
  z-index: 1;
}

.logo:empty {
  display: none;
}

.logo a {
  display: block;
  width: 100%;
  height: 100%;
  background-color: #ff6b4a;
  -webkit-mask: url("./images/instant-studio-logo.svg") left center / contain no-repeat;
  mask: url("./images/instant-studio-logo.svg") left center / contain no-repeat;
}

.logo svg,
.logo img {
  display: none;
}

.section {
  flex: 1 1 auto;
  padding: 10px 0 28px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.76rem;
  color: #9a5b00;
  font-weight: 900;
  margin: 0 auto 0.75rem;
  display: table;
  padding: 0.35rem 0.75rem;
  background: #fff1b8;
  border: 2px solid #ffffff;
  border-radius: var(--radius-sm);
  box-shadow: 0 5px 0 rgba(255, 212, 90, 0.45);
}

.hero-intro {
  text-align: center;
  color: #3f526b;
  margin: 0 auto;
  max-width: 38rem;
  padding: 1.1rem 1rem;
  background: rgba(255, 255, 255, 0.82);
  border: 2px solid #ffffff;
  border-radius: var(--radius-md);
  box-shadow: var(--sticker-shadow);
  font-weight: 700;
}

.home-stage {
  max-width: 42rem;
}

.sticker-preview-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
  margin: 1.25rem auto 1rem;
}

.mini-sticker {
  position: relative;
  min-height: 8.2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0.55rem;
  padding: 0.85rem 0.55rem;
  text-align: center;
  color: #1f3a5f;
  background: #ffffff;
  border: 6px solid #ffffff;
  border-radius: 8px;
  box-shadow: 0 8px 0 rgba(38, 52, 71, 0.12);
  transform: rotate(-2deg);
  font-weight: 900;
}

.mini-sticker::before {
  content: "";
  position: absolute;
  top: -0.55rem;
  left: 50%;
  width: 2.8rem;
  height: 1rem;
  background: rgba(255, 212, 90, 0.72);
  border: 1px dashed rgba(154, 91, 0, 0.28);
  transform: translateX(-50%) rotate(3deg);
}

.mini-sticker:nth-child(even) {
  transform: rotate(2deg);
}

.mini-sticker-mark {
  width: 4rem;
  height: 4rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  font-size: 1.05rem;
  line-height: 1;
  letter-spacing: 0.04em;
  border: 4px solid rgba(255, 255, 255, 0.78);
  box-shadow: inset 0 -7px 0 rgba(38, 52, 71, 0.12);
}

.mini-sticker-image {
  width: min(100%, 6.1rem);
  aspect-ratio: 1 / 1;
  display: block;
  object-fit: cover;
  object-position: center;
  border: 4px solid #ffffff;
  border-radius: 8px;
  box-shadow: 0 5px 0 rgba(38, 52, 71, 0.1);
}

.mini-sticker-doctor {
  background: #e9fff8;
}

.mini-sticker-doctor .mini-sticker-mark {
  background: #42c6a5;
}

.mini-sticker-artist {
  background: #fff0f5;
}

.mini-sticker-artist .mini-sticker-mark {
  background: #ff8db3;
}

.mini-sticker-athlete {
  background: #fff7d6;
}

.mini-sticker-athlete .mini-sticker-mark {
  background: #ffb33f;
}

.mini-sticker-engineer {
  background: #eaf8ff;
}

.mini-sticker-engineer .mini-sticker-mark {
  background: #62b6ff;
}

.home-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
  margin: 1.25rem auto 1.35rem;
}

.home-step {
  position: relative;
  min-height: 5.4rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0.45rem;
  padding: 0.9rem 0.65rem;
  text-align: center;
  color: #1f3a5f;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 247, 214, 0.9)),
    #fff7d6;
  border: 3px solid #ffffff;
  border-radius: var(--radius-sm);
  box-shadow: 0 7px 0 rgba(255, 212, 90, 0.26), 0 13px 24px rgba(38, 52, 71, 0.08);
  font-weight: 900;
}

.home-step:not(:last-child)::after {
  content: "\f061";
  position: absolute;
  right: -1.05rem;
  top: 50%;
  width: 1.85rem;
  height: 1.85rem;
  display: grid;
  place-items: center;
  color: #ffffff;
  background: #42c6a5;
  border: 3px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 4px 0 rgba(66, 198, 165, 0.24);
  transform: translateY(-50%) rotate(-6deg);
  font-family: "Font Awesome 6 Free";
  font-size: 0.85rem;
  font-weight: 900;
  z-index: 2;
}

.home-step:nth-child(2) {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(234, 248, 255, 0.92)),
    #eaf8ff;
  box-shadow: 0 7px 0 rgba(98, 182, 255, 0.2), 0 13px 24px rgba(38, 52, 71, 0.08);
}

.home-step:nth-child(3) {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 240, 245, 0.92)),
    #fff0f5;
  box-shadow: 0 7px 0 rgba(255, 141, 179, 0.2), 0 13px 24px rgba(38, 52, 71, 0.08);
}

.home-step i {
  color: #ff6b4a;
  font-size: 1.35rem;
}

.home-cta {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 0.65rem;
}

.section-copy,
.small {
  color: var(--muted-text);
  line-height: 1.65;
}

.sponsor {
  text-align: left;
  font-size: 1rem;
  margin-bottom: 1rem;
  color: #1f3a5f;
  font-weight: 800;
}

.sponsor-content {
  padding: 1rem;
  color: var(--body-text);
  background-color: #fff7d6;
  text-align: left;
  border: 2px solid #ffffff;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 0 rgba(255, 212, 90, 0.28);
}

.hero-card,
.panel,
.status-card {
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid #ffffff;
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--sticker-shadow);
}

.file-input {
  cursor: pointer;
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  border: 3px dashed #ffb1c9;
  border-radius: var(--radius-md);
  background:
    linear-gradient(135deg, rgba(255, 212, 90, 0.18), rgba(98, 182, 255, 0.15)),
    #ffffff;
  box-shadow: 0 10px 0 rgba(255, 141, 179, 0.2), 0 18px 30px rgba(38, 52, 71, 0.1);
}

.file-input:hover {
  background-color: #fff7d6;
  transform: translateY(-1px);
}

.file-input.dragging {
  border-color: var(--accent-color);
  background: #fff1b8;
}

.upload-icon {
  font-size: 2.15rem;
  margin-bottom: 10px;
  color: var(--accent-color);
}

.preview-image {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 6px solid #ffffff;
  box-shadow: 0 10px 0 rgba(66, 198, 165, 0.22);
}

.delete-image {
  position: absolute;
  right: 10px;
  top: 10px;
  color: #ff4f72;
  font-size: 1.6rem;
  line-height: 1;
  text-shadow: 0 0 6px rgba(255, 255, 255, 0.9);
}

.image-shell {
  overflow: hidden;
  border-radius: var(--radius-md);
  margin-top: 0;
  background: #ffffff;
  border: 8px solid #ffffff;
  box-shadow: var(--sticker-shadow);
}

.result-complete .image-shell {
  margin-bottom: 2.2rem;
}

.image-shell img {
  display: block;
  width: 100%;
  object-fit: contain;
}

.result-header {
  text-align: center;
  padding: 0.9rem 0.8rem;
  margin-bottom: 1rem;
  background: rgba(255, 255, 255, 0.86);
  border: 2px solid #ffffff;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 0 rgba(98, 182, 255, 0.22);
}

.result-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 2.35rem auto 1.35rem;
  max-width: 28rem;
}

.result-action-btn {
  min-width: 10.5rem;
  flex: 1 1 10.5rem;
  max-width: 13rem;
}

.result-tip {
  max-width: 42rem;
  margin: 0 auto 1.7rem;
  padding: 0.85rem 1rem;
  text-align: center;
  color: #34445a;
  background: rgba(255, 255, 255, 0.72);
  border: 2px dashed #f3cf76;
  border-radius: var(--radius-sm);
  font-weight: 800;
}

.next-actions {
  max-width: 43rem;
  margin: 1.65rem auto 0;
}

.next-actions .btn {
  min-height: 60px;
}

form {
  margin-bottom: 1rem;
}

.form-label,
.form-check-label {
  font-size: 1rem;
  color: #34445a;
  font-weight: 800;
}

.btn {
  cursor: pointer;
  border-radius: var(--radius-sm);
  padding: 12px 20px;
  font-weight: 900;
  border-width: 2px;
  box-shadow: 0 6px 0 rgba(38, 52, 71, 0.18);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 0 rgba(38, 52, 71, 0.16);
}

.btn:active {
  transform: translateY(2px);
  box-shadow: 0 3px 0 rgba(38, 52, 71, 0.16);
}

.btn-primary {
  --bs-btn-bg: #ff6b4a;
  --bs-btn-border-color: #d9482e;
  --bs-btn-hover-bg: #e94f31;
  --bs-btn-hover-border-color: #c83c25;
  --bs-btn-color: #ffffff;
}

.btn-secondary {
  --bs-btn-bg: #ffffff;
  --bs-btn-border-color: #42c6a5;
  --bs-btn-hover-bg: #e9fff8;
  --bs-btn-hover-border-color: #2fa98a;
  --bs-btn-color: #1f3a5f;
  --bs-btn-hover-color: #1f3a5f;
  --bs-btn-active-bg: #d8fff2;
  --bs-btn-active-border-color: #2fa98a;
  --bs-btn-active-color: #1f3a5f;
  --bs-btn-disabled-bg: #f8fafc;
  --bs-btn-disabled-border-color: #b8e9dc;
  --bs-btn-disabled-color: #64748b;
}

.form-control,
.form-select {
  border-radius: var(--radius-sm);
  min-height: 48px;
  border: 2px solid #ffd7a3;
  color: var(--body-text);
  background-color: rgba(255, 255, 255, 0.92);
  font-weight: 700;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 0.2rem rgba(255, 107, 74, 0.16);
}

.form-check-input {
  margin-top: 0.32em;
}

.error-text {
  color: #cc0000;
  display: inline-block;
  margin-top: 0.5rem;
}

a {
  color: #df4f37;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 800;
}

a:hover {
  color: var(--accent-hover);
}

.modal-content {
  border-radius: var(--radius-md);
  border: 3px solid #ffffff;
  box-shadow: var(--sticker-shadow);
}

.modal-header,
.modal-footer {
  border-color: var(--border-color);
}

.modal-header .btn-close {
  box-shadow: none;
}

.face-detection-modal .modal-dialog {
  margin: 0.75rem;
}

.face-detection-modal .modal-content {
  border-radius: var(--radius-md);
}

.face-detection-modal .modal-header,
.face-detection-modal .modal-body,
.face-detection-modal .modal-footer {
  padding-left: 1rem;
  padding-right: 1rem;
}

.face-detection-modal .modal-header {
  align-items: flex-start;
  gap: 0.75rem;
  padding-top: 1rem;
  padding-bottom: 0.75rem;
}

.face-detection-modal .modal-title {
  font-size: 1.05rem;
  line-height: 1.3;
  margin-right: auto;
}

.face-detection-modal .modal-body {
  padding-top: 0.75rem;
  padding-bottom: 1rem;
  font-size: 0.95rem;
}

.face-detection-preview {
  width: 100%;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: #fff7d6;
  border: 4px solid #ffffff;
}

.face-detection-preview-image {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(52vh, 320px);
  object-fit: contain;
  margin: 0 auto;
}

.face-detection-preview-canvas {
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: none;
}

.face-detection-modal-footer {
  display: flex;
  flex-direction: column-reverse;
  gap: 0.75rem;
  padding-top: 0.75rem;
  padding-bottom: 1rem;
}

.face-detection-modal-footer .btn {
  width: 100%;
  margin: 0;
}

.alert-danger {
  color: #7f1d1d;
  background-color: #fff1f2;
  border: 2px solid #ffb1c9;
  border-radius: var(--radius-sm);
  font-weight: 800;
}

footer {
  margin-top: auto;
}

#footer {
  max-width: 680px;
  font-size: 0.85rem;
  text-align: center;
  padding: 16px 0 0;
  border-top: 2px dashed #f3cf76;
  color: var(--muted-text);
}

#footer .container {
  color: var(--muted-text);
  font-size: 0.95rem;
}

.footer-links {
  display: flex;
  justify-content: center;
  padding-bottom: 1rem;
  align-items: center;
  flex-flow: wrap;
}

.footer-links a {
  padding: 0.25rem 0.5rem;
}

.socials {
  text-decoration: none;
}

.language-selector {
  display: flex;
  justify-content: center;
}

.lang-select {
  padding: 6px 10px;
  border: 2px solid var(--accent-color);
  background: #ffffff;
  color: #1f3a5f;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.15s ease;
  outline: none;
  min-width: 80px;
  text-align: center;
}

.lang-select:hover {
  background: #fff1b8;
}

.lang-select:focus {
  border-color: #1f3a5f;
  box-shadow: none;
}

.lang-select option {
  background: #ffffff;
  color: #1f3a5f;
  padding: 4px 8px;
}

.transition-opacity {
  transition: opacity 0.3s ease-in-out;
}

.opacity-0 {
  opacity: 0;
}

.opacity-1 {
  opacity: 1;
}

@media (min-width: 576px) {
  #footer {
    font-size: 1rem;
  }
  .footer-links a {
    padding: 0 0.5rem;
  }
}
@media (max-width: 420px) {
  header .container {
    padding-top: 2.5rem;
  }
  .logo {
    left: 50%;
    top: 0.75rem;
    width: 116px;
    height: 22px;
    transform: translateX(-50%);
  }
  .sticker-preview-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .home-steps {
    grid-template-columns: 1fr;
  }
  .home-step::after {
    display: none !important;
  }
}
@media (min-width: 768px) {
  body {
    font-size: 1.08rem;
  }
  h1 {
    font-size: 1.95rem;
  }
  h2 {
    font-size: 1.75rem;
  }
  h3 {
    font-size: 1.42rem;
  }
  .face-detection-modal .modal-dialog {
    margin: 1.75rem auto;
  }
  .face-detection-modal .modal-header,
  .face-detection-modal .modal-body,
  .face-detection-modal .modal-footer {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
  .face-detection-modal .modal-title {
    font-size: 1.2rem;
  }
  .face-detection-modal .modal-body {
    font-size: 1rem;
  }
  .face-detection-preview-image {
    max-height: 400px;
  }
  .face-detection-modal-footer {
    flex-direction: row;
    justify-content: flex-end;
  }
  .face-detection-modal-footer .btn {
    width: auto;
  }
}
