/* Reset & Root Variables */
:root {
  --primary-color: #72bf44;
  --primary-hover: #61a834;
  --primary-light: #f4fbf0;
  --primary-border: #9ed47a;
  
  --text-main: #333333;
  --text-muted: #666666;
  --text-light: #888888;
  --text-orange: #f26522;
  
  --border-color: #d1d5db;
  --border-focus: #72bf44;
  --bg-page: #f0f2f5;
  --bg-card: #ffffff;
  --bg-alert: #e8f4fd;
  
  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.08);
  --shadow-popup: 0 10px 30px rgba(0, 0, 0, 0.15), 0 2px 6px rgba(0,0,0,0.06);
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 10px;
}

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

body {
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px 12px;
}

/* Container & Card */
.page-container {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
}

.card-register {
  background: var(--bg-card);
  border: 1px solid #e5e7eb;
  border-radius: var(--radius-md);
  padding: 28px 24px 32px;
  box-shadow: var(--shadow-card);
  position: relative;
}

/* Header */
.form-header {
  margin-bottom: 16px;
}

.form-title {
  font-size: 19px;
  font-weight: 700;
  color: var(--primary-color);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.form-title .radio-icon {
  font-size: 17px;
  color: var(--primary-color);
}

.sub-green {
  font-weight: 400;
  font-size: 16px;
  color: var(--primary-color);
}

.login-prompt {
  font-size: 13.5px;
  color: #444;
  line-height: 1.45;
}

.link-login {
  color: #1a1a1a;
  font-weight: 700;
  text-decoration: none;
}

.link-login:hover {
  text-decoration: underline;
  color: var(--primary-color);
}

/* Alert Banner */
.alert-banner {
  background-color: #e8f4fd;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 20px;
  border-left: 3px solid #0088cc;
}

.alert-icon {
  color: #ffb800;
  font-size: 15px;
  margin-top: 1px;
}

.alert-content {
  font-size: 12.5px;
  color: #1e3a8a;
  line-height: 1.45;
}

.alert-link {
  color: #0070ba;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

/* Form Styles */
.form-group {
  margin-bottom: 16px;
  position: relative;
}

.form-row {
  display: flex;
  align-items: center;
  margin-bottom: 18px;
}

.row-label {
  width: 100px;
  font-size: 14px;
  color: #333;
  font-weight: 500;
  flex-shrink: 0;
}

.form-label {
  display: block;
  font-size: 13.5px;
  color: #333;
  font-weight: 400;
  margin-bottom: 6px;
}

.form-label .required {
  color: #e53e3e;
}

.form-control {
  width: 100%;
  height: 40px;
  padding: 8px 12px;
  font-size: 13.5px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background-color: #fff;
  color: #333;
  outline: none;
  transition: all 0.2s ease;
  font-family: inherit;
}

.form-control:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(114, 191, 68, 0.15);
}

.form-control::placeholder {
  color: #a3a3a3;
  font-size: 13px;
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23666'%3e%3cpath d='M7 10l5 5 5-5z'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 20px;
  cursor: pointer;
}

/* Input with Button Attached */
.input-with-btn {
  display: flex;
  gap: 0;
}

.input-with-btn .form-control {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  border-right: none;
}

.btn-input-action {
  height: 40px;
  padding: 0 16px;
  background-color: var(--primary-color);
  color: #ffffff;
  border: 1px solid var(--primary-color);
  border-top-right-radius: var(--radius-sm);
  border-bottom-right-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-input-action:hover {
  background-color: var(--primary-hover);
}

.input-hint-orange {
  display: block;
  font-size: 12px;
  color: var(--text-orange);
  margin-top: 5px;
}

/* Radio Group */
.radio-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.radio-option {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  font-size: 14px;
  color: #333;
  user-select: none;
  position: relative;
}

.radio-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}

.radio-custom {
  width: 18px;
  height: 18px;
  border: 2px solid #a1a1aa;
  border-radius: 50%;
  margin-right: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.radio-option input[type="radio"]:checked ~ .radio-custom {
  border-color: #0284c7;
  background-color: #fff;
}

.radio-option input[type="radio"]:checked ~ .radio-custom::after {
  content: '';
  width: 10px;
  height: 10px;
  background-color: #0284c7;
  border-radius: 50%;
}

.radio-option.highlight-new {
  position: relative;
}

.badge-new {
  display: inline-block;
  background: linear-gradient(135deg, #f97316, #ef4444);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  margin-left: 5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  animation: pulse-badge 2s infinite ease-in-out;
}

@keyframes pulse-badge {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.08); opacity: 0.9; }
}

/* Inline Field Helper Notes (Hiển thị ngay dưới ô nhập khi click/focus) */
.field-helper-note {
  display: none;
  margin-top: 6px;
  font-size: 13px;
  font-style: italic;
  color: #222222;
  line-height: 1.5;
  transition: all 0.2s ease-in-out;
}

.field-helper-note.active {
  display: block;
  animation: fadeInNote 0.2s ease-in-out;
}

.field-helper-note p,
.field-helper-note .note-item {
  margin: 2px 0;
  display: block;
}

@keyframes fadeInNote {
  from {
    opacity: 0;
    transform: translateY(-3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.popup-arrow {
  position: absolute;
  width: 12px;
  height: 12px;
  background: #ffffff;
  border-left: 1px solid #72bf44;
  border-top: 1px solid #72bf44;
  transform: rotate(45deg);
  top: -7px;
  left: 30px;
}

.popup-inner {
  padding: 12px 14px;
  border-radius: 8px;
  background: linear-gradient(to bottom, #fcfefb, #ffffff);
}

.popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px dashed #e2e8f0;
  padding-bottom: 6px;
  margin-bottom: 8px;
}

.popup-icon {
  color: var(--primary-color);
  font-size: 14px;
  margin-right: 6px;
}

.popup-title {
  font-size: 13px;
  font-weight: 700;
  color: #1f2937;
  flex-grow: 1;
}

.popup-close {
  background: none;
  border: none;
  font-size: 18px;
  line-height: 1;
  color: #94a3b8;
  cursor: pointer;
  padding: 0 4px;
}

.popup-close:hover {
  color: #ef4444;
}

.popup-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 12.5px;
  color: #374151;
  line-height: 1.4;
}

.popup-item:last-child {
  margin-bottom: 0;
}

.popup-item-icon {
  color: var(--primary-color);
  font-size: 12px;
  margin-top: 2px;
  flex-shrink: 0;
}

.popup-item-text strong {
  color: #111827;
  font-weight: 600;
}

/* Highlighted Field State */
.field-highlighted {
  border-color: var(--primary-color) !important;
  background-color: var(--primary-light) !important;
}

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

.btn-submit {
  width: 100%;
  height: 46px;
  background-color: var(--primary-color);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 2px 4px rgba(114, 191, 68, 0.3);
}

.btn-submit:hover {
  background-color: var(--primary-hover);
  box-shadow: 0 4px 8px rgba(114, 191, 68, 0.4);
  transform: translateY(-1px);
}

.btn-submit:active {
  transform: translateY(0);
}

/* Modal Backdrop & Success Modal */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 16px;
}

.modal-box {
  background: #ffffff;
  border-radius: 10px;
  max-width: 420px;
  width: 100%;
  padding: 24px;
  text-align: center;
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
  animation: modalScale 0.25s ease-out;
}

@keyframes modalScale {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-icon-success {
  font-size: 48px;
  color: var(--primary-color);
  margin-bottom: 12px;
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 8px;
}

.modal-desc {
  font-size: 13.5px;
  color: #6b7280;
  line-height: 1.5;
  margin-bottom: 20px;
}

.btn-modal-close {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 10px 24px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.btn-modal-close:hover {
  background-color: var(--primary-hover);
}

/* Toast message for feedback */
.toast-msg {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1e293b;
  color: #fff;
  padding: 10px 18px;
  border-radius: 6px;
  font-size: 13px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  z-index: 3000;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: toastSlide 0.3s ease;
}

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

/* Mobile Responsiveness */
@media (max-width: 480px) {
  body {
    padding: 10px 6px;
  }
  .card-register {
    padding: 20px 16px;
  }
  .form-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .row-label {
    width: 100%;
  }
  .radio-group {
    gap: 12px;
  }
}
