/* Linkif — Light Teal Design System */
:root {
  --primary:        #009688;
  --primary-light:  #4DB6AC;
  --primary-dim:    rgba(0,150,136,0.10);
  --primary-glow:   rgba(0,150,136,0.22);
  --accent:         #FF9800;
  --accent-dim:     rgba(255,152,0,0.12);
  --bg:             #E0F2F1;
  --surface:        #ffffff;
  --surface-hover:  #F5FAFA;
  --border:         rgba(0,150,136,0.18);
  --border-light:   #E0E0E0;
  --text:           #212121;
  --text-muted:     #757575;
  --text-light:     #9E9E9E;
  --divider:        #BDBDBD;
  --error:          #E53935;
  --success:        #00897B;
  --premium:        #FF9800;
  --radius:         16px;
  --radius-sm:      10px;
  --shadow-sm:      0 2px 8px rgba(0,0,0,0.07);
  --shadow:         0 4px 20px rgba(0,0,0,0.09);
  --shadow-lg:      0 8px 32px rgba(0,0,0,0.12);
  --transition:     0.2s cubic-bezier(0.4,0,0.2,1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: #f7fffe;
  background-image:
    radial-gradient(ellipse 80% 50% at 10% 0%, rgba(0,150,136,0.07) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 90% 100%, rgba(77,182,172,0.06) 0%, transparent 60%);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* === CARD === */
.glass {
  background: #ffffff;
  border: 1px solid #EEF5F5;
  border-radius: var(--radius);
  box-shadow: 0 2px 12px rgba(0,150,136,0.06), 0 1px 3px rgba(0,0,0,0.04);
}

/* === LAYOUT === */
.app-wrap { position: relative; min-height: 100vh; display: flex; flex-direction: column; }
.container { max-width: 900px; margin: 0 auto; padding: 0 20px; }
.container-sm { max-width: 480px; margin: 0 auto; padding: 0 20px; }

/* === NAVBAR === */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #ffffff;
  border-bottom: 1px solid #EEF5F5;
  padding: 11px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 8px rgba(0,0,0,0.06);
}
.navbar-logo {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.01em;
}
.navbar-logo img { height: 30px; width: 30px; object-fit: contain; border-radius: 7px; }
.navbar-actions { display: flex; gap: 10px; align-items: center; }

/* === BUTTONS === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
  font-family: inherit;
}
.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 3px 12px var(--primary-glow);
}
.btn-primary:hover { background: #00796B; transform: translateY(-1px); box-shadow: 0 6px 18px var(--primary-glow); }
.btn-secondary {
  background: white;
  border: 1.5px solid var(--primary);
  color: var(--primary);
}
.btn-secondary:hover { background: var(--primary-dim); }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { color: var(--text); background: rgba(0,0,0,0.05); }
.btn-accent { background: var(--accent); color: white; box-shadow: 0 3px 10px rgba(255,152,0,0.28); }
.btn-accent:hover { background: #F57C00; transform: translateY(-1px); }
.btn-sm { padding: 7px 13px; font-size: 0.8rem; border-radius: 8px; }
.btn-lg { padding: 14px 28px; font-size: 0.98rem; }
.btn-full { width: 100%; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none !important; }
.btn-danger { background: rgba(229,57,53,0.07); border: 1px solid rgba(229,57,53,0.22); color: var(--error); }
.btn-danger:hover { background: rgba(229,57,53,0.14); }

/* === FORMS === */
.form-group { margin-bottom: 17px; }
.form-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.form-input {
  width: 100%;
  padding: 11px 14px;
  background: white;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.9rem;
  transition: var(--transition);
  outline: none;
  font-family: inherit;
}
.form-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-dim); }
.form-input::placeholder { color: var(--text-light); }
.form-input.error { border-color: var(--error); }
.form-error { font-size: 0.76rem; color: var(--error); margin-top: 5px; }

/* === STEPPER === */
.stepper { display: flex; align-items: center; justify-content: center; gap: 0; margin-bottom: 32px; }
.step { display: flex; align-items: center; }
.step-dot {
  width: 32px; height: 32px; border-radius: 50%;
  background: white; border: 2px solid var(--divider);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 700; color: var(--text-muted);
  transition: var(--transition); position: relative; z-index: 1;
}
.step-dot.active { background: var(--primary); border-color: var(--primary); color: white; box-shadow: 0 0 14px var(--primary-glow); }
.step-dot.done { background: var(--success); border-color: var(--success); color: white; }
.step-line { width: 60px; height: 2px; background: var(--divider); transition: var(--transition); }
.step-line.done { background: var(--primary); }
.step-label { font-size: 0.71rem; color: var(--text-muted); text-align: center; margin-top: 5px; white-space: nowrap; }
.step-wrapper { display: flex; flex-direction: column; align-items: center; }

/* === REGISTER PAGE === */
.register-wrap { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px 20px; }
.register-card { width: 100%; max-width: 520px; padding: 42px; }
.register-title { font-size: 1.65rem; font-weight: 800; text-align: center; margin-bottom: 6px; color: var(--text); }
.register-subtitle { text-align: center; color: var(--text-muted); margin-bottom: 34px; font-size: 0.92rem; }
.step-panel { display: none; }
.step-panel.active { display: block; animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* === UPLOAD ZONE === */
.upload-zone {
  border: 2px dashed var(--divider); border-radius: var(--radius);
  padding: 28px; text-align: center; cursor: pointer; transition: var(--transition); background: white;
}
.upload-zone:hover, .upload-zone.dragover { border-color: var(--primary); background: var(--primary-dim); }
.upload-preview { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; margin: 0 auto 12px; display: block; border: 3px solid var(--primary); }
.upload-zone input[type=file] { display: none; }

/* === COLOR PICKER === */
.color-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.color-swatch { width: 32px; height: 32px; border-radius: 50%; cursor: pointer; border: 3px solid transparent; transition: var(--transition); }
.color-swatch.selected { border-color: var(--primary); transform: scale(1.2); }
.color-custom { width: 32px; height: 32px; border-radius: 50%; overflow: hidden; cursor: pointer; }
.color-custom input { width: 60px; height: 60px; border: none; cursor: pointer; transform: translate(-10px,-10px); }

/* === BLOCK GRID (modal) === */
.blocks-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 9px; margin-top: 12px; }
.block-btn {
  padding: 15px 10px; background: white; border: 1.5px solid var(--border-light);
  border-radius: var(--radius-sm); text-align: center; cursor: pointer;
  transition: var(--transition); position: relative;
}
.block-btn:hover:not(.locked) {
  border-color: var(--primary); background: var(--primary-dim);
  transform: translateY(-2px); box-shadow: var(--shadow-sm);
}
.block-btn.selected { border-color: var(--primary); background: var(--primary-dim); }
.block-btn.locked { opacity: 0.6; }
.block-btn.locked:hover { border-color: var(--accent); background: var(--accent-dim); }
.block-icon { font-size: 1.5rem; margin-bottom: 6px; }
.block-label { font-size: 0.76rem; color: var(--text-muted); font-weight: 500; }
.block-lock {
  position: absolute; top: 6px; right: 6px;
  font-size: 0.66rem; background: var(--accent-dim); color: var(--accent);
  border-radius: 4px; padding: 2px 5px; border: 1px solid rgba(255,152,0,0.28); font-weight: 700;
}

/* === DASHBOARD LAYOUT === */
.dash-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 22px;
  padding: 26px 22px;
  max-width: 1200px;
  margin: 0 auto;
  align-items: start;
}
@media (max-width: 768px) {
  .dash-layout {
    grid-template-columns: 1fr;
    padding: 16px 12px;
    gap: 14px;
  }
  .preview-panel { display: none; }
}
@media (max-width: 480px) {
  .navbar { padding: 10px 14px; }
  .navbar-actions .btn-ghost { display: none; }
  .panel { padding: 16px 14px; }
}
.sidebar { display: flex; flex-direction: column; gap: 13px; }
.panel { padding: 20px; border-radius: var(--radius); }
.panel-title {
  font-size: 0.73rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.09em; color: var(--primary);
  margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between;
}

/* === BLOCK LIST (sidebar) === */
.block-list { display: flex; flex-direction: column; gap: 7px; }
.block-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 13px;
  background: white;
  border: 1px solid var(--border-light);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius-sm);
  cursor: grab; transition: var(--transition);
  box-shadow: var(--shadow-sm);
}
.block-item:hover { background: var(--surface-hover); box-shadow: var(--shadow); transform: translateX(2px); }
.block-item.dragging { opacity: 0.4; box-shadow: var(--shadow-lg); }
.block-item-icon { font-size: 1.05rem; flex-shrink: 0; }
.block-item-info { flex: 1; min-width: 0; }
.block-item-label { font-size: 0.86rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.block-item-type { font-size: 0.71rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.block-item-actions { display: flex; gap: 4px; }
.icon-btn {
  width: 26px; height: 26px; border-radius: 7px; border: none;
  background: transparent; color: var(--text-muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; transition: var(--transition);
}
.icon-btn:hover { background: var(--primary-dim); color: var(--primary); }
.icon-btn.danger:hover { background: rgba(229,57,53,0.09); color: var(--error); }

/* Toggle */
.toggle-switch { position: relative; width: 34px; height: 19px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
  background: var(--divider); border-radius: 20px; transition: var(--transition);
}
.toggle-slider:before {
  content: ''; position: absolute; width: 13px; height: 13px;
  left: 3px; top: 3px; background: white; border-radius: 50%; transition: var(--transition);
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
input:checked + .toggle-slider { background: var(--primary); }
input:checked + .toggle-slider:before { transform: translateX(15px); }

/* === PHONE PREVIEW === */
.preview-panel { position: sticky; top: 82px; }
.phone-frame {
  width: 272px; height: 548px;
  border: 6px solid #1a2636;
  border-radius: 44px; overflow: hidden;
  margin: 0 auto; position: relative;
  box-shadow: 0 20px 50px rgba(0,0,0,0.2), inset 0 0 0 2px rgba(255,255,255,0.12);
}
.phone-notch {
  position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
  width: 70px; height: 17px; background: #1a2636; border-radius: 9px; z-index: 10;
}
.phone-screen { width: 100%; height: 100%; overflow-y: auto; overflow-x: hidden; scrollbar-width: none; }
.phone-screen::-webkit-scrollbar { display: none; }

/* === ALERTS === */
.alert {
  padding: 11px 13px; border-radius: var(--radius-sm); font-size: 0.86rem;
  margin-bottom: 13px; display: flex; align-items: center; gap: 8px;
}
.alert-error { background: rgba(229,57,53,0.07); border: 1px solid rgba(229,57,53,0.22); color: var(--error); }
.alert-success { background: rgba(0,137,123,0.07); border: 1px solid rgba(0,137,123,0.22); color: var(--success); }

/* === MODAL === */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.28); backdrop-filter: blur(5px);
  z-index: 1000; display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.open { display: flex; animation: fadeIn 0.2s ease; }
.modal { width: 100%; max-width: 440px; padding: 28px; background: white; border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.modal-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 5px; color: var(--text); }
.modal-subtitle { color: var(--text-muted); font-size: 0.86rem; margin-bottom: 20px; }
.modal-close {
  position: absolute; top: 13px; right: 13px;
  background: rgba(0,0,0,0.05); border: none; color: var(--text-muted);
  width: 27px; height: 27px; border-radius: 50%; font-size: 0.95rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: var(--transition);
}
.modal-close:hover { background: rgba(0,0,0,0.1); color: var(--text); }

/* === UPGRADE BANNER === */
.upgrade-banner {
  background: linear-gradient(135deg, rgba(255,152,0,0.07), rgba(255,87,34,0.05));
  border: 1px solid rgba(255,152,0,0.22); border-radius: var(--radius);
  padding: 17px; display: flex; align-items: center; gap: 13px;
}
.upgrade-icon { font-size: 1.9rem; }
.upgrade-text h3 { font-size: 0.93rem; font-weight: 700; margin-bottom: 3px; color: var(--text); }
.upgrade-text p { font-size: 0.8rem; color: var(--text-muted); }

/* === QR === */
.qr-section { text-align: center; padding: 18px; }
.qr-section img { border-radius: 12px; border: 4px solid var(--primary); margin-bottom: 13px; }
.qr-url {
  font-family: monospace; font-size: 0.8rem;
  background: var(--primary-dim); color: var(--primary);
  padding: 8px 13px; border-radius: 8px; word-break: break-all;
}

/* === SPINNER / LOADING === */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid rgba(0,150,136,0.18); border-top-color: var(--primary);
  border-radius: 50%; animation: spin 0.65s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-overlay {
  position: fixed; inset: 0; background: rgba(255,255,255,0.82);
  z-index: 9999; display: none; align-items: center; justify-content: center;
  flex-direction: column; gap: 14px;
}
.loading-overlay.show { display: flex; }

/* === TABS === */
.tabs { display: flex; gap: 4px; background: var(--primary-dim); padding: 4px; border-radius: var(--radius-sm); margin-bottom: 16px; }
.tab-btn {
  flex: 1; padding: 8px 13px; border: none; background: transparent;
  color: var(--text-muted); border-radius: 7px; font-size: 0.85rem;
  cursor: pointer; transition: var(--transition); font-weight: 500; font-family: inherit;
}
.tab-btn.active { background: var(--primary); color: white; box-shadow: var(--shadow-sm); }

/* === PLAN BADGE === */
.plan-badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 20px; font-size: 0.71rem; font-weight: 700; }
.plan-free { background: rgba(0,0,0,0.06); color: var(--text-muted); }
.plan-pro { background: linear-gradient(135deg, var(--accent), #FF5722); color: white; }

/* === RESPONSIVE === */
@media (max-width: 520px) {
  .register-card { padding: 22px 16px; }
  .blocks-grid { grid-template-columns: repeat(3, 1fr); }
  .stepper { gap: 0; }
  .step-line { width: 28px; }
  .dash-layout { padding: 16px 14px; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,150,136,0.18); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,150,136,0.32); }

/* Selection */
::selection { background: var(--primary-dim); color: var(--primary); }

/* === COLOR PICKER === */
.cp-wrap { display: flex; flex-direction: column; gap: 8px; }
.cp-top {
  display: flex; align-items: center; gap: 8px;
  background: white; border: 1.5px solid var(--border-light);
  border-radius: 10px; padding: 6px 10px;
  transition: border-color var(--transition);
}
.cp-top:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-dim); }

.cp-native-wrap {
  position: relative; width: 28px; height: 28px;
  border-radius: 7px; overflow: hidden; cursor: pointer; flex-shrink: 0;
  border: 1.5px solid var(--border-light);
}
.cp-native-wrap input[type="color"] {
  position: absolute; inset: -4px; width: calc(100% + 8px); height: calc(100% + 8px);
  border: none; padding: 0; cursor: pointer; opacity: 0;
}
.cp-native-icon {
  position: absolute; inset: 0; display: flex;
  align-items: center; justify-content: center; font-size: 0.85rem; pointer-events: none;
}

.cp-hash { font-family: monospace; font-size: 0.88rem; color: var(--text-muted); flex-shrink: 0; }
.cp-hex {
  flex: 1; border: none; outline: none; background: transparent;
  font-family: monospace; font-size: 0.9rem; color: var(--text);
  font-weight: 600; letter-spacing: 0.04em; min-width: 0; padding: 0;
  text-transform: uppercase;
}
.cp-hex::placeholder { color: var(--text-light); font-weight: 400; }

.cp-preview {
  width: 24px; height: 24px; border-radius: 6px; flex-shrink: 0;
  border: 1.5px solid var(--border-light);
  transition: background 0.15s;
}

.cp-swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.cp-swatch {
  width: 26px; height: 26px; border-radius: 6px; cursor: pointer;
  border: 2px solid transparent; transition: transform 0.12s, border-color 0.12s;
  flex-shrink: 0;
}
.cp-swatch:hover { transform: scale(1.15); }
.cp-swatch.active { border-color: var(--primary); transform: scale(1.1); }
.cp-swatch[data-color="#FFFFFF"] { border-color: var(--border-light); }
.cp-swatch[data-color="#FFFFFF"].active { border-color: var(--primary); }
