:root {
  --policy-modal-primary-color: #0072bc;
  --policy-modal-secondary-color: #fdf005;
  --policy-modal-background-color: #f4ebb6;
  --policy-modal-text-color: #333;
  --policy-modal-primary-font: "Anton", serif;
  --policy-modal-secondary-font: "Smooch Sans", serif;
  --policy-modal-success-color: #28a745;
}

.policy-modal {
  display: none;
  position: fixed;
  z-index: 10001;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    135deg,
    rgba(0, 114, 188, 0.2) 0%,
    rgba(0, 0, 0, 0.8) 100%
  );
  backdrop-filter: blur(10px);
  animation: fadeIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.policy-modal.show {
  display: flex !important;
  align-items: center;
  justify-content: center;
}

.policy-modal-content {
  background: linear-gradient(
    145deg,
    var(--policy-modal-background-color) 0%,
    #ffffff 100%
  );
  border-radius: 24px;
  padding: 0;
  width: 92%;
  max-width: 800px;
  max-height: 85vh;
  height: auto;
  box-shadow: 0 25px 80px rgba(0, 114, 188, 0.3),
    0 15px 35px rgba(0, 0, 0, 0.15), 0 5px 15px rgba(0, 0, 0, 0.1);
  border: 2px solid rgba(253, 240, 5, 0.4);
  transform: scale(0.8) translateY(-20px);
  animation: modalSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.policy-modal-content::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: linear-gradient(
    90deg,
    var(--policy-modal-primary-color) 0%,
    var(--policy-modal-secondary-color) 50%,
    var(--policy-modal-primary-color) 100%
  );
}

.policy-modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: rgba(220, 53, 69, 0.1);
  border: 2px solid var(--policy-modal-primary-color);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  color: var(--policy-modal-primary-color);
  font-size: 18px;
  z-index: 10;
}

.policy-modal-close:hover {
  background: #dc3545;
  color: white;
  transform: rotate(90deg);
  border-color: #dc3545;
}

.policy-modal-header {
  padding: 30px 40px 20px;
  text-align: center;
  border-bottom: 2px solid rgba(0, 114, 188, 0.15);
  flex-shrink: 0;
}

.policy-modal-icon {
  width: 65px;
  height: 65px;
  background: linear-gradient(
    135deg,
    var(--policy-modal-primary-color) 0%,
    #005a94 100%
  );
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 15px;
  box-shadow: 0 12px 30px rgba(0, 114, 188, 0.4),
    0 6px 15px rgba(0, 114, 188, 0.2);
  border: 3px solid rgba(255, 255, 255, 0.9);
  animation: iconPulse 2s ease-in-out infinite;
}

.policy-modal-icon i {
  color: white;
  font-size: 30px;
}

.policy-modal-title {
  font-family: var(--policy-modal-primary-font);
  font-size: 26px;
  color: var(--policy-modal-primary-color);
  margin: 0 0 8px 0;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-weight: 100;
}

.policy-modal-subtitle {
  font-family: var(--policy-modal-secondary-font);
  font-size: 14px;
  color: #666;
  margin: 0;
  font-weight: 500;
}

.policy-modal-body {
  padding: 25px 40px;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 150px;
  max-height: calc(85vh - 400px);
  font-family: var(--policy-modal-secondary-font);
  text-align: left;
}

.policy-modal-body::-webkit-scrollbar {
  width: 8px;
}

.policy-modal-body::-webkit-scrollbar-track {
  background: rgba(0, 114, 188, 0.05);
  border-radius: 10px;
}

.policy-modal-body::-webkit-scrollbar-thumb {
  background: var(--policy-modal-primary-color);
  border-radius: 10px;
}

.policy-modal-body::-webkit-scrollbar-thumb:hover {
  background: #005a94;
}

.policy-content {
  line-height: 1.8;
  color: var(--policy-modal-text-color);
}

.policy-content h4 {
  font-family: var(--policy-modal-primary-font);
  color: var(--policy-modal-primary-color);
  font-size: 19px;
  margin: 22px 0 12px 0;
  letter-spacing: 0.5px;
  font-weight: 400;
}

.policy-content h4:first-child {
  margin-top: 0;
}

.policy-content p {
  margin: 0 0 14px 0;
  font-size: 15px;
  line-height: 1.8;
}

.policy-content ul {
  margin: 12px 0 16px 20px;
  padding: 0;
}

.policy-content li {
  margin-bottom: 9px;
  font-size: 15px;
  line-height: 1.7;
}

.policy-content strong {
  color: var(--policy-modal-primary-color);
  font-weight: 700;
}

.policy-highlight {
  background: rgba(253, 240, 5, 0.2);
  padding: 14px 16px;
  border-left: 4px solid var(--policy-modal-secondary-color);
  border-radius: 4px;
  margin: 16px 0;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.7;
}

.policy-modal-footer {
  padding: 20px 40px 25px;
  border-top: 2px solid rgba(0, 114, 188, 0.15);
  background: rgba(0, 114, 188, 0.03);
  flex-shrink: 0;
}

.policy-checkboxes {
  margin-bottom: 20px;
}

.policy-checkbox-item {
  padding: 8px 10px;
  background: white;
  border-radius: 10px;
  margin-bottom: 14px;
  border: 2px solid rgba(0, 114, 188, 0.15);
  transition: all 0.3s ease;
  cursor: pointer;
  user-select: none;
}

.policy-checkbox-item:hover {
  border-color: var(--policy-modal-primary-color);
  background: rgba(0, 114, 188, 0.03);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 114, 188, 0.1);
}

.policy-checkbox-item.checked {
  border-color: var(--policy-modal-success-color);
  background: rgba(40, 167, 69, 0.03);
  box-shadow: 0 2px 8px rgba(40, 167, 69, 0.15);
}

.policy-checkbox-item:active {
  transform: translateY(0);
}

.policy-checkbox-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.policy-checkbox-item input[type="checkbox"] {
  width: 15px;
  height: 15px;
  cursor: pointer;
  accent-color: var(--policy-modal-success-color);
  flex-shrink: 0;
  border-radius: 4px;
  pointer-events: none;
}

.policy-checkbox-label {
  font-family: var(--policy-modal-secondary-font);
  font-size: 15px;
  color: var(--policy-modal-text-color);
  cursor: pointer;
  flex: 1;
  line-height: 1.4;
  font-weight: 600;
  pointer-events: none;
  margin: 0;
}

.policy-checkbox-label.required {
  color: var(--policy-modal-primary-color);
}

.policy-checkbox-sublabel {
  font-size: 13px;
  color: #666;
  font-weight: 400;
  line-height: 1.5;
  margin: 0;
  padding-left: 34px;
  pointer-events: none;
}

.policy-modal-actions {
  display: flex;
  justify-content: center;
  gap: 15px;
}

.policy-btn {
  font-family: var(--policy-modal-primary-font);
  padding: 14px 35px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-size: 16px;
  letter-spacing: 1px;
  text-transform: uppercase;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.policy-btn-accept {
  background: linear-gradient(
    135deg,
    var(--policy-modal-success-color) 0%,
    #1e7e34 100%
  );
  color: white;
}

.policy-btn-accept:hover:not(:disabled) {
  background: linear-gradient(135deg, #1e7e34 0%, #155724 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

.policy-btn-accept:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.policy-warning {
  text-align: center;
  padding: 12px 16px;
  background: rgba(255, 193, 7, 0.15);
  border: 2px solid #ffc107;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 14px;
  color: #856404;
  font-weight: 500;
  line-height: 1.6;
}

.policy-warning i {
  color: #ffc107;
  margin-right: 5px;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes modalSlideIn {
  to {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

@keyframes iconPulse {
  0%,
  100% {
    box-shadow: 0 12px 30px rgba(0, 114, 188, 0.4),
      0 6px 15px rgba(0, 114, 188, 0.2);
  }
  50% {
    box-shadow: 0 15px 35px rgba(0, 114, 188, 0.5),
      0 8px 20px rgba(0, 114, 188, 0.3);
    transform: scale(1.05);
  }
}

/* Responsive Design */
/* Optimized for tablets and medium screens (like 768x857) */
@media (max-width: 768px) and (min-height: 800px) {
  .policy-modal-content {
    width: 90%;
    max-width: 700px;
    max-height: 85vh;
  }

  .policy-modal-body {
    max-height: calc(85vh - 380px);
    min-height: 200px;
  }

  .policy-content p,
  .policy-content li {
    font-size: 15px;
  }
}

@media (max-width: 768px) {
  .policy-modal-content {
    width: 95%;
    max-width: 95%;
    max-height: 85vh;
  }

  .policy-modal-header {
    padding: 25px 25px 18px;
  }

  .policy-modal-body {
    padding: 20px 25px;
    max-height: calc(85vh - 370px);
    min-height: 150px;
  }

  .policy-modal-footer {
    padding: 18px 25px 22px;
  }

  .policy-modal-title {
    font-size: 24px;
  }

  .policy-modal-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 12px;
  }

  .policy-modal-icon i {
    font-size: 28px;
  }

  .policy-content h4 {
    font-size: 17px;
  }

  .policy-content p,
  .policy-content li {
    font-size: 14px;
  }

  .policy-highlight {
    font-size: 14px;
  }

  .policy-modal-actions {
    flex-direction: column;
  }

  .policy-btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .policy-modal-content {
    width: 96%;
    max-width: 96%;
    border-radius: 16px;
    max-height: 95vh;
  }

  .policy-modal-header {
    padding: 22px 18px 16px;
  }

  .policy-modal-body {
    padding: 18px 20px;
    max-height: calc(95vh - 240px);
    min-height: 250px;
  }

  .policy-modal-footer {
    padding: 16px 18px 20px;
  }

  .policy-modal-title {
    font-size: 22px;
  }

  .policy-modal-icon {
    width: 55px;
    height: 55px;
    margin: 0 auto 10px;
  }

  .policy-modal-icon i {
    font-size: 26px;
  }

  .policy-modal-subtitle {
    font-size: 13px;
  }

  .policy-content h4 {
    font-size: 16px;
    margin: 18px 0 10px 0;
  }

  .policy-content p,
  .policy-content li {
    font-size: 14px;
  }

  .policy-highlight {
    font-size: 14px;
    padding: 12px 14px;
  }

  .policy-btn {
    padding: 12px 25px;
    font-size: 14px;
  }

  .policy-checkbox-item {
    padding: 10px 12px;
  }

  .policy-checkbox-label {
    font-size: 14px;
  }

  .policy-checkbox-sublabel {
    font-size: 12px;
  }
}

/* ===========================
   Custom Alert Modal Styles
   =========================== */

.policy-alert-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 99999;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease-out;
}

.policy-alert-overlay.show {
  display: flex;
}

.policy-alert-modal {
  background: #ffffff;
  border-radius: 16px;
  padding: 32px;
  max-width: 420px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideUpAlert 0.3s ease-out;
  text-align: center;
}

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

.policy-alert-icon {
  width: 70px;
  height: 70px;
  margin: 0 auto 20px;
  background: linear-gradient(135deg, #ff6b6b, #ee5a6f);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pulseAlert 2s ease-in-out infinite;
}

.policy-alert-icon i {
  font-size: 36px;
  color: #ffffff;
}

@keyframes pulseAlert {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(238, 90, 111, 0.7);
  }
  50% {
    box-shadow: 0 0 0 15px rgba(238, 90, 111, 0);
  }
}

.policy-alert-title {
  font-family: var(--policy-modal-primary-font);
  font-size: 22px;
  font-weight: 700;
  color: #333;
  margin: 0 0 12px 0;
  letter-spacing: 0.5px;
}

.policy-alert-message {
  font-family: var(--policy-modal-secondary-font);
  font-size: 15px;
  color: #666;
  line-height: 1.6;
  margin: 0 0 24px 0;
}

.policy-alert-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.policy-alert-btn {
  font-family: var(--policy-modal-primary-font);
  padding: 12px 28px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.policy-alert-btn-primary {
  background: linear-gradient(
    135deg,
    var(--policy-modal-primary-color),
    #005a94
  );
  color: #ffffff;
  font-weight: 100;
}

.policy-alert-btn-primary:hover {
  background: linear-gradient(135deg, #005a94, #004470);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 114, 188, 0.3);
}

.policy-alert-btn-secondary {
  background: linear-gradient(135deg, #ec4545, #ec7169);
  color: #ffffff;
  font-weight: 100;
}

.policy-alert-btn-secondary:hover {
  background: linear-gradient(135deg, #f01818, #ec4d4d);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(108, 117, 125, 0.3);
}

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

/* Responsive for alert modal */
@media (max-width: 480px) {
  .policy-alert-modal {
    padding: 24px;
    max-width: 340px;
  }

  .policy-alert-icon {
    width: 60px;
    height: 60px;
  }

  .policy-alert-icon i {
    font-size: 30px;
  }

  .policy-alert-title {
    font-size: 19px;
  }

  .policy-alert-message {
    font-size: 14px;
  }

  .policy-alert-actions {
    flex-direction: column;
  }

  .policy-alert-btn {
    width: 100%;
    justify-content: center;
  }
}
