:root{
  --bg:#0b1220;
  --card:#111a2e;
  --primary:#22c55e;
  --text:#e2e8f0;
  --muted:#94a3b8;
}

*{box-sizing:border-box;margin:0;padding:0}

body{
  font-family:'Inter',sans-serif;
  background:linear-gradient(180deg,#0b1220,#0f172a);
  color:var(--text);
}

.container{
  text-align: center;
  width:92%;
  max-width:900px;
  margin:auto;
  padding:40px 0;
}

.hero{
  padding:60px 0 30px;
  text-align:center;
}

h1{
  font-size:28px;
  line-height:1.3;
}

h2{
  margin-bottom:15px;
}

p{
  color:var(--muted);
  margin-top:10px;
}

.btn{
  display:inline-block;
  padding:14px 24px;
  background:var(--primary);
  color:#000;
  font-weight:700;
  border-radius:8px;
  text-decoration:none;
  margin-top:20px;
  transition:.3s ease;
}

.btn:hover{
  transform:translateY(-3px);
  box-shadow:0 10px 20px rgba(34,197,94,.3);
}

.card{
  background:var(--card);
  padding:25px;
  border-radius:12px;
  margin-top:40px;
  box-shadow:0 10px 25px rgba(0,0,0,.4);
}

.fade{
  opacity:0;
  transform:translateY(20px);
  transition:all .6s ease;
}

.fade.show{
  opacity:1;
  transform:translateY(0);
}

iframe{
  width:100%;
  height:220px;
  border-radius:12px;
  margin-top:15px;
}

ul{
  padding-left:18px;
  margin-top:10px;
}

li{
  margin-bottom:8px;
}

form input, form button{
  width:100%;
  padding:14px;
  border-radius:8px;
  border:none;
  margin-top:12px;
  font-size:14px;
}

form input{
  background:#1e293b;
  color:white;
}

form button{
  background:var(--primary);
  font-weight:700;
  cursor:pointer;
  transition:.3s;
}

form button:hover{
  transform:scale(1.02);
}

footer {
  text-align: center;
  padding: 30px 0;
  font-size: 13px;
  color: #aaa;
}

footer p {
  margin: 6px 0;
}

@media(min-width:768px){
  h1{font-size:40px}
  iframe{height:400px}
}

.video-box{
  position: relative;
  padding-bottom: 177.77%; /* 9:16 */
  height: 0;
  overflow: hidden;
  border-radius: 16px;
  margin-top: 15px;
  max-width: 420px; /* tránh quá to trên desktop */
  margin-left: auto;
  margin-right: auto;
}

.video-box iframe{
  position: absolute;
  top:0;
  left:0;
  width:100%;
  height:100%;
}

.note-card{
  background:#fffbea;
  border-left:6px solid #facc15;
  padding:20px;
  border-radius:12px;
  box-shadow:0 6px 18px rgba(0,0,0,0.05);
  max-width:420px;
  margin:20px auto;
  transition:.3s ease;
}

.note-card:hover{
  transform:translateY(-4px);
}

.note-header{
  font-weight:800;
  font-size:14px;
  letter-spacing:1px;
  margin-bottom:8px;
  color:#b45309;
}

.note-body h3{
  margin:0 0 10px;
  font-size:18px;
}

.note-body p{
  font-size:14px;
  line-height:1.6;
  margin-bottom:15px;
  color:#111; /* đen đậm */
}

/* ===============================
   RESULTS – SAFARI FIXED VERSION
================================== */

.results-section {
  text-align: center;
}

.results-title {
  margin-bottom: 10px;
}

.results-sub {
  color: #94a3b8;
  margin-bottom: 20px;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  /* Thêm dòng này để ngăn các item bị kéo dãn không kiểm soát */
  align-items: start; 
}

/* Card ảnh */
.result-item {
  width: 100%;
  /* Khắc phục lỗi Safari: Ép tỷ lệ khung hình (ví dụ 3/4 hoặc 9/16 cho ảnh điện thoại) */
  aspect-ratio: 3 / 4; 
  border-radius: 16px;
  overflow: hidden;
  background: #0f172a;
  box-shadow: 0 8px 20px rgba(0,0,0,0.35);
  /* Đảm bảo item luôn chiếm đúng chiều rộng grid */
  min-width: 0; 
  display: flex;
}

/* Ảnh giữ form giống Chrome */
.result-item img {
  width: 100%;
  height: 100%;
  /* Quan trọng: Giúp ảnh không bị méo và lấp đầy khung hình */
  object-fit: cover;
  /* Căn lề ảnh lên trên cùng để thấy phần header của feedback */
  object-position: top; 
  display: block;
}

/* Desktop */
@media(min-width:768px){
  .results-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* MODAL */
.modal{
  display:none;
  position:fixed;
  z-index:9999;
  left:0;
  top:0;
  width:100%;
  height:100%;
  background:rgba(0,0,0,0.7);
  backdrop-filter: blur(5px);
}

.modal-content{
  background:#111a2e;
  color:#e2e8f0;
  max-width:400px;
  margin:10% auto;
  padding:30px;
  border-radius:16px;
  position:relative;
  text-align:left;
  animation:fadeIn 0.3s ease;
}

.modal-content h3{
  margin-bottom:15px;
}

.close-btn{
  position:absolute;
  right:15px;
  top:10px;
  font-size:24px;
  cursor:pointer;
}

@keyframes fadeIn{
  from{opacity:0; transform:translateY(20px);}
  to{opacity:1; transform:translateY(0);}
}
/* DOWNLOAD BUTTONS - GREEN BORDER VERSION */

.download-buttons{
  display:flex;
  gap:15px;
  justify-content:center;
  margin:25px 0;
  flex-wrap:wrap;
}

.store-btn{
  padding:14px 22px;
  border-radius:14px;
  text-decoration:none;
  font-weight:600;
  display:flex;
  align-items:center;
  gap:10px;
  transition:0.3s ease;
  background:linear-gradient(145deg,#111a2e,#0f172a);
  color:#e2e8f0;
  border:1px solid rgba(34,197,94,0.6); /* VIỀN XANH CHUNG */
}

.store-btn:hover{
  transform:translateY(-4px);
  box-shadow:0 0 18px rgba(34,197,94,0.35); /* glow xanh nhẹ */
  border-color:#22c55e;
}

/* SYSTEM GRID */

.system-grid{
  display:grid;
  gap:25px;
  margin-top:25px;
}

.system-item{
  background:#0f172a;
  border-radius:16px;
  padding:20px;
  text-align:left;
  transition:0.3s ease;
  border:1px solid rgba(255,255,255,0.05);
}

.system-item:hover{
  transform:translateY(-6px);
  box-shadow:0 15px 30px rgba(0,0,0,0.4);
}

.system-item img{
  width:100%;
  border-radius:12px;
  margin-bottom:15px;
}

.system-item h4{
  margin-bottom:10px;
  font-size:18px;
}

.system-item p{
  font-size:14px;
  color:#94a3b8;
  line-height:1.6;
}

/* Desktop */
@media(min-width:768px){
  .system-grid{
    grid-template-columns: repeat(3,1fr);
  }
}

/* ===== MODAL FIX FULL ===== */

.modal{
  display:none;
  position:fixed;
  inset:0;
  background:rgba(0,0,0,0.75);
  backdrop-filter:blur(6px);
  justify-content:center;
  align-items:center;
  padding:20px;
  z-index:9999;
}

.modal-content{
  background:#0f172a;
  width:100%;
  max-width:520px;          /* kiểm soát chiều ngang */
  max-height:90vh;          /* tránh tràn màn hình */
  overflow-y:auto;          /* nếu dài sẽ scroll */
  border-radius:18px;
  padding:30px;
  box-sizing:border-box;
  box-shadow:0 20px 60px rgba(0,0,0,0.6);
  position:relative;
}

/* Mobile tối ưu */
@media(max-width:480px){
  .modal-content{
    padding:22px;
    border-radius:16px;
  }
}

.close-btn{
  position:absolute;
  top:15px;
  right:18px;
  font-size:22px;
  cursor:pointer;
  color:#94a3b8;
}

.modal-content h3{
  margin-bottom:18px;
  font-size:20px;
}

.modal-content p{
  line-height:1.6;
  margin-bottom:12px;
  word-break:break-word;   /* chống tràn chữ */
}

/* Box lệnh */
.order-box{
  background:#111a2e;
  padding:18px;
  border-radius:14px;
  margin:18px 0;
  border:1px solid rgba(255,255,255,0.06);
}

/* Box giải thích */
.note-box{
  background:rgba(34,197,94,0.08);
  border:1px solid rgba(34,197,94,0.3);
  padding:18px;
  border-radius:14px;
  margin-top:15px;
}

/* BROKER POPUP */

.broker-section{
  margin-bottom:25px;
}

.broker-section h4{
  margin-bottom:8px;
  font-size:16px;
}

.broker-section img{
  width:100%;
  border-radius:12px;
  margin-top:10px;
  border:1px solid rgba(255,255,255,0.05);
}

/* GOLD BOX */

.gold-box{
  margin-top:30px;
  padding:20px;
  background:linear-gradient(145deg,#0f172a,#111a2e);
  border:1px solid rgba(255,255,255,0.05);
}

/* header */
.gold-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:15px;
}

.gold-label{
  background:rgba(34,197,94,0.15);
  color:#22c55e;
  padding:4px 10px;
  border-radius:8px;
  font-size:12px;
}

/* price */
.gold-main{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:15px;
}

.gold-price span{
  font-size:28px;
  font-weight:800;
}

.gold-price small{
  display:block;
  font-size:14px;
  margin-top:4px;
}

/* chart */
.gold-chart iframe{
  width:100%;
  height:220px;
  border-radius:12px;
}

/* mobile */
@media(max-width:480px){
  .gold-price span{
    font-size:24px;
  }
}

/* GOLD VN IFRAME - ĐỒNG BỘ XAUUSD */

.gold-vn-iframe{
  margin-top:15px;
  border-radius:16px;
  overflow:hidden; /* QUAN TRỌNG: bo góc iframe */
  border:1px solid rgba(255,255,255,0.05);
  background:linear-gradient(145deg,#0f172a,#111a2e);
  padding:8px; /* tạo viền giả giống card */
}

/* iframe bên trong */
.gold-vn-iframe iframe{
  width:100%;
  height:380px;
  border:none;
  border-radius:12px;
  background:#000; /* tránh flash trắng */
}