/* =============================================
   RESET & BASE
   ============================================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background-color: #050507;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 30px 16px;
  overflow-x: hidden;
  position: relative;
  color: #fff;
}

/* =============================================
   BACKGROUND
   ============================================= */
.nebula, .nebula-2 {
  position: absolute;
  border-radius: 50%;
  z-index: 0;
  filter: blur(60px);
  pointer-events: none;
}
.nebula {
  width: 300px;
  height: 300px;
  background: rgba(255, 46, 77, 0.15);
  top: -10%;
  left: -10%;
  animation: float1 10s infinite alternate ease-in-out;
}
.nebula-2 {
  width: 250px;
  height: 250px;
  background: rgba(255, 0, 85, 0.1);
  bottom: -10%;
  right: -10%;
  animation: float2 12s infinite alternate ease-in-out;
}
@keyframes float1 { 100% { transform: translate(30px, 30px) scale(1.2); } }
@keyframes float2 { 100% { transform: translate(-30px, -30px) scale(1.1); } }

#stars {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 0;
  background-image: radial-gradient(rgba(255,255,255,0.6) 1px, transparent 1px);
  background-size: 80px 80px;
  animation: moveStars 50s linear infinite;
  pointer-events: none;
  opacity: 0.2;
}
@keyframes moveStars {
  from { background-position: 0 0; }
  to   { background-position: 0 -400px; }
}

/* =============================================
   CONTAINER
   ============================================= */
.container {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 400px;
}

/* =============================================
   CARD
   ============================================= */
.card {
  background: rgba(13, 13, 16, 0.85);
  border: 1px solid rgba(255, 46, 77, 0.15);
  border-radius: 20px;
  padding: 26px 22px;
  text-align: center;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow:
    0 15px 30px rgba(0, 0, 0, 0.8),
    inset 0 0 10px rgba(255, 46, 77, 0.05);
}

.form-card {
  text-align: left;
}

/* =============================================
   HEADER CARD
   ============================================= */
.header-icon {
  width: 52px;
  height: 52px;
  background: rgba(255, 46, 77, 0.12);
  border: 1px solid rgba(255, 46, 77, 0.35);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  animation: iconPulse 2.5s infinite ease-in-out;
}
.header-icon i {
  font-size: 22px;
  color: #ff2e4d;
  filter: drop-shadow(0 0 6px rgba(255, 46, 77, 0.65));
}
@keyframes iconPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 46, 77, 0.3); }
  50%       { box-shadow: 0 0 0 8px rgba(255, 46, 77, 0); }
}

.logo {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 4px;
  text-transform: uppercase;
  background: linear-gradient(to right, #888 0%, #fff 40%, #ff2e4d 60%, #fff 80%, #888 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: textFlow 4s linear infinite;
  margin-bottom: 8px;
}
@keyframes textFlow {
  0%   { background-position: 200% center; }
  100% { background-position: 0% center; }
}

.desc {
  color: #6b7280;
  font-size: 13px;
  line-height: 1.6;
}

/* =============================================
   FIELD GROUP
   ============================================= */
.field-group {
  margin-bottom: 18px;
}

.field-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 700;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 8px;
}
.field-label i {
  color: #ff2e4d;
  font-size: 11px;
}

.optional-badge {
  margin-left: auto;
  font-size: 9px;
  font-weight: 600;
  color: #ff2e4d;
  background: rgba(255, 46, 77, 0.1);
  border: 1px solid rgba(255, 46, 77, 0.3);
  border-radius: 999px;
  padding: 2px 8px;
  text-transform: none;
  letter-spacing: 0;
}

/* =============================================
   INPUT — mirip Uiverse Praashoo7
   ============================================= */
.input-wrapper {
  position: relative;
}

.input {
  width: 100%;
  border: 1px solid rgba(255, 46, 77, 0.2);
  outline: none;
  border-radius: 14px;
  padding: 12px 42px 12px 14px;
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  font-size: 14px;
  box-shadow: inset 2px 4px 10px rgba(0, 0, 0, 0.4);
  transition: 300ms ease-in-out;
  font-family: inherit;
}
.input::placeholder {
  color: #4b5563;
}
.input:focus {
  background: rgba(255, 46, 77, 0.07);
  border-color: rgba(255, 46, 77, 0.55);
  transform: scale(1.015);
  box-shadow:
    inset 2px 4px 10px rgba(0, 0, 0, 0.3),
    0 0 16px rgba(255, 46, 77, 0.15);
}

.input-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #374151;
  font-size: 13px;
  pointer-events: none;
  transition: color 0.3s;
}
.input-wrapper:focus-within .input-icon {
  color: #ff2e4d;
}

/* Textarea */
.textarea {
  resize: none;
  padding: 12px 14px;
  line-height: 1.6;
}

.char-count {
  display: block;
  text-align: right;
  font-size: 11px;
  color: #374151;
  margin-top: 5px;
  transition: color 0.3s;
}
.char-count.warn  { color: #f59e0b; }
.char-count.limit { color: #ff2e4d; }

/* =============================================
   UPLOAD AREA
   ============================================= */
.upload-area {
  border: 1px dashed rgba(255, 46, 77, 0.3);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  transition: all 0.3s ease;
  overflow: hidden;
}
.upload-area:hover,
.upload-area.dragover {
  border-color: rgba(255, 46, 77, 0.7);
  background: rgba(255, 46, 77, 0.05);
  box-shadow: 0 0 16px rgba(255, 46, 77, 0.1);
}

.upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 22px 16px;
  text-align: center;
}
.upload-placeholder i {
  font-size: 26px;
  color: rgba(255, 46, 77, 0.5);
  transition: transform 0.3s, color 0.3s;
}
.upload-area:hover .upload-placeholder i {
  transform: translateY(-3px);
  color: #ff2e4d;
}
.upload-placeholder span {
  font-size: 13px;
  color: #6b7280;
}
.upload-hint {
  font-size: 11px !important;
  color: #374151 !important;
}

.upload-preview {
  position: relative;
  padding: 10px;
}
.upload-preview img {
  width: 100%;
  max-height: 160px;
  object-fit: cover;
  border-radius: 10px;
  display: block;
}
.img-name {
  display: block;
  font-size: 11px;
  color: #6b7280;
  margin-top: 6px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.remove-img {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.remove-img:hover {
  background: #ff2e4d;
}

/* =============================================
   SUBMIT BUTTON — mirip Uiverse ilkhoeri
   ============================================= */
.btn-submit {
  --color-has: 211deg 100% 48%;
  --ease: cubic-bezier(0.5, 0, 0.25, 1);
  width: 100%;
  padding: 14px;
  border: 1px solid rgba(255, 46, 77, 0.4);
  border-radius: 14px;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #ff2e4d 0%, #a30015 100%);
  box-shadow: 0 4px 20px rgba(255, 46, 77, 0.3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition:
    transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275),
    box-shadow 0.2s,
    background 0.3s;
  position: relative;
  overflow: hidden;
  margin-top: 4px;
}
.btn-submit::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.08) 0%, transparent 60%);
  pointer-events: none;
}
.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(255, 46, 77, 0.45);
}
.btn-submit:active {
  transform: scale(0.96);
  box-shadow: 0 2px 10px rgba(255, 46, 77, 0.2);
}
.btn-submit:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.btn-text, .btn-loading {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* =============================================
   SPINNER
   ============================================= */
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* =============================================
   STATUS
   ============================================= */
.status-container {
  margin-top: 12px;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  min-height: 18px;
}
.status-container.error { color: #ff2e4d; }
.status-container.info  { color: #60a5fa; }

/* =============================================
   POPUP
   ============================================= */
.popup-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 99999;
}
.popup-overlay.show {
  display: flex;
}

.popup-box {
  width: 300px;
  background: #0d0d10;
  border: 1px solid rgba(255, 46, 77, 0.35);
  border-radius: 20px;
  padding: 28px 22px;
  text-align: center;
  box-shadow: 0 0 40px rgba(255, 46, 77, 0.2);
  animation: popupShow 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes popupShow {
  from { opacity: 0; transform: scale(0.8) translateY(20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.popup-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  font-size: 26px;
}
.success-icon {
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.4);
  color: #22c55e;
}
.error-icon {
  background: rgba(255, 46, 77, 0.12);
  border: 1px solid rgba(255, 46, 77, 0.4);
  color: #ff2e4d;
}

.popup-title {
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 8px;
}
.popup-text {
  color: #6b7280;
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 18px;
}

.popup-btn {
  width: 100%;
  border: none;
  border-radius: 12px;
  padding: 11px;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: opacity 0.2s, transform 0.2s;
}
.popup-btn:hover  { opacity: 0.9; }
.popup-btn:active { transform: scale(0.97); }

.error-btn {
  background: linear-gradient(135deg, #ff2e4d, #a30015);
}
