/********************************************************
 * Design Tokens
 ********************************************************/
:root {
    --radius: 1.25rem;

    /* Primary brand color */
    --primary: #078BFF;
    --primary-rgb: 7, 139, 255;
}

/********************************************************
 * Base
 ********************************************************/
html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
}

/********************************************************
 * Effects & Utilities
 ********************************************************/
.glass {
    backdrop-filter: blur(10px);
    background: rgba(12, 12, 12, 0.7);
}

.shadow-soft {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

/* Hero gradient: lớp 1 dùng primary, lớp 2 giữ nguyên màu hồng như cũ */
.hero-gradient {
    background:
        radial-gradient(1200px 600px at 50% -10%, rgba(var(--primary-rgb), .18), transparent 60%),
        radial-gradient(800px 400px at 80% 20%, rgba(236, 72, 153, .12), transparent 60%);
}

/* Entrance animation helpers */
.fade-up {
    opacity: 0;
    transform: translateY(12px);
    transition: all .6s ease;
}

.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Scroll helpers */
.snap-x {
    scroll-snap-type: x mandatory;
}

.snap-start {
    scroll-snap-align: start;
}

.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/********************************************************
 * Typography
 ********************************************************/
.prose a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.prose a:hover {
    text-decoration: underline;
}

.prose h2 {
    margin-top: 3.5rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 1.375rem;
    font-weight: 600;
    color: #f1f5f9;
}

.prose h2:first-child {
    border-top: none;
    margin-top: 2rem;
    padding-top: 0;
}

.prose h3 {
    letter-spacing: -0.01em;
}

/********************************************************
 * Forms: Inputs & Selects
 ********************************************************/
.ip {
    background: rgba(24, 24, 27, .6);
    border: 1px solid rgba(63, 63, 70, .7);
    border-radius: var(--radius, 1rem);
    padding: .75rem .9rem;
    width: 100%;
    color: #e5e7eb;
    outline: none;
}

.ip:focus {
    border-color: rgba(var(--primary-rgb), .9);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), .25);
}

.ip-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg fill='none' stroke='%23a1a1aa' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'><path d='M19 9l-7 7-7-7'></path></svg>");
    background-repeat: no-repeat;
    background-position: right .9rem center;
    background-size: 1rem;
    padding-right: 2.75rem;
    cursor: pointer;
}

.ip-select::-ms-expand {
    display: none;
}

/********************************************************
 * Buttons
 ********************************************************/
.btn {
    border-radius: .9rem;
    padding: .8rem 1rem;
    font-weight: 600;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:disabled {
    opacity: .6;
    cursor: not-allowed;
}

/********************************************************
 * Helper Texts & Misc
 ********************************************************/
.hint {
    font-size: .85rem;
    opacity: .7;
}

.hp-wrap {
    position: absolute;
    left: -5000px;
    top: -5000px;
}

.counter {
    text-align: right;
    font-size: .85rem;
    opacity: .6;
    margin-top: .25rem;
}

/********************************************************
 * Validation
 ********************************************************/
.ip.error {
    border-color: rgba(239, 68, 68, .9);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, .25);
}

.err-msg {
    color: #fca5a5;
    font-size: .85rem;
    margin-top: .25rem;
    display: none;
}

.err-msg.show {
    display: block;
}

/********************************************************
 * Phone 3D
 ********************************************************/
.stage {
    width: max-content;
    margin: 60px auto;
    perspective: 1200px;
    perspective-origin: 50% 40%;
}

.phone3d {
    --w: 320px;
    --h: 640px;
    --d: 44px;
    --r: 30px;
    --b: 12px;
    position: relative;
    width: var(--w);
    height: var(--h);
    transform-style: preserve-3d;
    -webkit-transform-style: preserve-3d;
    transform: rotateX(10deg) rotateY(-28deg) rotateZ(1deg);
    filter: drop-shadow(0 28px 60px rgba(0, 0, 0, .55));
    isolation: isolate;
}

.phone3d .face {
    position: absolute;
    transform-style: preserve-3d;
    -webkit-transform-style: preserve-3d;
}

.phone3d .front,
.phone3d .back {
    top: 0;
    left: 0;
    width: var(--w);
    height: var(--h);
    border-radius: var(--r);
    overflow: hidden;
    background: #0a0a0a;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .04) inset, 0 0 0 1px rgba(0, 0, 0, .6);
}

.phone3d .front {
    transform: translateZ(calc(var(--d) / 2));
}

.phone3d .back {
    transform: translateZ(calc(var(--d) / -2)) rotateY(180deg);
    background: radial-gradient(120% 90% at 30% 20%, #1a1a1a, #0f0f10 60%, #0b0b0c 100%);
}

.phone3d .screen {
    position: absolute;
    top: var(--b);
    left: var(--b);
    width: calc(100% - (var(--b) * 2));
    height: calc(100% - (var(--b) * 2));
    display: block;
    object-fit: cover;
    border-radius: calc(var(--r) - var(--b));
    outline: none;
    z-index: 2;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .06) inset, 0 0 18px rgba(0, 0, 0, .6) inset;
}

.phone3d .notch {
    position: absolute;
    top: 18px;
    left: 50%;
    width: 15px;
    height: 15px;
    transform: translateX(-50%);
    background: #000;
    border-radius: 999px;
    box-shadow: 0 0 0 2px #0a0a0a inset, 0 0 0 1px rgba(255, 255, 255, .04);
    z-index: 3;
}

.phone3d .right,
.phone3d .left {
    width: var(--d);
    height: var(--h);
    backface-visibility: visible;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .65);
}

.phone3d .top,
.phone3d .bottom {
    width: var(--w);
    height: var(--d);
    backface-visibility: visible;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .65);
}

.phone3d .right {
    top: 0;
    bottom: 0;
    right: 0;
    left: auto;
    transform-origin: left center;
    transform: rotateY(90deg) translateZ(calc(var(--w) / 2));
    background: linear-gradient(180deg, #0e0e10, #1b1b1e 45%, #0b0b0d 100%);
    box-shadow: inset 0 0 10px rgba(0, 0, 0, .6), 0 0 1px rgba(255, 255, 255, .04);
}

.phone3d .left {
    top: 0;
    bottom: 0;
    left: 0;
    right: auto;
    transform-origin: right center;
    transform: rotateY(-90deg) translateZ(calc(var(--w) / 2));
    background: linear-gradient(180deg, #16161a, #0f0f12 50%, #0a0a0c);
    box-shadow: inset 0 0 10px rgba(0, 0, 0, .6), 0 0 1px rgba(255, 255, 255, .04);
}

.phone3d .top {
    top: 0;
    left: 0;
    right: 0;
    bottom: auto;
    transform-origin: center bottom;
    transform: rotateX(90deg) translateZ(calc(var(--h) / 2));
    background: linear-gradient(90deg, #141417, #1d1d21 60%, #101013);
    box-shadow: inset 0 0 10px rgba(0, 0, 0, .6), 0 0 1px rgba(255, 255, 255, .04);
}

.phone3d .bottom {
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
    transform-origin: center top;
    transform: rotateX(-90deg) translateZ(calc(var(--h) / 2));
    background: linear-gradient(90deg, #0d0d10, #1a1a1e 50%, #0d0d10);
    box-shadow: inset 0 0 10px rgba(0, 0, 0, .6), 0 0 1px rgba(255, 255, 255, .04);
}

.prose p {
  margin-top: 1.1rem;
  margin-bottom: 1.1rem;
  line-height: 1.75;
}

.prose ul,
.prose ol {
  margin-top: 1.2rem;
  margin-bottom: 1.2rem;
  padding-left: 1.6rem;
}

.prose ul li,
.prose ol li {
  margin-bottom: 0.7rem;
}

.prose ul {
  list-style-type: disc;
}

.prose ol {
  list-style-type: decimal;
}

.prose ul ul,
.prose ol ol {
  margin-top: 0.6rem;
  margin-bottom: 0.6rem;
  list-style-type: circle;
}

.prose code {
  background: rgba(255, 255, 255, 0.06);
  padding: 0.15rem 0.4rem;
  border-radius: 0.4rem;
  font-size: 0.95em;
}

.prose .overflow-x-auto {
  padding: 0px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(20, 20, 22, 0.6);
  margin: 1.25rem 0 2rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
}

.prose table {
  width: 100%;
  min-width: 640px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.95rem;
  line-height: 1.55;
}

.prose thead th {
  text-align: left;
  font-weight: 600;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.04);
  color: #f1f5f9;
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
  white-space: nowrap;
}

.prose tbody td {
  padding: 12px 14px;
  vertical-align: top;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.prose tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}

.prose table tr:first-child th:first-child,
.prose table tr:first-child td:first-child {
  border-top-left-radius: 10px;
}
.prose table tr:first-child th:last-child,
.prose table tr:first-child td:last-child {
  border-top-right-radius: 10px;
}
.prose table tr:last-child td:first-child {
  border-bottom-left-radius: 10px;
}
.prose table tr:last-child td:last-child {
  border-bottom-right-radius: 10px;
}

.prose table + * {
  margin-top: 1.25rem;
}

@media (max-width: 420px) {
  .prose table {
    font-size: 0.9rem;
  }
  .prose thead th,
  .prose tbody td {
    padding: 10px 12px;
  }
}