:root {
  --orange: #ff8c00;
  --orange-dark: #e07b00;
  --gray: #888;
  --text: #2c3e50;
  --bg: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh; /* Sử dụng dynamic viewport height để tránh bị co giãn sai khi bàn phím ảo xuất hiện trên mobile */
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  padding: 20px;
  overflow-x: hidden; /* Ngăn chặn cuộn ngang làm lệch màn hình */
}

.card {
  width: 100%;
  max-width: 420px;
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  position: relative;
  animation: fadeIn 0.4s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Tabs */
.tabs {
  display: flex;
}

.tab {
  flex: 1;
  text-align: center;
  padding: 20px 0;
  font-weight: 700;
  font-size: 16px;
  color: #fff;
  border: none;
  background: var(--gray);
  letter-spacing: 1.2px;
}

.tab.active {
  background: linear-gradient(135deg, var(--orange), var(--orange-dark));
}

.form-area {
  padding: 28px;
}

.field {
  position: relative;
  margin-bottom: 6px;
}

.field input {
  width: 100%;
  padding: 14px 44px 14px 50px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  outline: none;
  font-size: 16px; /* Đặt tối thiểu 16px để ngăn Safari trên iOS tự động phóng to (zoom) khi focus */
  color: var(--text);
  background: #fdfdfe;
  transition: all 0.25s ease;
}

.field input:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 4px rgba(255, 140, 0, 0.12);
  background: #fff;
}

.field input::placeholder {
  color: #a0aec0;
}

.field .required-mark {
  position: absolute;
  left: 36px;
  top: 50%;
  transform: translateY(-50%);
  color: #e53e3e;
  font-weight: bold;
  font-size: 14px;
  pointer-events: none;
  z-index: 1;
}

.field .icon-left {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255, 140, 0, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--orange);
  font-size: 13px;
}

.field .icon-right {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  color: var(--orange);
  font-size: 18px;
  user-select: none;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.field .icon-right:hover {
  opacity: 1;
}

/* Lỗi form */
.field-error {
  color: #e53e3e;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 12px;
  padding-left: 6px;
  display: none;
  align-items: center;
  gap: 6px;
}

.field-error.show {
  display: flex;
}

.field-error-icon {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  object-fit: contain;
  filter: brightness(0) saturate(100%) invert(32%) sepia(85%) saturate(1750%) hue-rotate(334deg) brightness(96%) contrast(92%);
}

/* Captcha Layout */
.captcha-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.captcha-row .field {
  flex: 1;
  margin-bottom: 0;
}

.captcha-row .field input {
  padding-right: 14px;
  padding-left: 45px;
}

.captcha-container {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.captcha-container img {
  height: 47px;
  width: 110px;
  object-fit: cover;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  cursor: pointer;
  background: #f7fafc;
}

.captcha-container button {
  padding: 0 12px;
  font-size: 16px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  background: #f7fafc;
  cursor: pointer;
  height: 47px;
  transition: background 0.2s;
}

.captcha-container button:hover {
  background: #edf2f7;
}

/* Nút Submit */
.submit-btn {
  width: 100%;
  padding: 15px 0;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 1px;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(22, 163, 74, 0.35);
  transition: all 0.25s ease;
}

.submit-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(22, 163, 74, 0.45);
}

.submit-btn:active {
  transform: translateY(0);
}

.submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.error-msg {
  color: #e53e3e;
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 14px;
  text-align: center;
  display: none;
}

.error-msg.show {
  display: block;
}

/* Success Panel */
.success-area {
  display: none;
  padding: 28px;
  text-align: center;
  animation: fadeIn 0.4s ease-in-out;
}

.success-area.show {
  display: block;
}

.success-icon {
  width: 56px;
  height: 56px;
  line-height: 56px;
  margin: 0 auto 14px auto;
  border-radius: 50%;
  background: #38a169;
  color: #fff;
  font-size: 26px;
  font-weight: 700;
}

.success-title {
  margin: 0 0 6px 0;
  font-size: 18px;
  color: var(--text);
}

.success-sub {
  margin: 0 0 20px 0;
  font-size: 13px;
  color: #718096;
}

.info-row {
  text-align: left;
  margin-bottom: 14px;
}

.info-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #718096;
  margin-bottom: 6px;
}

.info-value-box {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  background: #fdfdfe;
  padding: 12px 14px;
}

.info-value {
  flex: 1;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  word-break: break-all;
}

.copy-btn {
  flex-shrink: 0;
  border: none;
  background: rgba(255, 140, 0, 0.12);
  color: var(--orange);
  width: 34px;
  height: 34px;
  border-radius: 8px;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.2s;
}

.copy-btn:hover {
  background: rgba(255, 140, 0, 0.22);
}

.copy-btn.copied {
  background: #38a169;
  color: #fff;
}

.redirect-btn {
  margin-top: 6px;
}

/* Footer Disclaimer Styling */
.footer-disclaimer {
  padding: 0 28px 24px 28px;
  font-size: 11px;
  color: white;
  line-height: 1.5;
  border-top: 1px solid #edf2f7;
  margin-top: 10px;
  padding-top: 16px;
}

.footer-disclaimer p {
  margin: 0 0 8px 0;
}

.footer-disclaimer p:last-child {
  margin-bottom: 0;
}

/* Toast Notification */
.toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(-30px);
  background: #38a169;
  color: #fff;
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(0,0,0,0.15);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  pointer-events: none;
  z-index: 999;
}

.toast.error { background: #e53e3e; }
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Tối ưu hóa trên màn hình điện thoại nhỏ */
@media (max-width: 480px) {
  body {
    align-items: flex-start; /* Cho phép cuộn mượt mà từ trên xuống khi bàn phím ảo xuất hiện */
    padding-top: 30px;
  }
}


/* Logo styling */
.logo-container {
  text-align: center;
  background: #ffffff;
}

.logo-img {
  max-width: 150px; /* Bạn có thể điều chỉnh kích thước này cho phù hợp */
  height: auto;
  object-fit: contain;
}