@import url('https://fonts.googleapis.com/css2?family=DM+Sans:opsz,wght@9..40,400;9..40,500;9..40,700&display=swap');

/* ===== VARIABLES ===== */
:root {
  --mint: #00D26A;
  --mint-dark: #00B85C;
  --bg: #F6F8FA;
  --card: #FFFFFF;
  --text: #0D1117;
  --text2: #656D76;
  --text3: #ACB2B8;
  --border: #D1D9E0;
  --radius: 20px;
  --shadow: 0 2px 16px rgba(0,0,0,0.06);
}

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

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ===== LOGO ===== */
.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 24px;
}
.logo-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #00D26A, #00B85C);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0,210,106,0.35);
  flex-shrink: 0;
}
.logo-text { display: flex; flex-direction: column; line-height: 1.1; }
.logo-name { font-size: 18px; font-weight: 700; color: var(--text); letter-spacing: -0.3px; }
.logo-tagline { font-size: 11px; color: var(--text3); font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; }

/* ===== ADMIN PAGE ===== */
.admin-page {
  max-width: 580px;
  margin: 0 auto;
  padding: 40px 20px;
}
.admin-page h1 { font-size: 28px; font-weight: 700; text-align: center; margin-bottom: 6px; }
.admin-subtitle { text-align: center; color: var(--text2); font-size: 15px; margin-bottom: 32px; }

.tab-bar {
  display: flex;
  background: var(--card);
  border-radius: 14px;
  padding: 4px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}
.tab {
  flex: 1;
  text-align: center;
  padding: 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text2);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.25s;
}
.tab.active {
  background: var(--mint);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0,210,106,0.3);
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}
.card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text2);
  margin-bottom: 6px;
}
.form-group input, .form-group select {
  width: 100%;
  height: 46px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 0 14px;
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
}
.form-group input:focus {
  border-color: var(--mint);
  box-shadow: 0 0 0 3px rgba(0,210,106,0.12);
}
.hint { font-size: 12px; color: var(--text3); margin-top: 4px; }

.gen-btn {
  width: 100%;
  height: 50px;
  background: var(--mint);
  color: #fff;
  border: none;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 16px rgba(0,210,106,0.25);
}
.gen-btn:hover { background: var(--mint-dark); }

.result { display: none; text-align: center; }
.result.show { display: block; }
.qr-box {
  display: inline-block;
  padding: 20px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
  margin-bottom: 16px;
}
.result-name { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.result-type { font-size: 13px; color: var(--text3); margin-bottom: 16px; }
.result-info {
  background: #F0FAF4;
  border: 1px solid #C6F0D4;
  border-radius: 12px;
  padding: 14px 18px;
  font-size: 13px;
  color: #1A6B3B;
  text-align: left;
  margin-bottom: 16px;
  line-height: 1.7;
  word-break: break-all;
}
.dl-btn {
  display: inline-block;
  padding: 12px 36px;
  background: var(--text);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
}

/* ===== MODE INFO & ERROR BOXES ===== */
.mode-info {
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  border-radius: 14px;
  padding: 18px 20px;
  font-size: 13px;
  color: #92400E;
  line-height: 1.8;
  margin-bottom: 20px;
}
.mode-info strong { display: block; margin-bottom: 4px; }

.error-box {
  background: #FFF1F0;
  border: 1px solid #FFCCC7;
  border-radius: 14px;
  padding: 16px 20px;
  font-size: 13px;
  color: #CF1322;
  line-height: 1.8;
  margin-bottom: 20px;
  display: none;
}
.error-box strong { display: block; margin-bottom: 4px; font-size: 14px; }
.error-box code {
  background: rgba(0,0,0,0.06);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  word-break: break-all;
}
.deploy-links { margin-top: 10px; }
.deploy-links a {
  display: inline-block;
  margin-right: 10px;
  margin-top: 4px;
  color: #1677ff;
  font-weight: 600;
  text-decoration: none;
}
.deploy-links a:hover { text-decoration: underline; }

/* ===== DESIGN PANEL ===== */
.design-toggle {
  width: 100%;
  height: 44px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  color: var(--text2);
  cursor: pointer;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
}
.design-toggle:hover { border-color: var(--mint); color: var(--mint); }
.design-panel { display: none; margin-bottom: 16px; }
.design-panel.open { display: block; }
.design-section { margin-bottom: 16px; }
.design-section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}
.dot-styles { display: flex; flex-wrap: wrap; gap: 8px; }
.dot-style-btn {
  width: 48px;
  height: 48px;
  border: 2px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  font-size: 10px;
  font-weight: 600;
  color: var(--text2);
  transition: all 0.2s;
  flex-direction: column;
  gap: 2px;
}
.dot-style-btn:hover, .dot-style-btn.active {
  border-color: var(--mint);
  background: #F0FAF4;
  color: var(--mint);
}
.color-row { display: flex; gap: 16px; align-items: center; }
.color-item { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text2); }
.color-item input[type=color] {
  width: 36px;
  height: 36px;
  border: 2px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  padding: 2px;
  background: none;
}
.logo-upload-area {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}
.logo-upload-area:hover { border-color: var(--mint); }
.logo-upload-area .upload-text { font-size: 13px; color: var(--text3); }
.logo-preview {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: #F0FAF4;
  border-radius: 10px;
  margin-top: 8px;
}
.logo-preview img { width: 32px; height: 32px; object-fit: contain; border-radius: 4px; }
.logo-preview span { font-size: 13px; color: var(--text2); flex: 1; }
.logo-remove { background: none; border: none; color: var(--text3); cursor: pointer; font-size: 16px; }

/* ===== ADMIN FOOTER ===== */
.admin-footer {
  text-align: center;
  padding: 10px 0 40px;
  font-size: 12px;
  color: var(--text3);
}
.admin-footer a { color: var(--text3); text-decoration: none; margin: 0 6px; }
.admin-footer a:hover { text-decoration: underline; }

/* ===== USER PAGE ===== */
.user-page {
  max-width: 440px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 0;
  display: none;
  background: var(--bg);
}
.user-hero {
  background: linear-gradient(135deg, #00D26A 0%, #00E676 50%, #00B85C 100%);
  padding: 48px 24px 70px;
  text-align: center;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.user-hero::before {
  content: '';
  position: absolute;
  top: -50%; left: -30%;
  width: 160%; height: 160%;
  background: radial-gradient(circle, rgba(255,255,255,0.12) 0%, transparent 60%);
}
.user-hero-icon { font-size: 52px; margin-bottom: 12px; position: relative; }
.user-hero h1 { font-size: 28px; font-weight: 700; margin-bottom: 6px; position: relative; }
.user-hero p { font-size: 14px; opacity: 0.85; position: relative; }

.pwd-card {
  margin: -36px 20px 16px;
  background: var(--card);
  border-radius: var(--radius);
  padding: 22px 20px 18px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.10);
  position: relative;
  z-index: 2;
  text-align: center;
}
.pwd-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}
.pwd-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.04em;
  margin-bottom: 14px;
  word-break: break-all;
}
.copy-big-btn {
  width: 100%;
  height: 50px;
  background: var(--mint);
  color: #fff;
  border: none;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,210,106,0.3);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.copy-big-btn:hover { background: var(--mint-dark); }
.copy-big-btn.copied { background: #16a34a; box-shadow: none; }
.copy-hint { font-size: 12px; color: var(--text3); margin-top: 10px; }

.user-card {
  margin: 0 20px 16px;
  background: var(--card);
  border-radius: var(--radius);
  padding: 6px 20px;
  box-shadow: var(--shadow);
}
.user-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 13px 0;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}
.user-row:last-child { border-bottom: none; }
.user-row .k { font-size: 13px; color: var(--text2); }
.user-row .v { font-size: 13px; font-weight: 600; color: var(--text); }

.user-steps {
  margin: 0 20px 16px;
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
}
.user-steps-title { font-size: 13px; font-weight: 700; margin-bottom: 14px; color: var(--text); }
.step { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.step:last-child { margin-bottom: 0; }
.step-num {
  width: 22px; height: 22px;
  background: var(--mint); color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
  flex-shrink: 0; margin-top: 1px;
}
.step-text { font-size: 13px; color: var(--text2); line-height: 1.5; }

.user-footer {
  text-align: center;
  padding: 0 20px 40px;
  font-size: 12px;
  color: var(--text3);
}
.user-footer a { color: var(--text3); text-decoration: none; }

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
  .admin-page { padding: 20px 16px; }
  .admin-page h1 { font-size: 22px; }
}

/* ===== ADMIN HEADER WITH LANG SWITCHER ===== */
.admin-header {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin-bottom: 6px;
}
.admin-header h1 {
  font-size: 28px;
  font-weight: 700;
  text-align: center;
}
#langSwitcher {
  position: absolute;
  right: 0;
}
#langBtn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  color: var(--text2);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
#langBtn:hover { border-color: var(--mint); color: var(--mint); }
#langMenu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  min-width: 150px;
  z-index: 200;
  overflow: hidden;
}
#langMenu.open { display: block; }
.lang-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  border-bottom: 1px solid rgba(0,0,0,0.04);
}
.lang-option:last-child { border-bottom: none; }
.lang-option:hover { background: var(--bg); }
.lang-option.active { background: #F0FAF4; color: var(--mint); font-weight: 700; }
.lang-flag { font-size: 16px; }

/* Remove old h1 standalone margin since now inside admin-header */
.admin-page h1 { margin-bottom: 0; }