@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap');

:root {
  --primary: #2563eb;
  --primary-light: #3b82f6;
  --primary-dark: #1d4ed8;
  --accent: #f59e0b;
  --text-main: #202124; /* Google dark grey */
  --text-muted: #5f6368; /* Google medium grey */
  --bg-gradient: linear-gradient(135deg, #f0f2f5 0%, #ffffff 100%); /* Lighter, more Google-like */
  --glass-bg: rgba(255, 255, 255, 0.9);
  --glass-border: rgba(255, 255, 255, 0.5);
  --glass-shadow: 0 1px 3px rgba(60,64,67,0.3), 0 4px 8px 3px rgba(60,64,67,0.15); /* Material design shadow */
  --danger: #d93025;
  --success: #1e8e3e;
  --radius: 8px; /* Google uses slightly sharper borders */
  --radius-sm: 6px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-gradient);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
  position: relative;
}

/* Background animated blobs */
.background-elements {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.blob {
  position: absolute;
  filter: blur(80px);
  opacity: 0.6;
  animation: float 10s infinite ease-in-out alternate;
}

.blob-1 {
  top: -10%;
  left: -10%;
  width: 50vw;
  height: 50vw;
  background: rgba(59, 130, 246, 0.4);
  border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
}

.blob-2 {
  bottom: -20%;
  right: -10%;
  width: 60vw;
  height: 60vw;
  background: rgba(245, 158, 11, 0.3);
  border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
  animation-delay: -5s;
}

.blob-3 {
  top: 30%;
  left: 50%;
  width: 40vw;
  height: 40vw;
  background: rgba(16, 185, 129, 0.2);
  border-radius: 50% 50% 30% 70% / 50% 60% 30% 60%;
  animation-delay: -2s;
}

@keyframes float {
  0% { transform: translate(0, 0) rotate(0deg) scale(1); }
  100% { transform: translate(50px, 30px) rotate(20deg) scale(1.1); }
}

/* Layout */
.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.glass-effect {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  border-radius: var(--radius);
}

/* Header */
.header {
  padding: 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* Sticky Wrapper */
.sticky-wrapper {
  position: sticky;
  top: 0;
  z-index: 100;
  padding-top: 24px;
  margin-top: -24px;
  padding-bottom: 12px;
  background: rgba(246, 248, 250, 0.95); /* Màu nền gần trùng với body để che content */
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* Header Image */
.header-image-container {
  width: 100%;
  margin-bottom: 12px; /* Rút gọn khoảng cách */
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--glass-shadow);
  display: flex;
}

.header-image {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

/* Tabs (Tối ưu Mobile First - Segmented Control) */
.tabs {
  display: flex;
  flex-direction: row;
  margin-bottom: 0; /* Rút gọn khoảng cách */
  background: rgba(0, 0, 0, 0.04);
  border-radius: 12px;
  padding: 4px;
  gap: 4px;
}

.tab-btn {
  flex: 1;
  padding: 10px 4px;
  font-size: 0.85rem; /* Cỡ chữ nhỏ vừa phải để fit 2 tab trên màn hình hẹp */
  font-weight: 700;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.25s ease-out;
  outline: none;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.3;
  min-height: 48px; /* Tối ưu Touch Target */
}

.tab-btn:hover {
  color: var(--primary);
}

.tab-btn.active {
  background: #fff;
  color: var(--primary);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.tab-content {
  display: none;
  animation: fadeIn 0.4s ease;
}

.tab-content.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Form Sections */
.form-section {
  padding: 24px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.8);
}

.section-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 2px dashed rgba(59, 130, 246, 0.2);
}

.section-icon {
  font-size: 1.3rem;
  background: white;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.full-width {
  grid-column: 1 / -1;
}

/* Inputs */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
}

.required {
  color: var(--danger);
  font-weight: bold;
}

input[type="text"],
input[type="tel"],
input[type="email"],
input[type="number"],
select {
  width: 100%;
  padding: 12px 16px;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--text-main);
  background: #f1f3f4; /* Nền xám nhạt để nổi bật so với nền trắng của form */
  border: 1px solid #dadce0; /* Viền mỏng tinh tế */
  border-radius: var(--radius-sm);
  outline: none;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.02); /* Đổ bóng chìm siêu nhẹ */
  transition: var(--transition);
}

input:focus, select:focus {
  background: #fff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15); /* Viền sáng khi focus */
}

input::placeholder {
  color: #94a3b8;
}

/* Date Selects */
.date-selects {
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr;
  gap: 10px;
}

select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 40px;
}

/* Custom Radio & Checkbox */
.radio-group, .checkbox-group {
  display: flex;
  gap: 16px;
}

.radio-group.vertical {
  flex-direction: column;
  gap: 12px;
}

.radio-group.wrap, .checkbox-group.wrap {
  flex-wrap: wrap;
}

.grid-2-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.radio-label, .checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-weight: 500;
  padding: 8px 12px;
  background: rgba(255,255,255,0.7);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.5);
  transition: var(--transition);
}

.radio-label:hover, .checkbox-label:hover {
  background: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px rgba(0,0,0,0.02);
}

input[type="radio"], input[type="checkbox"] {
  display: none;
}

.radio-custom, .checkbox-custom {
  width: 20px;
  height: 20px;
  border: 2px solid #cbd5e1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
}

.radio-custom {
  border-radius: 50%;
}

.checkbox-custom {
  border-radius: 6px;
}

input[type="radio"]:checked + .radio-custom {
  border-color: var(--primary);
  border-width: 6px;
}

input[type="checkbox"]:checked + .checkbox-custom {
  background: var(--primary);
  border-color: var(--primary);
}

input[type="checkbox"]:checked + .checkbox-custom::after {
  content: '✓';
  color: white;
  font-size: 12px;
  font-weight: bold;
}

input[type="radio"]:checked ~ span, 
input[type="checkbox"]:checked ~ span {
  color: var(--primary-dark);
  font-weight: 600;
}

.radio-label:has(input:checked), 
.checkbox-label:has(input:checked) {
  background: white;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 1px var(--primary-light);
}

/* Submit Button */
.form-actions {
  margin-top: 10px;
}

.form-actions-centered {
  display: flex;
  justify-content: center;
  width: 100%;
}

.btn-submit {
  width: 100%;
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 16px;
  font-size: 1.1rem;
  font-weight: 700;
  border-radius: var(--radius);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  transition: var(--transition);
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
  position: relative;
  overflow: hidden;
}

.btn-half {
  width: 50% !important;
  min-width: 240px;
}

.btn-submit::after {
  content: '';
  position: absolute;
  top: 0; left: -100%; width: 50%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: 0.5s;
}

.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 25px rgba(37, 99, 235, 0.4);
}

.btn-submit:hover::after {
  left: 150%;
}

.btn-submit:active {
  transform: translateY(1px);
  box-shadow: 0 5px 10px rgba(37, 99, 235, 0.3);
}

.btn-submit.loading {
  pointer-events: none;
  opacity: 0.9;
}

.btn-submit.loading .btn-icon {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  100% { transform: rotate(360deg); }
}

/* Footer */
.footer {
  text-align: center;
  padding: 16px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Info Tab Content Styles */
.info-content {
  padding: 32px;
}

.title-main {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--primary-dark);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: -0.02em;
}

.title-sub {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--primary);
  margin-bottom: 24px;
}

.text-center { text-align: center; }
.italic { font-style: italic; }
.text-primary { color: var(--primary); }

.desc-text {
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--text-main);
  margin-bottom: 24px;
}

.divider {
  border: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0,0,0,0.1), transparent);
  margin: 32px 0;
}

.section-heading {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 16px;
  border-left: 4px solid var(--primary);
  padding-left: 12px;
}

.info-list {
  padding-left: 20px;
  margin-bottom: 24px;
  line-height: 1.7;
}

.info-list li {
  margin-bottom: 8px;
}

.sub-list {
  padding-left: 20px;
  margin-top: 8px;
  list-style-type: circle;
}

.info-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.info-link:hover {
  text-decoration: underline;
}

.table-responsive {
  overflow-x: auto;
  margin-bottom: 24px;
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.info-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  font-size: 0.95rem;
}

.info-table th {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  padding: 12px;
  text-align: center;
  border: 1px solid rgba(255,255,255,0.2);
}

.info-table td {
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  text-align: center;
  color: var(--text-main);
}

.info-table tbody tr:nth-child(even) {
  background-color: #f8fafc;
}

.info-table tbody tr:hover {
  background-color: #f1f5f9;
}

.info-table td:nth-child(2) {
  text-align: left;
  font-weight: 500;
}

/* Toasts */
.toast-container {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: white;
  border-radius: var(--radius-sm);
  padding: 14px 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
  display: flex;
  align-items: center;
  gap: 12px;
  transform: translateX(-120%);
  transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  pointer-events: auto;
  min-width: 280px;
}

.toast.show {
  transform: translateX(0);
}

.toast-icon {
  font-size: 1.5rem;
}

.toast-content {
  flex: 1;
}

.toast-title {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 2px;
}

.toast-message {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.toast.success .toast-title { color: var(--success); }
.toast.error .toast-title { color: var(--danger); }

/* Floating Action Buttons */
.floating-contact {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  z-index: 999;
}

.fab {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-shadow: 0 4px 15px rgba(0,0,0,0.25);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.fab:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

.fab::before {
  content: '';
  position: absolute;
  top: -4px; left: -4px; right: -4px; bottom: -4px;
  border-radius: 50%;
  z-index: -1;
  animation: pulse 2s infinite;
}

.fab-hotline {
  background: #ff3b30;
  color: white;
}
.fab-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}
.fab-hotline::before {
  background: rgba(255, 59, 48, 0.4);
}

.fab-zalo {
  background: #0068ff;
  color: white;
  font-weight: 800;
  font-size: 1.05rem;
  font-family: Arial, sans-serif;
  letter-spacing: 0.5px;
}
.fab-zalo::before {
  background: rgba(0, 104, 255, 0.4);
  animation-delay: 1s;
}

@keyframes pulse {
  0% { transform: scale(0.9); opacity: 1; }
  100% { transform: scale(1.4); opacity: 0; }
}

/* Responsive (Mobile First Enhancements) */
@media (max-width: 640px) {
  .container {
    padding: 12px;
    gap: 12px;
  }
  
  .sticky-wrapper {
    padding-top: 12px;
    margin-top: -12px;
    padding-bottom: 8px;
  }

  .header-image-container {
    margin-bottom: 10px;
    border-radius: 8px;
  }

  .info-content {
    padding: 16px;
  }

  .title-main {
    font-size: 1.3rem;
  }
  
  .form-section {
    padding: 16px;
  }
  
  .form-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .grid-2-cols {
    grid-template-columns: 1fr;
  }
  
  .date-selects {
    gap: 6px;
  }

  .radio-label, .checkbox-label {
    padding: 12px 14px; /* Tăng touch target padding cho mobile */
    min-height: 48px; /* Touch target chuẩn */
  }
  
  select, input[type="text"], input[type="tel"], input[type="email"], input[type="number"] {
    padding: 12px 14px;
    font-size: 1rem; /* Prevent iOS zoom */
    min-height: 48px;
  }

  .toast-container {
    left: 16px;
    bottom: 16px;
    right: auto;
  }
  
  .toast {
    min-width: 0;
    width: calc(100vw - 100px); /* Leave space for FABs */
  }

  .floating-contact {
    bottom: 16px;
    right: 16px;
    gap: 12px;
  }

  .fab {
    width: 50px;
    height: 50px;
  }

  .fab-zalo {
    font-size: 0.95rem;
  }
}
