* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

body {
  background: #0f172a;
  color: #f8fafc;
  min-height: 100vh;
  padding: 2rem 1rem;
  display: flex;
  justify-content: center;
}

.container {
  max-width: 820px;
  width: 100%;
}

.header {
  text-align: center;
  margin-bottom: 2rem;
}

.badge {
  display: inline-block;
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.4);
  padding: 0.3rem 0.8rem;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

h1 {
  font-size: 2.2rem;
  font-weight: 800;
  color: #f1f5f9;
  margin-bottom: 0.5rem;
}

.subtitle {
  color: #94a3b8;
  font-size: 1.05rem;
}

.subtitle a {
  color: #818cf8;
  text-decoration: none;
}

.subtitle a:hover {
  text-decoration: underline;
}

.card {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 16px;
  padding: 1.75rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
}

.card h2 {
  font-size: 1.35rem;
  margin-bottom: 0.5rem;
}

.desc {
  color: #94a3b8;
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: #cbd5e1;
}

small {
  display: block;
  font-size: 0.8rem;
  color: #64748b;
  margin-top: 0.3rem;
}

small a {
  color: #818cf8;
}

input[type="password"],
textarea,
select {
  width: 100%;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  color: #f8fafc;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}

input[type="password"]:focus,
textarea:focus,
select:focus {
  border-color: #6366f1;
}

textarea {
  resize: vertical;
}

/* Upload Area */
.upload-area {
  position: relative;
  background: #0f172a;
  border: 2px dashed #334155;
  border-radius: 10px;
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.upload-area:hover,
.upload-area.dragover {
  border-color: #6366f1;
  background: rgba(99, 102, 241, 0.05);
}

.upload-area input[type="file"] {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.upload-icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 0.5rem;
}

#upload-placeholder p {
  color: #94a3b8;
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}

#image-preview-wrapper {
  position: relative;
  display: inline-block;
  max-width: 100%;
}

#image-preview {
  max-height: 240px;
  max-width: 100%;
  border-radius: 8px;
  border: 1px solid #475569;
}

.btn-clear {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(15, 23, 42, 0.85);
  color: #f87171;
  border: 1px solid #ef4444;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  z-index: 10;
}

.btn-clear:hover {
  background: #ef4444;
  color: #fff;
}

.btn {
  display: inline-block;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  border: none;
  border-radius: 8px;
  padding: 0.85rem 1.5rem;
  font-size: 1rem;
  transition: all 0.2s;
  text-decoration: none;
}

.btn.primary {
  width: 100%;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #ffffff;
}

.btn.primary:hover {
  background: linear-gradient(135deg, #4338ca, #6d28d9);
  transform: translateY(-1px);
}

.btn.primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn.secondary {
  background: #334155;
  color: #f8fafc;
}

.btn.secondary:hover {
  background: #475569;
}

.status-box {
  margin-top: 1.25rem;
  padding: 1rem;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.95rem;
  color: #c7d2fe;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid #818cf8;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.result-box {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #334155;
}

.result-box h3 {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
}

.img-preview {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 250px;
  margin-bottom: 1rem;
}

.img-preview img {
  max-width: 100%;
  height: auto;
  display: block;
}

.actions {
  display: flex;
  justify-content: flex-end;
}

.hidden {
  display: none !important;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.feature-item {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 1rem;
}

.feature-item h3 {
  font-size: 0.95rem;
  color: #cbd5e1;
  margin-bottom: 0.4rem;
}

.feature-item p {
  font-size: 0.85rem;
  color: #94a3b8;
  line-height: 1.4;
}
