@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Inter', sans-serif;
  min-height: 100vh;
  background: #0a0e1a;
  color: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Animated background */
body::before {
  content: '';
  position: fixed;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: radial-gradient(ellipse at 20% 50%, rgba(16, 85, 170, 0.15) 0%, transparent 50%),
              radial-gradient(ellipse at 80% 20%, rgba(99, 52, 186, 0.12) 0%, transparent 50%),
              radial-gradient(ellipse at 50% 80%, rgba(14, 116, 144, 0.1) 0%, transparent 50%);
  animation: bgShift 15s ease-in-out infinite alternate;
  z-index: 0;
}
@keyframes bgShift {
  0% { transform: translate(0, 0) rotate(0deg); }
  100% { transform: translate(-3%, -3%) rotate(3deg); }
}

.container {
  position: relative; z-index: 1;
  width: 95%; max-width: 560px;
  padding: 20px;
}

/* Glass Card */
.card {
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(99, 102, 241, 0.15);
  border-radius: 20px;
  padding: 40px 36px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.05);
}

/* Header */
.card-header {
  text-align: center;
  margin-bottom: 32px;
}
.card-header .icon {
  font-size: 40px;
  margin-bottom: 12px;
  display: block;
}
.card-header h1 {
  font-size: 22px;
  font-weight: 700;
  background: linear-gradient(135deg, #818cf8, #06b6d4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 6px;
}
.card-header p {
  font-size: 13px;
  color: #64748b;
}

/* Form */
.form-group {
  margin-bottom: 18px;
}
.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.form-group input,
.form-group input[type="file"] {
  width: 100%;
  padding: 12px 16px;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 10px;
  color: #e2e8f0;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.form-group input:focus {
  outline: none;
  border-color: #818cf8;
  box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.15);
}
.form-group input::placeholder {
  color: #475569;
}
.form-group input[type="file"] {
  cursor: pointer;
  padding: 10px 16px;
}
.form-group input[type="file"]::file-selector-button {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
  border: none;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  margin-right: 10px;
  transition: opacity 0.2s;
}
.form-group input[type="file"]::file-selector-button:hover {
  opacity: 0.85;
}

/* Buttons */
.btn {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.35);
  margin-top: 8px;
}
.btn-primary:hover:not(:disabled) {
  box-shadow: 0 6px 25px rgba(99, 102, 241, 0.5);
}

.btn-secondary {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(99, 102, 241, 0.25);
  color: #818cf8;
  margin-top: 12px;
}
.btn-secondary:hover {
  background: rgba(99, 102, 241, 0.1);
}

.btn-success {
  background: linear-gradient(135deg, #059669, #0d9488);
  color: white;
  box-shadow: 0 4px 15px rgba(5, 150, 105, 0.3);
  margin-top: 12px;
}

/* QR Result Area */
.qr-result {
  display: none;
  text-align: center;
  margin-top: 28px;
  padding-top: 28px;
  border-top: 1px solid rgba(99, 102, 241, 0.12);
  animation: fadeIn 0.5s ease;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.qr-result h3 {
  font-size: 16px;
  font-weight: 600;
  color: #10b981;
  margin-bottom: 16px;
}
.qr-result h3::before {
  content: '✅ ';
}
#qrcode {
  display: inline-block;
  padding: 16px;
  background: white;
  border-radius: 12px;
  margin-bottom: 12px;
}
.qr-link {
  font-size: 11px;
  color: #64748b;
  word-break: break-all;
  margin-bottom: 8px;
  padding: 8px 12px;
  background: rgba(30, 41, 59, 0.6);
  border-radius: 8px;
}

/* Toast */
.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 14px 24px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  z-index: 1000;
  animation: slideIn 0.3s ease, fadeOut 0.3s ease 2.7s forwards;
}
.toast.error { background: #dc2626; color: white; }
.toast.success { background: #059669; color: white; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes fadeOut { to { opacity: 0; transform: translateY(-10px); } }

/* Password Screen */
.password-screen {
  text-align: center;
}
.password-screen input {
  text-align: center;
  letter-spacing: 2px;
}

/* Spinner */
.spinner {
  display: inline-block;
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== VERIFY PAGE ===== */
.verify-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 50px;
  color: #10b981;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 20px;
}
.verify-badge::before {
  content: '🛡️';
  font-size: 16px;
}

.info-grid {
  display: grid;
  gap: 14px;
  margin: 24px 0;
}
.info-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  background: rgba(30, 41, 59, 0.6);
  border-radius: 10px;
  border: 1px solid rgba(99, 102, 241, 0.08);
}
.info-item .label {
  font-size: 12px;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}
.info-item .value {
  font-size: 14px;
  font-weight: 500;
  color: #e2e8f0;
}

.loading-state {
  text-align: center;
  padding: 60px 20px;
}
.loading-state .spinner {
  width: 36px; height: 36px;
  border-width: 3px;
  margin-bottom: 16px;
}
.error-state {
  text-align: center;
  padding: 40px 20px;
  color: #f87171;
}
.error-state .icon { font-size: 48px; margin-bottom: 12px; display: block; }

/* Responsive */
@media (max-width: 480px) {
  .card { padding: 28px 20px; }
  .container { padding: 12px; }
}
