/* ========================================
   MESOFT - Registration Modal
   ======================================== */

/* Modal Overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  padding: 20px;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Modal Container */
.modal-container {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border-radius: 20px;
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.9) translateY(20px);
  transition: transform 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
}

.modal-overlay.active .modal-container {
  transform: scale(1) translateY(0);
}

/* Modal Header */
.modal-header {
  padding: 50px 35px 0;
  text-align: center;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
  color: #fff;
  font-size: 20px;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.modal-title {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 8px;
  line-height: 1.4;
}

.modal-subtitle {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
  margin: 0 0 24px;
}

/* Modal Body */
.modal-body {
  padding: 0 32px 40px;
}

/* Form Groups */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 8px;
}

.form-group input {
  width: 100%;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  font-size: 15px;
  color: #fff;
  transition: border-color 0.2s ease, background 0.2s ease;
  box-sizing: border-box;
}

.form-group input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.form-group input:focus {
  outline: none;
  border-color: var(--accent-blue, #3b82f6);
  background: rgba(255, 255, 255, 0.12);
}

/* Phone Input with Country Selector */
.phone-input-wrapper {
  display: flex;
  gap: 10px;
}

.country-selector {
  position: relative;
  flex-shrink: 0;
}

.country-selector-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  cursor: pointer;
  min-width: 90px;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.country-selector-btn:hover {
  border-color: rgba(255, 255, 255, 0.3);
}

.country-flag {
  font-size: 20px;    color: #fff;
}

.country-code {
  font-size: 14px;
  color: #fff;
  font-weight: 500;
}

.country-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  background: #1a1a2e;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  max-height: 240px;
  overflow-y: auto;
  z-index: 10000;
  width: 200px;
  display: none;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.country-dropdown.active {
  display: block;
}

.country-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.country-option:hover {
  background: rgba(255, 255, 255, 0.1);
}

.country-option.selected {
  background: rgba(59, 130, 246, 0.2);
}

.country-option span:first-child {
  font-size: 18px;
}

.country-option span:last-child {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.8);
}

.phone-input-wrapper input {
  flex: 1;
}

/* Checkbox */
.checkbox-group {
  margin-top: 24px;
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.5;
}

.checkbox-label input[type="checkbox"] {
  display: none;
}

.checkbox-custom {
  width: 20px;
  height: 20px;
  min-width: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  margin-top: 2px;
}

.checkbox-label input:checked + .checkbox-custom {
  background: var(--accent-blue, #3b82f6);
  border-color: var(--accent-blue, #3b82f6);
}

.checkbox-custom svg {
  width: 12px;
  height: 12px;
  stroke: #fff;
  stroke-width: 3;
  fill: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.checkbox-label input:checked + .checkbox-custom svg {
  opacity: 1;
}

/* Submit Button */
.btn-submit {
  width: 100%;
  padding: 16px 24px;
  background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  margin-top: 20px;
}

.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
}

.btn-submit:active {
  transform: translateY(0);
}

/* Success Message */
.modal-success {
  display: none;
  text-align: center;
  padding: 40px 32px;
}

.modal-success.active {
  display: block;
}

.modal-success-icon {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

.modal-success-icon svg {
  width: 32px;
  height: 32px;
  stroke: #fff;
  stroke-width: 3;
  fill: none;
}

.modal-success h3 {
  font-size: 20px;
  color: #fff;
  margin: 0 0 12px;
}

.modal-success p {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
  margin: 0;
}

/* Form Container */
.modal-form-container {
  display: block;
}

.modal-form-container.hidden {
  display: none;
}

/* Scrollbar for dropdown */
.country-dropdown::-webkit-scrollbar {
  width: 6px;
}

.country-dropdown::-webkit-scrollbar-track {
  background: transparent;
}

.country-dropdown::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

/* Responsive */
@media (max-width: 480px) {
  .modal-container {
    max-width: 100%;
    border-radius: 16px;
  }

  .modal-header {
    padding: 24px 20px 0;
  }

  .modal-body {
    padding: 0 20px 24px;
  }

  .modal-title {
    font-size: 18px;
  }

  .phone-input-wrapper {
    flex-direction: column;
  }

  .country-selector {
    width: 100%;
  }

  .country-selector-btn {
    width: 100%;
    justify-content: center;
  }
}
