/* ============================================================
   appiosvn.xyz — Design System  ·  Apple Light Theme
   Nguồn duy nhất cho màu sắc / typography / component dùng chung.
   Nạp file này TRƯỚC CSS riêng của từng trang.
   ============================================================ */

:root {
  /* ── Surfaces ── */
  --bg:          #ffffff;   /* nền chính */
  --bg-2:        #f5f5f7;   /* nền section xám nhạt (Apple) */
  --bg-3:        #fbfbfd;
  --surface:     #ffffff;   /* card */
  --surface-2:   #f5f5f7;

  /* ── Text ── */
  --text:        #1d1d1f;   /* gần đen */
  --text-2:      #6e6e73;   /* phụ */
  --text-3:      #86868b;   /* mờ */

  /* ── Lines ── */
  --border:      rgba(0,0,0,0.09);
  --border-2:    rgba(0,0,0,0.14);
  --sep:         rgba(0,0,0,0.06);

  /* ── Accent (Apple blue) ── */
  --primary:       #0071e3;
  --primary-hover: #0077ed;
  --primary-press: #006edb;
  --primary-soft:  rgba(0,113,227,0.10);
  --primary-ring:  rgba(0,113,227,0.28);

  /* ── Trạng thái ── */
  --green:  #34c759;
  --green-soft: rgba(52,199,89,0.12);
  --orange: #ff9500;
  --orange-soft: rgba(255,149,0,0.12);
  --red:    #ff3b30;
  --red-soft: rgba(255,59,48,0.10);
  --purple: #af52de;

  /* ── Bo góc ── */
  --radius:     20px;
  --radius-lg:  28px;
  --radius-sm:  12px;
  --radius-pill: 980px;

  /* ── Shadow ── */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04), 0 1px 3px rgba(0,0,0,0.06);
  --shadow:    0 6px 24px rgba(0,0,0,0.07), 0 2px 6px rgba(0,0,0,0.04);
  --shadow-lg: 0 20px 56px rgba(0,0,0,0.12), 0 4px 12px rgba(0,0,0,0.05);
  --shadow-primary: 0 8px 24px rgba(0,113,227,0.28);

  /* ── Font ── */
  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter',
          'Segoe UI', 'Sora', Roboto, Helvetica, Arial, sans-serif;
}

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

html { scroll-behavior: smooth; background: var(--bg); -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

::selection { background: rgba(0,113,227,0.18); }

/* Thanh cuộn mảnh, sáng */
* { scrollbar-width: thin; scrollbar-color: rgba(0,0,0,0.22) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.18); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.30); background-clip: padding-box; }

/* ── Layout utilities ── */
.container { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* ── Gradient text (dùng cho tiêu đề nhấn) ── */
.t-gradient {
  background: linear-gradient(120deg, #0071e3 0%, #42a5ff 45%, #af52de 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ── Nút dùng chung ── */
.ui-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: inherit; font-size: 15px; font-weight: 600; line-height: 1;
  padding: 13px 24px; border-radius: var(--radius-pill);
  border: 1px solid transparent; cursor: pointer;
  transition: transform .18s ease, box-shadow .2s ease, background .2s ease, color .2s ease, border-color .2s ease;
  white-space: nowrap;
}
.ui-btn:active { transform: translateY(0) scale(0.98); }

.ui-btn-primary { background: var(--primary); color: #fff; box-shadow: var(--shadow-primary); }
.ui-btn-primary:hover { background: var(--primary-hover); transform: translateY(-2px); box-shadow: 0 12px 30px rgba(0,113,227,0.34); }

.ui-btn-ghost { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.ui-btn-ghost:hover { background: #ececed; border-color: var(--border-2); transform: translateY(-2px); }

.ui-btn-outline { background: transparent; color: var(--primary); border-color: rgba(0,113,227,0.35); }
.ui-btn-outline:hover { background: var(--primary-soft); border-color: var(--primary); }

/* ── Card dùng chung ── */
.ui-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ── Pill / badge ── */
.ui-pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 14px; border-radius: var(--radius-pill);
  font-size: 12.5px; font-weight: 600;
  background: var(--primary-soft); color: var(--primary);
  border: 1px solid rgba(0,113,227,0.18);
}

/* ── Input dùng chung ── */
.ui-input {
  width: 100%; font-family: inherit; font-size: 15px; color: var(--text);
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 13px 15px; outline: none;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
.ui-input::placeholder { color: var(--text-3); }
.ui-input:focus { background: #fff; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-ring); }

/* ── Nav avatar + dropdown (dùng chung landing / pricing …) ── */
.nav-user-wrap {
  position: relative; display: flex; align-items: center; gap: 8px;
  padding: 6px 12px 6px 6px; border-radius: var(--radius-pill);
  background: var(--bg-2); border: 1px solid var(--border);
  cursor: pointer; font-size: 14px; font-weight: 600; color: var(--text);
  transition: border-color .2s, background .2s;
}
.nav-user-wrap:hover { border-color: var(--border-2); background: #ececed; }
.nav-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, #0a84ff, #0071e3); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; flex-shrink: 0;
}
.nav-user-dropdown {
  position: absolute; top: calc(100% + 10px); right: 0;
  min-width: 200px; background: #fff; border: 1px solid var(--border);
  border-radius: 14px; box-shadow: var(--shadow-lg); padding: 6px;
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .2s, transform .2s, visibility .2s; z-index: 120;
}
.nav-user-dropdown.open { opacity: 1; visibility: visible; transform: none; }
.nav-user-dropdown a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 9px;
  font-size: 13.5px; font-weight: 500; color: var(--text-2);
  transition: background .15s, color .15s;
}
.nav-user-dropdown a i { width: 16px; text-align: center; }
.nav-user-dropdown a:hover { background: var(--bg-2); color: var(--text); }

@keyframes ui-spin { to { transform: rotate(360deg); } }
@keyframes ui-fade-up { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
