/* Application Portal Modal */
.portal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 1000;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  overflow-y: auto;
}
.portal-overlay.open { display: flex; }

.portal-modal {
  background: #fff;
  width: 100%;
  max-width: 720px;
  border-radius: 8px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
  margin: auto;
}

.portal-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 24px;
  background: #26286f;
  color: #d0a242;
  border-radius: 8px 8px 0 0;
}
.portal-modal-header h2 {
  font-size: 1.25rem;
  margin: 0;
  color: #d0a242;
}
.portal-close {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}
.portal-close:hover { color: #d0a242; }

.portal-modal-body {
  padding: 24px;
}

.portal-form .form-row {
  margin-bottom: 18px;
}
.portal-form label {
  display: block;
  font-weight: 600;
  color: #26286f;
  margin-bottom: 6px;
  font-size: 0.95rem;
}
.portal-form .required::after {
  content: " *";
  color: #c0392b;
}
.portal-form input[type="text"],
.portal-form select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 5px;
  font-size: 0.95rem;
  background: #fff;
}
.portal-form input[type="text"]:focus,
.portal-form select:focus {
  outline: none;
  border-color: #26286f;
  box-shadow: 0 0 0 2px rgba(38, 40, 111, 0.15);
}

.portal-form .radio-group,
.portal-form .option-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.portal-form .radio-option {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 400;
  color: #333;
  cursor: pointer;
}
.portal-form .radio-option input { width: auto; }

.portal-form .conditional {
  display: none;
  margin-top: 10px;
  padding: 12px;
  background: #f9f9f9;
  border-left: 3px solid #d0a242;
  border-radius: 0 4px 4px 0;
}
.portal-form .conditional.show { display: block; }

.portal-form .docs-section {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #eee;
}
.portal-form .docs-section h3 {
  color: #26286f;
  font-size: 1.05rem;
  margin: 0 0 6px;
}
.portal-form .docs-hint {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 14px;
}
.portal-form .doc-field {
  margin-bottom: 14px;
}
.portal-form input[type="file"] {
  width: 100%;
  font-size: 0.9rem;
  padding: 6px 0;
}

.portal-form .form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid #eee;
}
.portal-form .btn-cancel {
  background: #eee;
  color: #333;
  border: none;
  padding: 10px 18px;
  border-radius: 5px;
  font-weight: 600;
  cursor: pointer;
}
.portal-form .btn-submit {
  background: #26286f;
  color: #fff;
  border: none;
  padding: 10px 18px;
  border-radius: 5px;
  font-weight: 600;
  cursor: pointer;
}
.portal-form .btn-submit:hover { background: #00823f; }
.portal-form .btn-submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.portal-message {
  display: none;
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 5px;
  font-size: 0.95rem;
}
.portal-message.success {
  display: block;
  background: #e8f8ef;
  color: #00823f;
  border: 1px solid #00823f;
}
.portal-message.error {
  display: block;
  background: #fdecea;
  color: #c0392b;
  border: 1px solid #c0392b;
}

body.portal-open { overflow: hidden; }

@media (max-width: 600px) {
  .portal-modal-body { padding: 16px; }
  .portal-form .form-actions { flex-direction: column-reverse; }
  .portal-form .btn-cancel,
  .portal-form .btn-submit { width: 100%; }
}
