:root {
  --bg-primary: #0a0f1d;
  --bg-card: rgba(23, 32, 54, 0.85);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: #3b82f6;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --primary: #3b82f6;
  --success: #10b981;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.15) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(139, 92, 246, 0.15) 0px, transparent 50%);
  color: var(--text-main);
  min-height: 100vh;
  padding: 30px 16px;
  line-height: 1.5;
}

.container { max-width: 760px; margin: 0 auto; }
header { text-align: center; margin-bottom: 26px; }

.badge {
  display: inline-block;
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
  padding: 3px 12px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 10px;
}

h1 {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 6px;
  background: linear-gradient(135deg, #ffffff 40%, #94a3b8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle { color: var(--text-muted); font-size: 14px; }
.header-links { margin-top: 10px; display: flex; justify-content: center; gap: 14px; }
.header-link { color: #38bdf8; font-size: 13px; text-decoration: none; font-weight: 600; }
.header-link:hover { text-decoration: underline; }

.card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 26px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  margin-bottom: 20px;
}

.form-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 640px) {
  .form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
}

.upload-zone {
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  padding: 18px 14px;
  text-align: center;
  cursor: pointer;
  transition: 0.2s;
  background: rgba(15, 23, 42, 0.4);
  position: relative;
}
.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--primary);
  background: rgba(59, 130, 246, 0.08);
}
.upload-zone input[type="file"] {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer;
}
.upload-icon { font-size: 26px; margin-bottom: 4px; display: block; }
.upload-label { font-weight: 600; font-size: 13px; color: #e2e8f0; }
.upload-hint { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.upload-filename { font-size: 12px; color: #38bdf8; font-weight: 600; margin-top: 6px; word-break: break-all; }

.input-group { display: flex; flex-direction: column; gap: 6px; }
.input-label { font-size: 13px; font-weight: 600; color: #cbd5e1; }
.input-control {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 10px 14px;
  color: #fff;
  font-size: 14px;
  outline: none;
  width: 100%;
}
.input-control:focus { border-color: var(--border-focus); }

.advanced-toggle {
  background: none; border: none; color: #94a3b8; font-size: 13px; cursor: pointer; margin: 10px 0 4px;
}
.advanced-toggle:hover { color: #fff; }
.advanced-panel { display: none; margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--border-color); }
.advanced-panel.open { display: block; }

.btn-submit {
  width: 100%;
  padding: 15px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
  transition: 0.2s;
  margin-top: 16px;
}
.btn-submit:hover:not(:disabled) { transform: translateY(-2px); }
.btn-submit:disabled { opacity: 0.5; cursor: not-allowed; }

.progress-box { display: none; text-align: center; padding: 26px 10px; }
.progress-box.active { display: block; }
.spinner {
  width: 44px; height: 44px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-left-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 14px;
}
@keyframes spin { 100% { transform: rotate(360deg); } }

.result-card { display: none; }
.result-card.active { display: block; }
.app-header { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.app-icon-img {
  width: 76px; height: 76px; border-radius: 16px; object-fit: cover;
  box-shadow: 0 6px 16px rgba(0,0,0,0.4); background: #1e293b;
}
.app-info-title { font-size: 19px; font-weight: 700; color: #fff; }
.app-info-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.action-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.action-btn {
  display: flex; align-items: center; justify-content: center;
  padding: 13px; border-radius: 12px; font-size: 14px; font-weight: 700;
  text-decoration: none; cursor: pointer; border: none;
}
.action-btn-install {
  background: linear-gradient(135deg, #10b981, #059669); color: #fff;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}
.action-btn-download { background: rgba(255, 255, 255, 0.1); color: #fff; }
.action-btn-copy {
  grid-column: span 2; background: rgba(59, 130, 246, 0.15); color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.qr-section {
  display: flex; flex-direction: column; align-items: center;
  text-align: center; padding-top: 14px; border-top: 1px solid var(--border-color);
}
.qr-box { background: #fff; padding: 6px; border-radius: 12px; margin-bottom: 6px; }
.qr-box img { display: block; width: 130px; height: 130px; }
.footer-text { text-align: center; font-size: 12px; color: #64748b; margin-top: 20px; }
