/* Global reset */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  font-family: Inter, system-ui, Arial, sans-serif;
  background: #0b0b12;
  color: #fff;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 15px;
}
.controls,
.preview-page {
  background: #0f1724; /* slightly deeper for contrast */
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 6px 30px rgba(0, 0, 0, 0.45);
  width: 100%;
  max-width: 600px; /* match canvas max-width */
  position: relative;
}
.header-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
   border-bottom:1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 14px;
}
.side-logo {
  width: 90px;
  height: auto;
  object-fit: contain;
  position: absolute;
  top: 1rem;
}

/* Keep logos visible and avoid negative margins */
.left-logo {
  left: 12px;
}
.right-logo {
  right: 12px;
}
h2 {
  font-size: 22px;
  margin: 0;
  white-space: nowrap;
}
label {
  display: block;
  margin: 14px 0 6px;
  padding-left: 4px;
  font-size: 12px;
  color: #cbd5e1;
}
input,
select {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: #071022;
  color: #cbd5e1; /* improved contrast */
  outline: none;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
select {
  color: #cd3636;
}
input::placeholder,
select::placeholder {
  color: #cd3636;
  opacity: 1;
}

/* Focus styles for accessibility */
input:focus,
select:focus,
button:focus {
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.16);
  border-color: rgba(239, 68, 68, 0.5);
}
.upload-section {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 5px;
}

.input-box {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  font-size: 14px;
  margin: 16px 0;
  padding-left: 2px;
  gap: 8px;
  cursor: pointer;
}

.input-box label {
  margin: 0;
  font-size: 13px;
  font-weight: 400;
  color: #cbd5e1;
  cursor: pointer;
}

.input-box .link {
  color: #ef4444;

  text-decoration: underline;
}

.input-box #termsError{
  color: #fba850;
  font-size: 10px;
  margin-top: 4px;
  padding: 0 4px;
  border-left: 2px solid #fba850;
  border-right: 2px solid #fba850;
}

.input-box input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #ef4444;
  cursor: pointer;
}
button {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 0;
  cursor: pointer;
  background: linear-gradient(90deg, #ef4444, #b91c1c);
  color: #fff;
  font-weight: 700;
  transition: 0.3s;
}
button:hover {
  opacity: 0.85;
}
canvas {
  width: 100%;
  max-width: 900px;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
  display: block;
}
.hidden {
  display: none;
}
.share-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
  justify-content: center;
}
.share-buttons button {
  background: linear-gradient(90deg, #ef4444, #b91c1c);
  color: #fff;
  font-weight: 600;
  padding: 10px 20px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: 0.3s;
}
.share-buttons button i {
  margin-right: 6px;
}
.share-buttons button:hover {
  opacity: 0.9;
}
.loader {
  position: relative;
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.15);
  overflow: hidden;
  margin-bottom: 15px;
  border-radius: 2px;
}
.loader::after {
  content: "";
  position: absolute;
  left: -40%;
  width: 40%;
  height: 100%;
  background: white;
  animation: loaderLine 1.2s infinite ease-in-out;
}
@keyframes loaderLine {
  0% {
    left: -40%;
    width: 40%;
  }
  50% {
    left: 30%;
    width: 30%;
  }
  100% {
    left: 100%;
    width: 40%;
  }
}
.star {
  position: absolute;
  width: 8px;
  height: 8px;
  background: #fbbf24; /* warm gold for Diwali */
  box-shadow: 0 0 8px rgba(251, 191, 36, 0.8);
  border-radius: 50%;
  pointer-events: none;
  animation: fly 0.8s forwards;
}
@keyframes fly {
  0% {
    transform: translate(0, 0) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(var(--x), var(--y)) scale(0);
    opacity: 0;
  }
}
@media (max-width: 900px) {
  .header-bar h2 {
    font-size: 20px;
    margin-top: 8px;
  }
  label,
  input,
  button,
  select {
    font-size: 15px;
  }
  .left-logo {
    left: 8px;
    width: 80px;
  }
  .right-logo {
    right: 8px;
    width: 80px;
  }
  .controls,
  .preview-page {
    padding: 16px;
    border-radius: 10px;
  }
}

@media (max-width: 480px) {
  .controls{
    padding-top: 50px;
  }
  .container {
    padding: 10px;
  }
  .header-bar h2 {
    font-size: 18px;
  }
  
  .controls,
  .preview-page {
    max-width: 100%;
  }
}
