/* assets/common.css */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

body {
  background: #04162E;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px;
}

.app-container {
  max-width: 500px;
  width: 100%;
  background: rgba(4, 22, 46, 0.85);
  border-radius: 56px;
  padding: 20px 16px 24px;
  box-shadow: 0 20px 35px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
  border: 1px solid rgba(246, 180, 95, 0.3);
  text-align: center;
}

/* ----- NAVIGATION ----- */
nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-bottom: 16px;
  border-bottom: 1px solid rgba(246, 180, 95, 0.2);
  padding-bottom: 12px;
}

nav a {
  color: #9bb7d4;
  text-decoration: none;
  font-size: 0.7rem;
  background: #0a1018;
  padding: 4px 12px;
  border-radius: 30px;
  border: 1px solid transparent;
  transition: 0.2s;
}

nav a:hover,
nav a.active {
  border-color: #F6B45F;
  color: #F6B45F;
}

/* ----- USER PANEL ----- */
.user-panel {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.user-panel span {
  color: #9bb7d4;
  font-size: 0.7rem;
}

.user-panel button {
  background: #0a1018;
  border: 1px solid #F6B45F;
  color: #F6B45F;
  padding: 4px 12px;
  border-radius: 30px;
  font-size: 0.7rem;
  cursor: pointer;
}

.user-panel button.logout {
  border-color: #e74c3c;
  color: #e74c3c;
}

/* ----- QR AREA (index.html) ----- */
.qr-area {
  background: #0a1018;
  border-radius: 28px;
  padding: 24px 16px;
  margin-bottom: 16px;
}

.qr-input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 16px;
  border: 2px solid rgba(246, 180, 95, 0.3);
  background: #1e2a3a;
  color: #eaf2fb;
  font-size: 1rem;
  text-align: center;
  outline: none;
  font-family: inherit;
  margin-bottom: 16px;
}

.qr-input:focus {
  border-color: #F6B45F;
}

.qr-display {
  display: flex;
  justify-content: center;
  margin: 20px 0;
  min-height: 200px;
  align-items: center;
}

.qr-display canvas,
.qr-display img {
  border-radius: 16px;
  background: white;
  padding: 10px;
  max-width: 100%;
}

.generate-btn {
  background: #F6B45F;
  border: none;
  font-weight: bold;
  padding: 14px 32px;
  border-radius: 60px;
  color: #04162E;
  cursor: pointer;
  font-size: 1rem;
  width: 100%;
}

.generate-btn:active {
  transform: scale(0.96);
}

.download-section {
  margin-top: 16px;
  display: none;
}

.download-label {
  color: rgba(246, 180, 95, 0.7);
  font-size: 0.72rem;
  margin-bottom: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.download-btns {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

.dl-btn {
  background: #0a1018;
  border: 1px solid rgba(246, 180, 95, 0.4);
  color: #F6B45F;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: 40px;
  cursor: pointer;
  transition: 0.15s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.dl-btn:hover,
.dl-btn:active {
  transform: scale(0.97);
}

.dl-btn.png {
  border-color: #2ECC71;
  color: #2ECC71;
}
.dl-btn.png:hover {
  background: #2ECC71;
  color: #04162E;
}

.dl-btn.jpg {
  border-color: #3498DB;
  color: #3498DB;
}
.dl-btn.jpg:hover {
  background: #3498DB;
  color: #04162E;
}

.dl-btn.svg {
  border-color: #9B59B6;
  color: #9B59B6;
}
.dl-btn.svg:hover {
  background: #9B59B6;
  color: white;
}

/* ----- CUSTOMIZE (Pro) ----- */
.customize-section {
  margin-top: 16px;
  background: #0a1018;
  border-radius: 16px;
  padding: 16px;
}

.customize-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
}

.customize-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.customize-item label {
  color: #9bb7d4;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.customize-item input[type="color"] {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid #F6B45F;
  background: transparent;
  cursor: pointer;
  padding: 2px;
}

.customize-item select {
  background: #1e2a3a;
  color: #eaf2fb;
  border: 1px solid #F6B45F;
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 0.8rem;
}

.customize-item input[type="file"] {
  display: none;
}

.customize-item .logo-btn {
  background: #0a1018;
  border: 1px solid #F6B45F;
  color: #F6B45F;
  padding: 4px 12px;
  border-radius: 30px;
  font-size: 0.7rem;
  cursor: pointer;
}

.customize-item .logo-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* ----- TEMPLATE SELECTOR ----- */
.template-section {
  margin: 12px 0;
}

.template-section select {
  width: 100%;
  background: #1e2a3a;
  color: #eaf2fb;
  border: 1px solid #F6B45F;
  border-radius: 8px;
  padding: 6px;
  font-size: 0.9rem;
}

.template-fields {
  margin-top: 8px;
}

/* ----- PLAN SELECTOR ----- */
.plan-selector {
  margin-top: 12px;
  display: flex;
  gap: 16px;
  justify-content: center;
}

.plan-selector label {
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.plan-selector label input {
  accent-color: #F6B45F;
}

.pro-upgrade {
  display: none;
  margin-top: 10px;
  background: rgba(246, 180, 95, 0.1);
  border-radius: 12px;
  padding: 10px;
  color: #F6B45F;
  font-size: 0.75rem;
}

.pro-upgrade a {
  color: #F6B45F;
  font-weight: bold;
  text-decoration: underline;
  cursor: pointer;
}

/* ----- PURPOSE & EMAIL ----- */
.purpose-section {
  margin-top: 20px;
}

.purpose-label {
  color: rgba(246, 180, 95, 0.8);
  font-size: 0.75rem;
  margin-bottom: 10px;
  letter-spacing: 0.06em;
}

.purpose-btns {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.purpose-btn {
  background: #0a1018;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #b8d0e8;
  font-size: 0.75rem;
  padding: 7px 14px;
  border-radius: 30px;
  cursor: pointer;
  transition: 0.15s;
}

.purpose-btn.selected {
  background: rgba(246, 180, 95, 0.15);
  border-color: #F6B45F;
  color: #F6B45F;
}

.email-section {
  background: rgba(246, 180, 95, 0.06);
  border: 1px solid rgba(246, 180, 95, 0.2);
  border-radius: 20px;
  padding: 16px;
  margin-top: 16px;
}

.email-title {
  color: #F6B45F;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.email-sub {
  color: #9bb7d4;
  font-size: 0.7rem;
  margin-bottom: 12px;
  line-height: 1.4;
}

.email-row {
  display: flex;
  gap: 8px;
}

.email-input {
  flex: 1;
  padding: 10px 14px;
  border-radius: 40px;
  border: 1px solid rgba(246, 180, 95, 0.3);
  background: #1e2a3a;
  color: #eaf2fb;
  font-size: 0.85rem;
  outline: none;
  font-family: inherit;
}

.email-input:focus {
  border-color: #F6B45F;
}

.email-btn {
  background: #F6B45F;
  border: none;
  color: #04162E;
  font-weight: 700;
  font-size: 0.8rem;
  padding: 10px 16px;
  border-radius: 40px;
  cursor: pointer;
  white-space: nowrap;
}

.email-btn:active {
  transform: scale(0.96);
}

.email-skip {
  color: rgba(255, 255, 255, 0.25);
  font-size: 0.65rem;
  margin-top: 8px;
  cursor: pointer;
  text-decoration: underline;
}

.email-success {
  color: #2ECC71;
  font-size: 0.8rem;
  margin-top: 8px;
  display: none;
}

.email-privacy {
  color: rgba(255, 255, 255, 0.2);
  font-size: 0.6rem;
  margin-top: 6px;
}

/* ----- DASHBOARD ----- */
.dashboard-section {
  margin-top: 20px;
  display: none;
  background: #0a1018;
  border-radius: 16px;
  padding: 16px;
  max-height: 300px;
  overflow-y: auto;
}

.dashboard-section h3 {
  color: #F6B45F;
  margin-bottom: 10px;
}

.qr-list-item {
  background: #1e2a3a;
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.qr-list-item .info {
  text-align: left;
}

.qr-list-item .info strong {
  color: #eaf2fb;
}

.qr-list-item .info span {
  color: #9bb7d4;
  font-size: 0.7rem;
  display: block;
}

.qr-list-item .actions button {
  background: #F6B45F;
  border: none;
  color: #04162E;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.7rem;
  cursor: pointer;
  margin-left: 4px;
}

.qr-list-item .actions button.delete {
  background: #e74c3c;
  color: white;
}

/* ----- SCANNER (scanner.html) ----- */
#reader {
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
  background: #0a1018;
  border-radius: 20px;
  padding: 8px;
}

#result {
  margin-top: 16px;
  color: #eaf2fb;
}

#history {
  margin-top: 24px;
  text-align: left;
}

#history h3 {
  color: #F6B45F;
  margin-bottom: 8px;
}

/* ----- FOOTER ----- */
.footer {
  text-align: center;
  font-size: 0.6rem;
  color: #6c8fb0;
  margin-top: 12px;
}
